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

Re: Why is 'analyze-string' producing this weird outpu

Subject: Re: Why is 'analyze-string' producing this weird output?
From: "Graydon graydon@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 23 Aug 2023 13:50:27 -0000
Re:  Why is 'analyze-string' producing this weird outpu
On Wed, Aug 23, 2023 at 01:40:17PM -0000, Roger L Costello costello@xxxxxxxxx scripsit:
> I created several ENTITIES for use by my XSLT:
> <!ENTITY section-num "[0-9]+(\.[0-9]+)+">
> <!ENTITY section-name "[A-Z][a-zA-Z /]+">
> <!ENTITY paren "\([^\)]+\)">
> I use 'analyze-string' to break apart the input:
> That produces this erroneous output:
> <header>
>     <section-num>5.2</section-num>
>     <section-name>.2</section-name>
>     <abbreviated-name>Record Type</abbreviated-name>
> </header>
> I am baffled why I am getting that output. 
> What am I doing wrong, please?

Your regular expression has more than three capturing groups and
capturing groups inside other capturing groups are NOT ignored.  So
you're using incorrect references to groups.

It might be much simpler to tokenize your input on white space and test
the first two results for "is this a section num?" and "is this a
section name?" before putting everything after the first two back

-- Graydon

Graydon Saunders  | graydonish@xxxxxxxxxxxx
^fs oferiode, pisses swa mfg.
-- Deor  ("That passed, so may this.")

Current Thread


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.
First Name
Last Name
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.