|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Converting XML data
Please try this XSL -
<?xml version="1.0"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/root">
<xsl:call-template name="FormatString">
<xsl:with-param name="str" select="s" />
</xsl:call-template>
<xsl:text>|</xsl:text>
</xsl:template>
<xsl:template name="FormatString">
<xsl:param name="str" />
<xsl:if test="string-length($str) > 0">
<xsl:text>|</xsl:text><xsl:value-of
select="substring($str,1,1)" />
<xsl:call-template name="FormatString">
<xsl:with-param name="str"
select="substring($str,2,string-length($str))" />
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
For e.g., when it is applied to XML -
<?xml version="1.0"?>
<root>
<s>HELLO</s>
</root>
it produces output -
|H|E|L|L|O|
Regards,
Mukul
--- Narasingarao Kommireddi
<Narasingarao.Kommireddi@xxxxxxxxxxxxxxxx> wrote:
>
> I need to format data from the XML in my XSL using
> functions.
>
> example : Input data from XML is HELLO , i want
> the output as | H | E
> | L | L | O |
>
> How do i go abt it..
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail
|
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








