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

Re: Moving (promoting) XML elements through XSL

Subject: Re: Moving (promoting) XML elements through XSL
From: "Mark Peters" <flickrmeister@xxxxxxxxx>
Date: Thu, 29 Jun 2006 19:39:44 -0400
Re:  Moving (promoting) XML elements through XSL
The script worked for you?  That's odd. I tried it, but my processor
returned the same results as before. My output file still displays the
title and body subnodes inside the topic element, but the script
deletes the indexterm element.

<?xml version="1.0" encoding="utf-8"?>
<topic id="i267011">
 <title>Software Requirements
    </title>
 <body>
  ..
    </body>
</topic>


<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
       <xsl:output indent="yes"/>
       <xsl:template match="/topic">
               <xsl:copy>
                       <xsl:apply-templates select="@*"/>
                       <prolog>
                               <metadata>
                                       <keywords>
                                               <xsl:copy-of
select="title/indexterm"/>
                                       </keywords>
                               </metadata>
                       </prolog>
                       <xsl:apply-templates select="node()"/>
               </xsl:copy>
       </xsl:template>
       <xsl:template match="indexterm"/>
       <xsl:template match="@*|node()">
               <xsl:copy>
                       <xsl:apply-templates select="@*|node()"/>
               </xsl:copy>
       </xsl:template>
</xsl:stylesheet>

It looks like the script should work. I'm confounded as to why it doesn't.


Thanks,
Mark

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-2007 All Rights Reserved.