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

Setting doctype-system attribute of xsl-output element

Subject: Setting doctype-system attribute of xsl-output element
From: Graham Hannington <Ghannington@xxxxxxx>
Date: Tue, 4 Nov 2003 12:02:55 -0000
doctype system
I have an XSLT stylesheet that outputs XML* with entity references
preserved.
(*Very close to XHTML, but with a few custom attributes and other
modifications, for which I've created a custom DTD.)

To allow entity references in the result tree, my XSLT processor (MSXML 3)
requires the <xsl:output> element in the XSLT stylesheet to specify a DTD
that defines the entity references.

To begin with, I added an "http://..." reference to the XHTML DTD on the
Web, but this slowed the transform.

So I looked at pointing the doctype-system attribute at a local copy of the
DTD.
Now, this might be all very MSXML-specific (and will likely prompt lots of
"well, duh" reactions), but perhaps it might help someone, or otherwise
prompt a "try this other way, it's much better" response.

Before calling the transformNode... method, you can tweak the doctype-system
attribute via:

objXSLT.documentElement.selectSingleNode("xsl:output").setAttribute
"doctype-system", strDTDPath

where strDTDPath is the (typically, absolute) path of a DTD file on your
file system (for example, "c:\dtd\xhtml.dtd").

But what I've ended up doing is hardcoding a relative path in doctype-system
and then, prior to calling the transformNode... method, the script sets the
system current directory so that the relative path resolves to the correct
file:

WshShell.CurrentDirectory = strSourceFolderPath

This works fine, and the transform is now much faster.










 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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-2011 All Rights Reserved.