RE: XML Validity and DTD dependance

> John, I know about the "#define prefix" hack, but for me the killer
> is not that it prevents prefix re-use, but that it prevents default
> prefix re-use, which I think is much more common.

You can extend the hack to cover the default namespace, by including
the colon in the parameter entity.  But you need two entities, one for
the prefix and one for the suffix to xmlns declarations.  For example:

<!ENTITY % p "xhtml:">
<!ENTITY % s ":xhtml">

<!ENTITY % nsdecl "xmlns%s;">

<!ENTITY % html "%p;html">
<!ATTLIST %html; %nsdecl; CDATA #FIXED "http://blah/blah">

and then

<!ENTITY % p "">
<!ENTITY % s "">

will work.

-- Richard

Received on Wednesday, 20 April 2005 13:17:38 UTC