xsl-list
[Top] [All Lists]

RE: Creating doctype-system value dynamically

2005-06-16 03:36:50
You can do this by generating the output file using 

<xsl:result-document doctype-system="{$v_dtd-sys-path}">

The value of the doctype-system attribute is an AVT, and it's run-time value
overrides anything specified in xsl:output.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Derek Revill [mailto:derek(_at_)revill(_dot_)demon(_dot_)co(_dot_)uk] 
Sent: 16 June 2005 11:21
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Creating doctype-system value dynamically

Hello,

Is it possible to generate the value for a doctype-system 
attribute (on and
<xsl:output>) dynamically - i.e. referencing a variable, or 
using an XPath
expression?

I'm using XSLT v2.0 and Saxon 8.4.

Reading M. Kay's book it says that the doctype-system 
attribute takes a
string as its value. I tried a few tests using variables and 
expressions but
these were faithfully reproduced as literal strings values.

I'd like to do something like:

<xsl:variable name="v_dtd-sys-path" select="resolve-uri('DTD/',
base-uri($v_stylesheet-node))" as="xs:anyURI"/>

<xsl:output 
name="isoxml"
method="xml" 
encoding="UTF-8" 
doctype-public="-//UBA//DTD ISO 12083:1993 Article UBA extensions//EN"
doctype-system="$v_dtd-sys-path"
indent="yes"/>

but have $v_dtd-sys-path evaluated at run time.

I want to create the system path to the DTD relative to wherever my
stylesheet is running from on the file system.

Any ideas on how to achieve this?

Thanks in advance.

Derek Revill

http://www.revill.demon.co.uk


--~------------------------------------------------------------------
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>
--~--





--~------------------------------------------------------------------
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>