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

RE: applying xsl to xml to produce different xml

Subject: RE: applying xsl to xml to produce different xml
From: "Richard Lander" <rlander@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 2 Dec 1999 12:40:47 -0500
xsl to xml
 Hello,

Thats easy.

Try:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  		    xmlns:xtfile="http://www.jclark.com/xt/java/java.io.File"
		    version="1.0"
                xmlns:xt="http://www.jclark.com/xt"
                extension-element-prefixes="xt">

<xsl:template match="books"/>

<xsl:template match="authors">
  <xsl:copy-of select=".">
    <xsl:apply-templates/>
  </xsl:copy-of>
</xsl:template>

<xsl:template match="author">
  <xsl:copy-of select=".">
    <xsl:apply-templates/>
  </xsl:copy-of>
</xsl:template>

</xsl:stylesheet>

Assume your file is called lib.xml and the stylsheet is lib.xsl, you'll want
to try:

xt lib.xml lib.xsl libout.xml
-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of
Clay_Rowland@xxxxxxxxxxx
Sent: Thursday, December 02, 1999 12:07 PM
To: xsl-list@xxxxxxxxxxxxxxxx
Subject: applying xsl to xml to produce different xml




I would like to apply a stylesheet to an xml doc and produce a new xml doc
with
only part of the original xml.

for example:

xml 1:

<library>
     <books>
          <title>title 1</title>
          <title>title 2</title>
     </books>
     <authors>
          <author>author 1</author>
          <author>author 2</author>
     </authors>
</library>


into

xml 2:

<authors>
     <author>author 1</author>
     <author>author 2</author>
</authors>


i would like to return a new xml doc containg only the the node authors and
its
children nodes.  i would like to retain the data in its tagged form.

any suggestions?

thanks.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.