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: Wed, 28 Mar 2007 12:14:17 -0400
I am not using IE to do the XSL transformation.

Right now I am using XMLSpy to create the files.

The base xml file will be created from data in a Database, at the time the XML is created (base.xml) I would like to create base_01.xml and base_02.xml that include the stylesheets with the transformations.

I could easily create the three files containing all the data and they will work, but I would like to know if there is a way to reference base.xml from both base_01.xml and base_02.xml to save space.

This is just for space saving shake, it is not required for my plan to work.

Thanks.


From: cknell@xxxxxxxxxx
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 12:02:06 -0400

This is another good reason to avoid having IE do the XSL Transformation.

Please describe the system that generates and displays your data.

For example:

1) Data in database.
2) SQL query returns data as XML
3) XSLT Processor applies a stylesheet to XML to produce HTML
4) HTML is served to browser

I expect your setup doesn't divide the concerns so neatly, and this failure to separate concerns, while it seems like a slick and time-saving answer, results in a constricted, inflexible architecture.

Someone may have a work-around to your problem, but it will only delay the time when you have to address the real issue.


-- Charles Knell cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Ignacio Garcia del Campo <igarc001@xxxxxxxxxxx>
Sent:     Wed, 28 Mar 2007 11:45:52 -0400
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  [xsl] Use same xml file with different XSL stylesheets

Hello all,

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


Is there a way to create references to the BASE xml files to save space?

Let's say my xml file is 100 lines, if I want to apply the two XSL
stylesheets, I need to create two files base_01.xml and base_02.xml with 101
lines in each.


The extra line adds the reference to the XSL stylesheet to be used.

I would like to know if it is possible to create the files with just a few
lines, something like this:

------------------
base_01.xml
------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="stylesheet1.xsl" ?>
<?XML REFERENCE TO BASE.XML TO BE PROCESSED ?>

------------------
base_02.xml
------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="stylesheet2.xsl" ?>
<?XML REFERENCE TO BASE.XML TO BE PROCESSED?>


Thank you.

Current Thread