• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

XSLT double quotes problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author and deputy
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3150
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Do you pee on your compost? Does this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic