[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: String extraction

Subject: Re: String extraction
From: Sven Waibel <sven.waibel@xxxxxxxx>
Date: Thu, 30 Sep 2004 09:07:52 +0200
xsl string
Hi Mukul,

that's a very good example, but i don't know how many p exist. So i don't know how many variables i have to create.

Sven

Mukul Gandhi wrote:

> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.