OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Allowed PEReference usages

[ Lists Home | Date Index | Thread Index ]
  • To: Brett Kail <junkaddr@hotmail.com>
  • Subject: Re: [xml-dev] Allowed PEReference usages
  • From: Tim Bray <tbray@textuality.com>
  • Date: Tue, 01 Jul 2003 08:21:04 -0700
  • Cc: xml-dev@lists.xml.org
  • In-reply-to: <Law11-F113g1WTp6AVj00032e97@hotmail.com>
  • References: <Law11-F113g1WTp6AVj00032e97@hotmail.com>
  • User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.4) Gecko/20030624

Brett Kail wrote:

> Hello,
> 
> I've been reading the XML specs for some time now, and I am completely
> stumped attempting to understand the restrictions on PEReferences.
> Could someone please comment which pairs of definition/uses below are
> allowed?  An explanation or pointer to the relevant portion of the
> spec as to *why* the usage is valid/invalid would be extremely
> helpful.

Hmm, surprised nobody else has taken this up.  Of course you can't do 
any of these sleazy tricks in the internal subset.  Of the ones marked 
'Might work' below, I have this nervous feeling that I'm missing some rule.

> 
> <!ENTITY % pe "!ELEMENT e ANY">
> <%pe;>

That won't work because PE's get expanded with a space either side, so 
you get < !ELEMENT e ANY >, 1st space isn't allowed

> 
> <!ENTITY % pe "ELEMENT e ANY">
> <!%pe;>

Same problem, space after the !

> 
> <!ENTITY % pe "ELEMENT">
> <!%pe; e ANY>

Same problem, <! ELEMENT

> 
> <!ENEITY %pe " ">
> <!ELEMENT%pe;e ANY>

Might work.


> 
> <!ENTITY % pe "!ELEM">
> <%pe;ENT e ANY>

<!ELEM ENT, nope

> 
> <!ENTITY % pe "ELEM">
> <!%pe;ENT e ANY>

<! ELEM ENT
> 
> <!ENTITY % pe "Y">
> <!ELEMENT e AN%pe;>

Same prob

> 
> <!ENTITY % pe "ELEMENT e">
> <!%pe; ANY>

Nope


> 
> <!ENTITY % pe "x 'value'">
> <!ENTITY % %pe;>

Might work

> 
> <!ENTITY % pe "% x 'val">
> <!ENTITY %pe;ue'>

Might work, but the replacement text is 'val ue'

> 
> In addition, how does one declare a PE that contains a literal '%'?
> How about does one declare a PE that contains both a single and double
> quote?  Assuming that it is possible to declare a PE named 'percent'
> with a literal '%', is the following allowed?

Standard escaping mechanisms.


> 
> <!ENTITY %percent; x "value">

Someone want to try this out?  Might work -Tim






 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS