General question about XSLT capabilities

G

Grant Robertson

Can an XML Stylesheet Language Transform take data that is spread out in
multiple different XML files and not necessarily in proper order,
rearrange that data into it's proper order and then compile all of that
into a series HTML web pages for presentation? Or would I need to write a
custom program for that kind of thing?

Thanks
 
R

Richard Tobin

Grant Robertson said:
Can an XML Stylesheet Language Transform take data that is spread out in
multiple different XML files and not necessarily in proper order,
rearrange that data into it's proper order and then compile all of that
into a series HTML web pages for presentation?

Probably. Reading from multiple files is supported with the
document() function. Writing multiple files in XSLT 1.0 requires an
extension of some kind, such as <exsl:document> (see
http://www.exslt.org/); slternatively you could write a single
document and split it up somehow afterwards.

-- Richard
 
M

Martin Honnen

Grant said:
Can an XML Stylesheet Language Transform take data that is spread out in
multiple different XML files and not necessarily in proper order,
rearrange that data into it's proper order and then compile all of that
into a series HTML web pages for presentation? Or would I need to write a
custom program for that kind of thing?

XSLT 2.0 can do both, read from multiple files using the document function
<http://www.w3.org/TR/xslt20/#document>
and create multiple result files using the xsl:result-document instruction
<http://www.w3.org/TR/xslt20/#creating-result-trees>
Saxon 8 <http://www.saxonica.com> is an XSLT 2.0 processor available for
Java and for the Microsoft .NET framework.
 
J

Joe Kesselman

Grant said:
Can an XML Stylesheet Language Transform take data that is spread out in
multiple different XML files and not necessarily in proper order,
rearrange that data into it's proper order and then compile all of that
into a series HTML web pages for presentation? Or would I need to write a
custom program for that kind of thing?

Use the document() function to fetch their contents.

Reordering and so on is built into XSLT.

Multiple outputs is the tricky part. Basic XSLT 1.0 doesn't do that, but
you could achieve this by running several stylesheets (or one stylesheet
with different parameters each time). The EXSLT extension library, which
many-but-not-all XSLT processors support, adds the ability to "redirect"
output to additional documents and would let you do this in a single
stylesheet execution. XSLT 2.0 adds this capability as a standard part
of the language.
 
G

Grant Robertson

XSLT 2.0 can do both, read from multiple files using the document function
<http://www.w3.org/TR/xslt20/#document>
and create multiple result files using the xsl:result-document instruction
<http://www.w3.org/TR/xslt20/#creating-result-trees>
Saxon 8 <http://www.saxonica.com> is an XSLT 2.0 processor available for
Java and for the Microsoft .NET framework.


Awesome! All I need to know for now is if it is possible. Now I know
where to focus my energies when the time comes.

Thanks to everyone who responded so quickly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top