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

RE: Using XSL to output 2 files

Subject: RE: Using XSL to output 2 files
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Mon, 2 Feb 2009 12:15:36 -0000
RE:  Using XSL to output 2 files
In XSLT 2.0:

<xsl:template match="Catalog">
  <xsl:result-document href="cds.xml">
    <xsl:copy-of select="cds"/>
  </xsl:result-document>
  <xsl:result-document href="artists.xml">
    <xsl:copy-of select="artists"/>
  </xsl:result-document>
</xsl:template> 

In XSLT 1.0, you need to write two separate transformations, one to produce
each output file.

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

> -----Original Message-----
> From: Mike Stroud [mailto:stroudmw@xxxxxxxxx] 
> Sent: 02 February 2009 11:56
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Using XSL to output 2 files
> 
> Hello All,
> 
> I have (another) question. I have an XML file that looks like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <Catalog>
>   <cds>
>     <cd>
>       <number>000001</number>
>       <title>Empire Burlesque</title>
>     </cd>
>     <cd>
>       <number>000002</number>
>       <title>Hide Your Heart</title>
>     </cd>
>   </cds>
>   <artists>
>     <artist>
>       <number>000001</number>
>       <name>Bob Dylan</name>
>     </artist>
>     <artist>
>       <number>000002</number>
>       <name>Bonnie Tyler</name>
>     </artist>
>   </artists>
>  </Catalog>
> 
>  Can I use XSL to output 2 files: 1 for cds and another for atrists?
> 
> <?xml version="1.0" encoding="UTF-8"?>
>   <cds>
>     <cd>
>       <number>000001</number>
>       <title>Empire Burlesque</title>
>     </cd>
>     <cd>
>       <number>000002</number>
>       <title>Hide Your Heart</title>
>     </cd>
>   </cds>
> 
> <?xml version="1.0" encoding="UTF-8"?>
>   <artists>
>     <artist>
>       <number>000001</number>
>       <name>Bob Dylan</name>
>     </artist>
>     <artist>
>       <number>000002</number>
>       <name>Bonnie Tyler</name>
>     </artist>
>   </artists>
> 
> Thanks, Mike.

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.