[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: doctype

Subject: Re: doctype
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Fri, 30 Jun 2006 13:22:39 -0400
doctype square brackets
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.