Re: [xsl] [string to node]

Subject: Re: [xsl] [string to node]
From: Mukul Gandhi <gandhi.mukul@xxxxxxxxx>
Date: Sat, 20 Feb 2010 12:50:38 +0530
you can construct, a node with suitable XSLT constructors. for e.g, as

to construct an element node:

<xsl:element name="x">
   <xsl:value-of select="normalize-space($test-phone)"/>

or, to construct an attribute:

<xsl:attribute name="a">
   <xsl:value-of select="normalize-space($test-phone)"/>

On Sat, Feb 20, 2010 at 12:16 PM, Aditya Sakhuja
<aditya.sakhuja@xxxxxxxxx> wrote:
> Hello,
> I am looking to convert a string to a single node type. Using Xalan C
> 1.10 processor.
> for eg:
> <xsl:variable name="test-phone">
> <xsl:choose>
> B <xsl:when test="($tempPhone) and ($tempPhone!= 'Visit Web Site') and
> ($tempPhone!= 'All') and ($tempPhone!= 'A') and ($tempPhone!= 'B')">
> B <xsl:value-of select="normalize-space($tempPhone)"/>
> B </xsl:when>
> B <xsl:otherwise>
> B  <xsl:value-of select="//ads"/>
> B </xsl:otherwise>
> </xsl:choose>
> </xsl:variable>
> What I have in test-phone is a string. on which I cannot use
> What is the best way to have the count() ? I am trying to get a node
> from the string, that would work.
> Thanks in advance,
> Aditya Sakhuja

Mukul Gandhi

Current Thread