File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XSLT double quotes problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT double quotes problem" Watch "XSLT double quotes problem" New topic
Author

XSLT double quotes problem

Raj Kad
Greenhorn

Joined: Oct 03, 2004
Posts: 3
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

Joined: Jul 13, 2001
Posts: 3150
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)


Spritle Software Blogs
Raj Kad
Greenhorn

Joined: Oct 03, 2004
Posts: 3
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

Joined: Oct 03, 2004
Posts: 3
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

Joined: Jul 13, 2001
Posts: 3150
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

Joined: Jun 03, 2000
Posts: 5040

<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 ]

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT double quotes problem