[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why is < illegal in an attribute value but theequivalent h
On 17/03/2022 11:25, Roger L Costello wrote: I'd say that parsing <Test foo="<x>blah</x>"/> yields an attribute named "foo" with a value of "<x>blah</x>".So this is perfectly well-formed XML: <Test foo="<x>blah</x>"/> And the numeric character references will be replaced during the parsing process to yield this: <Test foo="<x>blah</x>"/> It's not creating an alternate piece of XML that is then parsed again. The sequence is more like: - Low level XML tokeniser reads attribute name "foo" - Low level parse checks it's followed by "=" and quotes - Low level parser reads until it finds end quote, getting "<x>blah</x>" - Internal logic converts "<x>blah</x>" to "<x>blah</x>" - Internal logic creates a data record for an attribute of name "foo" with value "<x>blah</x>" and associates it with the element "Test". Regards, Pete. -- --------------------------------------------------------------------- Pete Cordell Codalogic Ltd Read & write XML in C++, http://www.xml2cpp.com ---------------------------------------------------------------------
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] |
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|