Subject: Re: [xsl] String extraction From: Mukul Gandhi <mukul_gandhi@xxxxxxxxx> Date: Wed, 29 Sep 2004 09:35:00 -0700 (PDT) |
Hi Sven, Please try this XSL - <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" indent="yes"/> <xsl:template match="/top"> <xsl:variable name="str1" select="substring-before(., '(')"/> <xsl:variable name="str2" select="substring-before(substring-after(., '('), ',')"/> <xsl:variable name="str3" select="substring-before(substring-after(substring-after(., '('), ','), ',')"/> <xsl:variable name="str4" select="substring-before(substring-after(substring-after(substring-after(., '('), ','), ','), ')')"/> <html> <head> <title/> </head> <body> <table> <tr> <td><xsl:value-of select="$str1" /></td> <td><xsl:value-of select="$str2" /></td> </tr> <tr> <td/> <td><xsl:value-of select="$str3" /></td> </tr> <tr> <td/> <td><xsl:value-of select="$str4" /></td> </tr> </table> </body> </html> </xsl:template> </xsl:stylesheet> When the above XSL is applied to XML - <?xml version="1.0" encoding="UTF-8"?> <top>person(p1,p2,p3)</top> it produces the desired output. Regards, Mukul --- Sven Waibel <sven.waibel@xxxxxxxx> wrote: > Hello, > > how can i extract a string from a string: > > person(p1,p2,p3) > > I need a table: > > person p1 > p2 > p3 > > I don't know anything about length of p1,p2 or p3. > > Is is possible? > > Regards > Sven _______________________________ Do you Yahoo!? Declare Yourself - Register online to vote today! http://vote.yahoo.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] String extraction, Sven Waibel | Thread | Re: [xsl] String extraction, Sven Waibel |
RE: [xsl] limit number of row retur, Michael Kay | Date | [xsl] Re-Organize and Sort Source T, ethan.kalfus |
Month |