[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Entity processing (was new msxml behaviour)
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 '%zz;'> <!ENTITY % zz '<!ENTITY tricky "error-prone" >' > %xx; <!ENTITY example "<p>An ampersand (&#38;) may be escaped numerically (&#38;#38;) or with a general entity (&amp;).</p>" > <!ENTITY % pub "Éditions Gallimard" > <!ENTITY rights "All rights reserved" > <!ENTITY book "La Peste: Albert Camus, © 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 "<"> <!ENTITY b "{Value of b}"> <!ENTITY weird 'foMo<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;EMF"> <!ATTLIST FOO BAR CDATA "Should not appear"> %bazatt; <!ATTLIST BAZ %defatt1;> ]> <!--<FOO test='KLMNO'>hi <there--> <FOO> <BAZ BAR="A&b;C%d;EMF"></BAZ> <BUM>&weird;</BUM> </FOO>
|
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
|