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

Re: referencing to other xml and xsl files

Subject: Re: referencing to other xml and xsl files
From: "J.Pietschmann" <j3322ptm@xxxxxxxx>
Date: Thu, 11 Sep 2003 20:01:25 +0200
xref xml
Manolis Mavrikis wrote:
Lets say that 1.XML has an xref to 2.XML eg,
eg, <question xref="2">

So then 2.XML has a <title> element the value of which I want to import to
my final HTML when 1.XML is transformed. What should I look for to achieve
that ?

Look for the document() function. For example <xsl:template match="question"> <a href="{@xref}.html"> <xsl:value-of select="document(concat(@xref,'.xml'),/)/*/title"/> </a> </xsl:template>

Similarly I may want to "import" the result of the transformation of  the
whole of 2.XML with the same (or a differnet XSL) that I am using to
transform 1.XML.Is something like that possible in XSLT ? Or am I talking
non-sense ?

If the transformed referenced document is XML, and you can assure it is processed before the document which references it, just use document() again. Otherwise, look for frameworks suitable for complex arrangements of transformations, for example Cocoon http://cocoon.apache.org Note that specifically in Cocoon there are other methods of aggregating content favored over using document() in XSLT files.

J.Pietschmann



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