You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by sendy <se...@posterita.org> on 2009/07/13 09:09:02 UTC

Entitized characters in attribute values

Hi everybody,

It seems that special characters < and & are entitized as &lt; and &amp;
respectively, but not >.
Is there any reason to that? According to xml specs, or at least to my
understanding of it :-) , shouldn't > be entitized even when in attribute
value?

Thanks,
Sendy
-- 
View this message in context: http://www.nabble.com/Entitized-characters-in-attribute-values-tp24457087p24457087.html
Sent from the Xml Beans - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org


Re: Entitized characters in attribute values

Posted by David Waite <ma...@akuma.org>.
The textual contents of an element is controlled by the CharData  
symbol ( http://www.w3.org/TR/xml/#NT-CharData ):
[14]   	CharData	   ::=   	[^<&]* - ([^<&]* ']]>' [^<&]*)
Only '<', and '&' are disallowed (as they indicate the start of other  
XML symbols) , so quotes, double-quotes and greater than ('>') symbols  
do not require any encoding.

Similarly for AttValue ( http://www.w3.org/TR/xml/#NT-AttValue ):
[10]   	AttValue	   ::=   	'"' ([^<&"] | Reference)* '"'
|  "'" ([^<&'] | Reference)* "'"
Only '<', '&' and the particular quoting character used to surround  
the attribute value are disallowed; the other quote character and  
greater than ('>') do not require any encoding.

Of course these characters could be encoded (just as any character  
could be specified with a numeric character reference) - there just  
isn't a need to, and it increases the document size and processing  
required.

-DW

On Jul 13, 2009, at 1:09 AM, sendy wrote:

>
> Hi everybody,
>
> It seems that special characters < and & are entitized as &lt; and  
> &amp;
> respectively, but not >.
> Is there any reason to that? According to xml specs, or at least to my
> understanding of it :-) , shouldn't > be entitized even when in  
> attribute
> value?
>
> Thanks,
> Sendy
> -- 
> View this message in context: http://www.nabble.com/Entitized-characters-in-attribute-values-tp24457087p24457087.html
> Sent from the Xml Beans - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
> For additional commands, e-mail: dev-help@xmlbeans.apache.org
>