Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Regex and apply xsl number

From: "Byomokesh Sahoo" <sahoo.byomokesh@--------->
To:
Date: 1/2/2009 9:12:00 AM
Hi Michael,

Thanks for quick reply.

Any other option to get this result......... using XSLT...

Thanks
Byomokesh

>Subject: RE: [xsl] Regex and apply xsl number
>From: "Michael Kay" <mike@xxxxxxxxxxxx>
>Date: Wed, 31 Dec 2008 09:28:46 -0000


>^[ will match a bracket only if it appears right at the start of the text
>node, but in your case the bracket is preceded by whitespace.

Michael Kay
http://www.saxonica.com/

>> -----Original Message-----
>> From: Byomokesh Sahoo [mailto:sahoo.byomokesh@xxxxxxxxx]
>> Sent: 31 December 2008 09:16
>> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
>> Subject: [xsl] Regex and apply xsl number
>>
>> Hi,
>>
>> I am getting problem in regex search in text node. Here my XML
>>
>> <file xmlns:QL="http://www.xmltricks.com";>
>> <QL:PARCITE/>
>> 33 C.L.A.S. 505
>> <QL:QLCITE/>
>> [1994] O.L.A.A. No. 467
>> [para1]     The grievance.
>> [para2]     The grievance.
>> [para3]     The grievance.
>> <QL:QLCITE/>
>> [1994] O.L.A.A. No. 467
>> [para5]     The grievance. <!-- Need [para4] not [para5]
>> sequence number -->
>> [para6]     The grievance. <!-- Here should be [para5] -->
>>
>> <!-- continue like this where [para is found. --> </file>
>>
>> Desired Output
>> =============
>> <file xmlns:QL="http://www.xmltricks.com";>
>> <QL:PARCITE/>
>> 33 C.L.A.S. 505
>> <QL:QLCITE/>
>> [1994] O.L.A.A. No. 467
>> [para1]     The grievance.
>> [para2]     The grievance.
>> [para3]     The grievance.
>> <QL:QLCITE/>
>> [1994] O.L.A.A. No. 467
>> [para4]     The grievance.
>> [para5]     The grievance.
>> </file>
>>
>> My XSL ==
>>
>> <xsl:variable name="myregex">((^[)(\w*)(\d*))</xsl:variable>
>>
>> <xsl:variable name="ss"><xsl:number/></xsl:variable>
>>
>> <xsl:template match="text()">
>>   <xsl:analyze-string select="." regex="$myregex">
>> <xsl:matching-substring> <xsl:value-of select="$ss"/>
>> </xsl:matching-substring>  <xsl:non-matching-substring>
>>   <xsl:value-of select="."/>
>>  </xsl:non-matching-substring>
>> </xsl:analyze-string>
>>
>> ===
>>
>> I want to transform only sequence number (like 1, 2, 3) in
>> [para] text. I am trying but not able to match and replace to
>> sequence number.
>>
>> Thanks
>> Byomokesh


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent