|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Conditional XSL Variable
Others have pointed out that value-of will produce an epty text node
from a empty element, but most likely you don't want to this at all.
> I think it has something to do with the type of the
> variable, because it is not initialised as a result-tree fragment.
> Has anyone come across this problem before? By the way, I am using
> Saxon-B 9.1.0.3.
There are no result tree fragments in xslt 2 thankfully that has gone.
<xsl:variable name="mappingsCodeA">
If you use value-of inside xsl:variable in thsi way you are not
assigning a string or attribute node to the variable but a document node
with child text node with string value the string value of the selection
which is relatively expensive to build and to use.
You were testing for count=1 but im guessing that you just mean to use
map:entry[@codeA=$valueOfCodeA] if it exists or map:otherwise otherwise
<xsl:variable name="mappingsCodeA" select="$lookupTable/map:table/
(map:entry[@codeA=$valueOfCodeA],/map:otherwise)[1]"/>
Then you can use $mappingsCodeA/@codeB as because you have used a selct
attribute $mappings references the node in your lookup table, not a
document node containing a newly constructed tree.
David
________________________________________________________________________
The Numerical Algorithms Group Ltd is a company registered in England
and Wales with company number 1249803. The registered office is:
Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United Kingdom.
This e-mail has been scanned for all viruses by Star. The service is
powered by MessageLabs.
________________________________________________________________________
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








