xsl-list
[Top] [All Lists]

Re: [xsl] doctype

2006-06-30 10:45:38
Marcus,

At 11:36 AM 6/30/2006, you wrote:
I probably missing something trivial here.

I have an xml document with the doctype:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://localhost/xslt/docbook/html/docbook.xsl";
type="text/xsl"?>
<!DOCTYPE book SYSTEM "../../System/DTD/main.dtd"[
  <!NOTATION XML SYSTEM "">
  <!NOTATION MIF SYSTEM "">
  <!NOTATION TIF SYSTEM "">
  <!NOTATION AI SYSTEM "">
  <!ENTITY % catalog PUBLIC "-//Siberlogic//ENTITIES V3.0.1//EN"
"file:///C:/xml/fips/catalog.pen">
  %catalog;
]>

On which I am going to run an identity transformation which is going to
do some filtering.

The question is - is can I keep the Doctype as is.

There are various xml:output options, but I seem to need to know what
the doctype is - and I really just want to pass it through.

If I have to define it - how do I define the part within the square
brackets. I( can see how to specify the rest but not that.

The part between the square brackets is called the "internal DTD subset".

And unfortunately there's no way in unextended XSLT to handle this gracefully. So no, you're not missing anything.

When forced into the corner, people often use a post-process to (re-)attach this kind of stuff. Alternatively, if you're using Saxon there are extensions that can help (though I can't say off hand if they're comprehensive enough to do the job for you).

If it were me, however, I wouldn't keep these particular NOTATION declarations (along with the declaration and invocation of that external parameter entity) in internal subsets at all, as they're not peculiar to particular documents, but rather (apparently) apply to an entire set of documents. I'd have them in an external subset module, where I could refer to them using the DOCTYPE's SYSTEM identifier. In other words, the thing that calls main.dtd would call a wrapper module containing these declarations and which would call main.dtd in its turn:

<!DOCTYPE book SYSTEM "amended.dtd" >

amended.dtd would look like:

  <!NOTATION XML SYSTEM "">
  <!NOTATION MIF SYSTEM "">
  <!NOTATION TIF SYSTEM "">
  <!NOTATION AI SYSTEM "">
  <!ENTITY % catalog PUBLIC "-//Siberlogic//ENTITIES V3.0.1//EN"
     "file:///C:/xml/fips/catalog.pen">
  %catalog;
  <!ENTITY % main SYSTEM "../../System/DTD/main.dtd">
  %main;

(Or maybe you could put this module next to main.dtd and adjust the paths accordingly.)

I'd regard this as better layering, and incidentally more accommodating of XSLT's limitations.

Good luck,
Wendell



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>