Altova Mailing List Archives
>xsl-list Archive Home
>Recent entries
>Thread Prev -
>Thread Next - Re: [xsl] Sequence of chars not working with analyze-string
[xsl] Sequence of chars not working with analyze-string
To:
Date: 5/7/2006 9:08:00 AM
I am trying to parse a text doc using analyze-string. But when I want to
retrieve the 30th to 60th chars it ignores the first arg and retrieves the
second. For example (.{{30,60}}) returns 60 chars.
Here is the source: "Daily Appointments.txt"
Consignee: FARR WEST - DELI
Start Time Stop Time Load ID Order # Carrier Cases
Weight Pallets Cube Vendor Name Load Type
04/01/06 06:00 04/01/06 07:30 300559 PFS*
Door:311D Con:0104 StrrmLnCPU HOT
9856065 1,800
36,000 56 1,821PROFESSIONAL FOOD SYSTEMS ( ( (
Load Totals 1,800
36,000 56 1,821
04/01/06 06:00 04/01/06 07:30 300382 DON STOCKLEY
TRUCKING Door:317D Con:0104 StrrmLnCPU HOT
9865900 206
2,650 11 253KINGS HAWAIIAN BAKERY ( ( (
9872940 5
3,780 5 270AMERICAN PIE ( ( (
9877320 290
1,813 2 86SAPUTO CHEESE USA INC ( ( (
9880590 450
6,831 6 298AMERICAN PIE ( ( (
( ( (
9880600 418
4,828 10 347CLAIM JUMPER RETAIL FOODS
9886650 282
3,036 4 145SPECIALTY BRANDS ( ( (
Load Totals 1,651
22,938 38 1,399
04/01/06 06:00 04/01/06 07:30 300166 AFS
Door:319D Con:0104 StrrmLnCPU HOT
9873530 630
4,095 6 180LAYTON DAIRY ( ~ (
( ~ (
9880740 1,008
6,300 10 297LAYTON DAIRY
Using the following
...
<xsl:for-each select="tokenize(unparsed-text('Daily
Appointments.txt'),'\r\n')">
<xsl:analyze-string select="." regex="(\d{{7}})\s+([0-9,]+)(.{{30,60}})">
<xsl:matching-substring>
<load>
<po><xsl:value-of select="regex-group(1)"/></po>
<cases><xsl:value-of select="replace(regex-group(2),',','')"/></cases>
<vendor><xsl:value-of select="regex-group(3)"/></vendor>
</load>
</xsl:matching-substring>
</xsl:analyze-string>
</xsl:for-each>
...
I am trying to retrieve the PO, cases, and vendor name.
Thanks for the helpDisclaimer
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.

