[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

  • From: Roger L Costello <costello@mitre.org>
  • To: "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
  • Date: Thu, 17 Mar 2022 11:57:48 +0000

Re:  Why is < illegal in an attribute value but theequivalent h
Thanks Pete. That makes sense.

And to be sure that I am crystal clear, when you say:

Internal logic converts "&#x3C;x>blah&#x3C;/x>" to "<x>blah</x>"

The resulting converted value:

    "<x>blah</x>"

does _not_ mean there is an element <x> with value blah. Rather, it means there is a stream of characters '<', 'x', '>', 'b', 'l', 'a', 'h', '<', '/', 'x', '>'  and those characters have no semantics and are not to be interpreted.

Correct?

/Roger

-----Original Message-----
From: Pete Cordell <pete++xmldev@codalogic.com> 
Sent: Thursday, March 17, 2022 7:48 AM
To: Roger L Costello <costello@mitre.org>; xml-dev@l...
Subject: [EXT] Re:  Why is < illegal in an attribute value but the equivalent hex and decimal character entities are legal?

On 17/03/2022 11:25, Roger L Costello wrote:
> So this is perfectly well-formed XML:
> 
> <Test foo="&#x3C;x>blah&#x3C;/x>"/>
> 
> And the numeric character references will be replaced during the parsing process to yield this:
> 
> <Test foo="<x>blah</x>"/>

I'd say that parsing <Test foo="&#x3C;x>blah&#x3C;/x>"/> yields an attribute named "foo" with a value of "<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 "&#x3C;x>blah&#x3C;/x>"

- Internal logic converts "&#x3C;x>blah&#x3C;/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
---------------------------------------------------------------------

_______________________________________________________________________

XML-DEV is a publicly archived, unmoderated list hosted by OASIS to support XML implementation and development. To minimize spam in the archives, you must subscribe before posting.

[Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
Or unsubscribe: xml-dev-unsubscribe@lists.xml.org
subscribe: xml-dev-subscribe@lists.xml.org List archive: http://lists.xml.org/archives/xml-dev/
List Guidelines: http://www.oasis-open.org/maillists/guidelines.php


[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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.