Subject: Re: [xsl] Using xsl:analyze-string and regex to parse long lines with white-space From: Abel Braaksma <abel.online@xxxxxxxxx> Date: Tue, 19 Jun 2007 20:48:15 +0200 |
Hi All,
I am trying to parse the contents of <pfstring> to get the 5th column ("TA_D03A" in the example), the 10th ("regular internet") and the 11th ("hosted") for each line and push it to "output.xml" thus:
<snip />
Each entry in input.xml/pfarr/pfstring is on a new line. I am trying to use the regex functions and have the following, but it does not seem to be working:
<xsl:analyze-string select="$elValue" regex="\s*(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+(.*)\s+\n">
<xsl:for-each select="tokenize($elValue, '\n')"> <xsl:for-each select="tokenize($elValue, '\s+')"> do your stuff </xsl:for-each> </xsl:for-each>
<xsl:for-each select="tokenize($elValue, '\n')"> <xsl:variable select="tokenize($elValue, '\s+')" name="values" /> do your stuff with $values </xsl:for-each>
HTH, Cheers, -- Abel
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Using xsl:analyze-string and , Rob Newman | Thread | [xsl] When/How to use templates, an, Ian Jolly |
[xsl] Using xsl:analyze-string and , Rob Newman | Date | Re: [xsl] XSLT Encryptt Image URL, Abel Braaksma |
Month |