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

Up Conversion - Best Practice

Subject: Up Conversion - Best Practice
From: "Kevin Bird" <kevin.bird@xxxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 8 May 2008 17:38:39 +0100
 Up Conversion - Best Practice
Hello

I am looking to up convert a text file to XML.

Having looked at the text file, I need ten different regular expressions to
capture the data I require. So, my question is, do I need 10 nested
analyzes-string instructions to capture my data. Something like:

<xsl:analyze-string select="regex1">
                <xsl:matching-substring>
                                Process regex1
                </
                <xsl:non-matching-substring>
                                <xsl:analyze-string select="regex2">
                                             <xsl:matching-substring>
                                                       Process regex2
                                              </
                                              <xsl:non-matching-substring>
                                                       <xsl:analyze-string
select="regex3">

                                Etc., etc.

... because this feels clunky and will be difficult to maintain.

I thought about defining the regex's as variables and calling a function, but
my XSLT skills are not that good.

Does anyone have a suggestion that would be easier to understand and
maintain?

--
Kevin

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.