Next in thread → Next in month →

Re: [xml-dev] Couldn't illegal XML characters be used simply by escaping them?

From
David Carlisle <>
To
"Costello, Roger L." <>
Date
2012-11-10T16:56:07Z
ID
<>
Thread
Re: [xml-dev] Couldn't illegal XML characters be used simply by escaping them?
On 10/11/2012 13:08, Costello, Roger L. wrote:
> <Test> Here is a null character: &#x0;</Test>
>
> What will an XML Parser do with that character entity reference? It
> will resolve it (let (null) represent the null character):
>
> <Test> Here is a null character: (null)</Test>

> But now the output of the XML Parser is an XML document that contains
> an illegal character. Thus an error is thrown.
>

No, actually in XML 1.1 you can do that for everything except 0 so you
can escape character 1 that way, but an XML 1.1 parser will not resolve
&#x0; to a null, it is a fatal syntax error.

http://www.w3.org/TR/xml11/#NT-Char


In XML 1.0 any Numeric reference to a non XML character is a syntax error.

It is not that the reference is resolved and then at a later stage you
get an error from an illegal character, the syntax of numeric character
references explicitly makes such references a syntax error.

http://www.w3.org/TR/xml/#wf-Legalchar

David

-- 
google plus: https:/profiles.google.com/d.p.carlisle
Next in thread → Next in month →