Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XSLT double quotes problem

 
Raj Kad
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Anybody here to solve XSLT problem?
The problem is as follows

<xsl:variable name="quotes">"</xsl:variable>
OR
<xsl:variable name="quotes" select=""" />

<xsl:variable name="fullCommand" select="concat($quotes,$telephoneNumber, $quotes)" />

I want a result "123456" i.e. telephoneNumber in quotes after concat,but it's not giving.It gives "telephoneNumber"
I am using Texedo for the transformation.
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this, if its suits your case
<xsl:variable name="telephoneNumber" select="'123456'" />
<xsl:value-of select="concat('& #34;',$telephoneNumber,'& #34;')" />

Note: there is no space between & #34;, & #34; is unicode value of "(quot)
 
Raj Kad
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot for reply but it's still not working

I tried with "(semicolon here).
also with '"'

but still not working.

code is like this

<xsl:variable name="quotes">"</xsl:variable>

<xsl:template match="CreateDNCode">
<xsl:variable name="fullCommand" select="concat($quotes, $telephoneNumber, $quotes, $colon)" />
<xsl:element name="Command" >
<xsl:value-of select="$fullCommand"/>
</xsl:element>
 
Raj Kad
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry it's posted wrong way with "

Thanks a lot for reply but it's still not working

I tried with & quot ;

also with '& #34;'

but still not working.

code is like this

<xsl:variable name="quotes">& #34;</xsl:variable>

<xsl:template match="CreateDNCode">
<xsl:variable name="fullCommand" select="concat($quotes, $telephoneNumber, $quotes, $colon)" />
<xsl:element name="Command" >
<xsl:value-of select="$fullCommand"/>
</xsl:element>
 
Balaji Loganathan
author and deputy
Bartender
Posts: 3150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Raj Kad:
Sorry it's posted wrong way with "
<xsl:variable name="quotes">& #34;</xsl:variable>

<xsl:template match="CreateDNCode">
<xsl:variable name="fullCommand" select="concat($quotes, $telephoneNumber, $quotes, $colon)" />
<xsl:element name="Command" >
<xsl:value-of select="$fullCommand"/>
</xsl:element>


What is your expected output and what it is printing with the above code ??
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

<xsl:variable name="quotes">"</xsl:variable>
OR
<xsl:variable name="quotes" select=""" />

<xsl:variable name="fullCommand" select="concat($quotes,$telephoneNumber, $quotes)" />

I want a result "123456" i.e. telephoneNumber in quotes after concat,but it's not giving.It gives "telephoneNumber"
I am using Texedo for the transformation.


Hopefully I am not missing anything, but you seem to be overly complicating thing unnecessarily....

Let us know if this works,



If that doesn't work, try -


Please do let us know what you find.............
Thanks.
[ October 06, 2004: Message edited by: Madhav Lakkapragada ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic