[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Entity processing (was new msxml behaviour)

  • From: Tim Bray <tbray@t...>
  • To: xml-dev@i...
  • Date: Wed, 05 Nov 1997 00:35:43 -0800

msxml entity
At 12:41 PM 05/11/97 +1300, Scott Cooper wrote:
>the new msxml contains this code ...
>	if (sb.length() > 0)
>       	sb.append(' ');
>notice the appending of a space. is this appropriate? 

Recent WG decisions require that parameter entity expansions (outside
of entitity values) should be forced to match an even number tokens
simply by appending & prepending spaces to their expansion; I 
hypothesize that this is what the msxml code is doing.

Of course, this can't be done when building the replacement text
of an internal text entity.  To aid in sorting this, out, I attach
a couple of my test files; credit is due to Henry Thomson, Michael
Sperberg-McQueen, and likely others for helping cook these up.

I *think* that the behavior of Lark 0.97 on these is per the spec.
But it's there's enough hair on this set of problems that there's
lots of ways I could be wrong. -Tim
<?XML version='1.0'?>
<!DOCTYPE test [
<!ELEMENT test (#PCDATA) >
<!ENTITY % xx '&#37;zz;'>
<!ENTITY % zz '&#60;!ENTITY tricky "error-prone" >' >
%xx;
<!ENTITY example "<p>An ampersand (&#38;#38;) may be escaped
 numerically (&#38;#38;#38;) or with a general entity
 (&amp;amp;).</p>" >
<!ENTITY % pub    "&#Xc9;ditions Gallimard" >
<!ENTITY   rights "All rights reserved" >
<!ENTITY   book   "La Peste: Albert Camus, &#Xa9; 1947 %pub;. &rights;" >
<!ENTITY   rights " - all rights reserved - ">
]>
<test>
<e1>This sample shows a &tricky; method.</e1>
<e2>&example;</e2>
<e3>&book;</e3>
</test>
<!DOCTYPE FOO
[
 <!ENTITY lt "&#60;">
 <!ENTITY  b "{Value of b}">
 <!ENTITY weird 'fo&#77;o&lt;bar'>
 <!ENTITY % d '{Value of d}'>
 <!ENTITY % defatt1 'DEF1 CDATA "{default 1}"'>
 <!ENTITY % bazatt '<!ATTLIST BAZ BIFF CDATA "QuidNunc" BAR CDATA "xyxy">'>
 <!ELEMENT FOO - - (#PCDATA|BAZ|BUM)*>
 <!ELEMENT BAZ - - (#PCDATA)>
 <!ELEMENT BUM - - (#PCDATA)>
 <!ATTLIST FOO BAR CDATA "A&b;C%d;E&#77;F">
         
 <!ATTLIST FOO BAR CDATA "Should not appear"> 
 %bazatt;
 <!ATTLIST BAZ %defatt1;> 
]>
<!--<FOO test='KL&#77;NO'>hi &lt;there-->
<FOO>
<BAZ BAR="A&b;C%d;E&#77;F"></BAZ>
<BUM>&weird;</BUM>
</FOO>


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.