[Zope] - Re: [XML-SIG] RE: [Zope] - XML-style DTML code

Fred L. Drake Fred L. Drake, Jr." <fdrake@acm.org
Fri, 29 Jan 1999 10:40:22 -0500 (EST)


Christopher G. Petrilli writes:
 > Wouldn't the DTD restrict the use of < inside?  I thoguht the spec
 > required that except inside a couple things ... like PIs... that the <
 > and & characters must be escaped?

  Hmm... not the DTD, but you got me:  the XML spec may well restrict
the use of < and & in quoted attribute values.  While avoiding some of 
the delimiter-in-context rules from SGML for the benefit of parser
implementors, we end up with some ugly markup.  ;-(

 > >  >   <font size="&arg;">
 > > 
 > >   In neither SGML nor XML can markup be nested like this.  The use of
 > > entities is the proper way to do this in either case.  Perhaps a
 > > processing tool needs to be available which can perform "entity
 > > expansion" for specified entity names only?
 > 
 > I'm confused by what you mean here, being a newbie to XMLish things.

  I meant that '<foo bar="<!-- ... -->">' (SGML this time!) did not
contain nested markup.  (Same for the PI in an attribute value.)
  '<foo bar="&arg;">' does contain nested markup, but not nested
structure.
  My thought was that a tool could be written which would convert:

	<!DOCTYPE thing PUBLIC "..." [
		<!ENTITY frob CDATA "replacement text">
	]>
	<thing>
	  &frob;
	  &amp;
	</thing>

into this:

	<!DOCTYPE thing PUBLIC "...">
	<thing>
	  replacement text
	  &amp;
	</thing>

  Such a tool could perform expansion on either all the entities
defined in the internal subset (the stuff in [ ... ] in the DOCTYPE
declaration), or allow the user to specify a list of names (and
possibly values) from another source.


  -Fred

--
Fred L. Drake, Jr.	     <fdrake@acm.org>
Corporation for National Research Initiatives
1895 Preston White Dr.	    Reston, VA  20191