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

RE: Two implementations, different results

Subject: RE: Two implementations, different results
From: "Steve Muench" <smuench@xxxxxxxxxxxxx>
Date: Thu, 23 Sep 1999 13:43:50 -0700
appending xsl variable
I know we have a known issue when <xsl:copy-of>
is used on the root node.
The following works for me on both XT and oraxsl 2.0.2 :

<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">
<xsl:variable name="source">
<Account>
  <Balance>1000</Balance>
</Account>
</xsl:variable>

<!-- Merge two <Accounts> by appending each Account -->

<xsl:template match="/">
   <Accounts>
       <xsl:apply-templates select="Account"/>
   </Accounts>
</xsl:template>

<xsl:template match="Account">
  <xsl:copy-of select="."/>
  <xsl:copy-of select="$source"/>
</xsl:template>

</xsl:stylesheet>

We have a known bug of producing the extraneous <root>
tag if you use <xsl:copy-of select="."/> on the root
node of the source document.
      
______________________________________________
Steve Muench
Consulting Product Manager & XML Evangelist
Business Components for Java Development Team 

| -----Original Message-----
| From: owner-xsl-list@xxxxxxxxxxxxxxxx
| [mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of Terris
| Sent: Thursday, September 23, 1999 12:27 PM
| To: xsl-list@xxxxxxxxxxxxxxxx
| Subject: Two implementations, different results
| 
| 
| With the attached document and style sheet, I get the following
| output with xt (http://www.jclark.com/xml/xt.html): (sansthe 
| namespace junk)
| 
| <Accounts>
| <Account>
|   <Balance>500</Balance>
| </Account>
| <Account>
|   <Balance>1000</Balance>
| </Account>
| </Accounts>
| 
| With the Oracle V2 parser (9/14 drop) I get:
| 
| <Accounts>
|    <root>
|       <Account>
|          <Balance>500</Balance>
|       </Account>
|    </root>
| </Accounts>
| 
| Which implementation is right?  What is <root> doing in Oracle's output?
| 
| 
| The document:
| 
| <Account>
|   <Balance>500</Balance>
| </Account>
| 
| The stylesheet:
| 
| <?xml version="1.0"?>
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/XSL/Transform/1.0">;
| 
| <xsl:output method="xml" indent="yes"/>
| 
| <xsl:variable name="source">
| <Account>
|   <Balance>1000</Balance>
| </Account>
| </xsl:variable>    <!--source of data-->
| 
| <!-- Merge two <Accounts> by appending each Account -->
| 
| <xsl:template match="/">
|    <Accounts>
|        <xsl:copy-of select="."/>
|                  <xsl:for-each select="document('')">
|            <xsl:copy-of select="//xsl:variable[@name
| = 'source']/*"/>
|        </xsl:for-each>
|    </Accounts>
| </xsl:template>
| 
| 
| </xsl:stylesheet>
| 
| 
| 
| 
| 
|  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.