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

Re: xalan:nodeset or xsl:copy-of problem

Subject: Re: xalan:nodeset or xsl:copy-of problem
From: Ming <myu@xxxxxxxx>
Date: Wed, 24 Apr 2002 11:01:58 -0600
xsl copy of select
Thanks, Greg. The problem is solved. It's because the variable $dbs_searched
is extracted from the url and the string in the url is  mim00. So, the
$dbs_searched contains value of "mim00". But in my xml file, it's
<title db="Mim"> title of the article</title>.

So, the function contains($dbs_searched, @db) returned false.

But one thing that confused me is that, since the function contains returned
false, nothing should be copied to the $nodetree. But when I use the
<xsl:copy-of select="xalan:nodeset($nodetree)" /> to test the value of
$nodetree, it seems that the nodes do get copied but miss the db="Mim" part.

Do you have some ideas what could be the reason?

Thanks a lot.

Ming


Greg Faron wrote:

> At 04:24 PM 4/23/2002, you wrote:
> >  <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" />
>
>    Okay, I'm re-reading your post here and the above isn't clear.  Assuming
> that $full_path is a valid node-set, then the above selection chooses all
> top-level elements of $full_path that themselves have a "db" attribute.  It
> says nothing of any child elements named $field.  I think your bug is in
> your selection paths, not the node-set or copy-of functions.
>    Instead of testing with the value-of template (which concatenates all of
> the child nodes as well as the top-level node), use copy-of to debug your
> stylesheet.  I think you'll find that your variable values aren't what you
> expect.
>
> Greg Faron
> Integre Technical Publishing Co.
>
>  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.