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

RE: RE: xsl data type problem? two values appear to be

Subject: RE: RE: xsl data type problem? two values appear to be equal but ...
From: cknell@xxxxxxxxxx
Date: Tue, 13 Dec 2005 11:17:17 -0500
xsl data type
Thanks, the light bulb has just come on.
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Michael Kay <mike@xxxxxxxxxxxx>
Sent:     Tue, 13 Dec 2005 16:12:15 -0000
To:       <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Subject:  RE:  xsl data type problem? two values appear to be equal but ...

This has nothing to do with data types: it's a context problem. The meaning
of a relative path expression like "@id" depends on the context node. In
your match pattern, @id is an attribute of a data-store element; in the
select expression, it is an attribute of a data-sink element.

Michael Kay
http://www.saxonica.com/
 

> -----Original Message-----
> From: cknell@xxxxxxxxxx [mailto:cknell@xxxxxxxxxx] 
> Sent: 13 December 2005 15:59
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  xsl data type problem? two values appear to be 
> equal but ...
> 
> Here is the opening part of the problem template:
> --------------    
> <xsl:template match="data-store[@id=$node-id]">    
>     <node type="{local-name(.)}" id="{@id}" name="{name}">
> --------------
> This selects the node I expect. So far, so good.
> Now, further along in the template I pass a parameter to a 
> called template:
> 
> <xsl:with-param name="ds-predecessor" 
> select="/fssc/component-list/processes/process[data-sinks/data
> -sink[.=$node-id]]" />
> 
> This works, too, but if I define the parameter in this way, 
> no nodes are passed:
> 
> <xsl:with-param name="ds-predecessor" 
> select="/fssc/component-list/processes/process[data-sinks/data
> -sink[.=@id]]" />
> 
> The 'match' treats these two values as the same, but the 
> 'select' seems to treat them differently.I have output both 
> values using 'xsl:value-of' and they seem the same.  
> 
> I also used the compare() function on the two and got a 
> return value of '0'.My hypothesis is that they must be of 
> different data types and that's why the called template 
> behaves differently when called with one or the other. 
> 
> I have been searching the index of XPath 2.0 Programmer's 
> Reference looking for a function that will return the data 
> type of a node or variable passed to it, but I must have the 
> wrong idea of what I'm looking for, because I can't find one.
> 
> Will someone kindly tell me why these two are the same and 
> different? Thanks.
> 
> -- 
> Charles Knell
> cknell@xxxxxxxxxx - email

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.