On 2012.08.04. 8:42, Dan Shelton wrote:
Can entities themselves contain XML tags? I'm trying to write my own
XML parser (for fun) and try to understand when entity expansion
should be done - before tag parsing, after tag parsing or do entities
only apply to text data?
They can contain XML tags and they must be well-nested (which means
something like well-formed but applied to that chunk only; i.e. one root
element, elements embedded properly, tags closed, attributes quoted).
And by default they belong to no namespace so if you use them in a
namespaced document, you most probably want to add a namespace
declaration to the root element.
Anyway, if you are writing your own parser and you want to make it
standard-conformant (even though it is just for fun), you should better
refer to the actual standards than asking on mailing lists:
http://www.w3.org/TR/REC-xml/#entproc
If you do so, you will get more accurate description and there's less
chance you miss some important aspect.
Regards,
Gabor
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]