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

xalan:nodeset or xsl:copy-of problem

Subject: xalan:nodeset or xsl:copy-of problem
From: Ming <myu@xxxxxxxx>
Date: Tue, 23 Apr 2002 16:24:43 -0600
xalan nodeset
Hi,

I'm having problems with my stylesheet and after debugging, I found that
the problem may lie in the xalan:nodeset (or xsl:copy-of)part.

Here is part of my xml file:
<ztitle>
   <title db="dbName">title of the article</title>
</ztitle>

Here comes my stylesheet and the problem is explained in the comments:

 <xsl:template name="setup_db">
    <xsl:param name="field"/>
    <xsl:param name="db_list"/>
    <xsl:param name="full_path"/>


    <xsl:variable name="nodetree">
      <xsl:for-each select="$full_path[contains($dbs_searched,@db)]">
<!-- $dbs_searched variable is passed from a different stylesheet -->
        <xsl:copy-of select="."/>
      </xsl:for-each>
    </xsl:variable>

<!-- This statement does print out the attribute value of field $field,
which means that $full_path is a valid path and does contain @db
attribute -->
    <xsl:value-of select="$full_path/@db" />

<!-- This statement does print out the value of the field $field, which
means that $nodetree does have something there and does contain the
right $field value -->
    <xsl:value-of select="xalan:nodeset($nodetree)/*[name()=$field]" />

<!-- But, this statement doesn't give me the attribute value of the
field $field. It returned nothing. -->

    <xsl:value-of select="xalan:nodeset($nodetree)/*[name()=$field]/@db"
/>

<!-- some other codes -->

</xsl:template>

So, the problem seems to be that either the copy-of command doesn't copy
the whole tag or the xalan:nodeset wasn't be able to do the job.

Thanks a lot for your help.

Ming


 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.