node-xml icon indicating copy to clipboard operation
node-xml copied to clipboard

Greater-than symbol in attribute values

Open danielearwicker opened this issue 11 years ago • 0 comments

Given the input:

<e a="&gt;">&gt;</e> 

the parser says the attribute's value is &gt; but the text content is ">". Similarly if the attribute value is &apos; it is not decoded. So attribute values are passed through without decoding, unlike text content.

Given the input:

<e a="&gt;">></e>

the parser says the same as before (this is correct, as encoding greater-than is optional except in the pattern ]]>.)

But given the input:

<e a=">"></e>

The parser gives the error: "Attribute: values are required and must be in quotes".

It seems this should be allowed in XML, and is allowed in most parsers: http://stackoverflow.com/questions/5665967/xml-parsing-curiosity-greater-than-in-attribute

danielearwicker avatar Mar 19 '14 10:03 danielearwicker