[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] Use same xml file with different XSL stylesheets


Subject: RE: [xsl] Use same xml file with different XSL stylesheets
From: "Ignacio Garcia del Campo" <igarc001@xxxxxxxxxxx>
Date: Fri, 30 Mar 2007 13:00:52 -0400

Yes, probably this is what would work best.

Using the processor to point to both the stylesheet and base xml document and then create the html, without creating the file with "<?xml-stylesheet?>"

The other solution was to create base_01.xml and base_02.xml with a container inside that point to the base xml file and then use the stylesheet to load it, using document();

Something like:

--base_01.xml--
<?xml-stylesheet ....?>
<foo>
 <file value="base.xml" />
 ...
</foo>
----------------------

--stylesheet.xsl--
for-each foo/file
  PROCESS FILE WITH document(@value)/...
/for-each
-----------------------

Thanks

From: "Michael Kay" <mike@xxxxxxxxxxxx>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: [xsl] Use same xml file with different XSL stylesheets
Date: Wed, 28 Mar 2007 20:57:29 +0100

> I have two different xsl stylesheets that will be applied to
> the same set of xml documents.

In this situation you really don't want to be using the <?xml-stylesheet?>
processing instruction.

Every XSLT processor has some kind of API that allows you to nominate the
XML source document and the XSLT stylesheet separately.

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


Current Thread
Keywords