A little bit more...

Tuesday, July 24, 2007

Tips on XML Spec

Which set of characters and their combinations can be used as literals of attribute value?
[10]    AttValue   ::=   '"' ([^<&"] | Reference)* '"'



|  "'" ([^<&'] | Reference)* "'"
If double quotes (single quotes) are used to quote the string then the same quotation mark (single-quote character or double-quote character), in addition to the other two characters specified in the above production, can't appear in the enclosed string. But what if one wants to  use the same quotation mark as the enclosing ones inside the enclosed string? In this case, "&quot;" and "&apos;" can be used instead.

e.g., <xxx yyy="..."..."> incurs errors because of the extra double-quote character, instead, <xxx yyy="...&quot;..."> can be used.

Resources:

  1. xml spec 1.0


No comments:

About Me

My photo
I'm finishing my master degree in Software Engineering, Computer Science. I believe and have been following what Forrest Gump's Mam said: you have to do the best with what god gave you.