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

length limitations on string input to xsl:analyze-stri

Subject: length limitations on string input to xsl:analyze-string
From: Heidi L Preston <hpreston@xxxxxxxxxxxxxxx>
Date: Fri, 24 Feb 2006 15:19:09 -0500
heidi preston
I am having difficulty using xsl:analyze-string with some lengthy input
(800+ chars).  Is this a known limitation of analyze-string?  I saw
recently that the regular expression itself is limited to about 30
characters, and I may be pushing the limits with this regular expression,
but it does handle inputs of under 800 chars ok.  If I simplify the regular
expression (which I can't really do without losing semantics required for
analysis),  I notice the allowable string length does increase, but it is
still not handling the inputs I need to deal with.

The error message, occurring on the for-each in the following code,  is:
"SXLM0001: Too many nested apply-templates calls. The stylesheet is
probably looping.
Transformation failed: Run-time errors were reported"
implying recursion, which isn't really the case.  My test input only has
one <type>.

The xsl:

<xsl:template match="/">
  <output>
      <xsl:for-each select="container/*">
        <xsl:apply-templates select="." mode="parse_express"/>
      </xsl:for-each>
  </output>
</xsl:template>

<xsl:template match="type" mode="parse">
  <xsl:param name="string" as="xs:string" select="normalize-space(.)" />
  <type>
      <xsl:variable name="regular_expression" select="'([a-z][a-z0-9_]*)'"
/>

   <xsl:analyze-string select="$string" flags="i"
      regex="^{$regular_expression}\s?=\s?([^;]+)\s?;\s?(.*)$">
     <xsl:matching-substring>
      <xsl:message> ANALYZED STRING SUCCESSFULLY </xsl:message>
      <!-- Deal with regex-groups  -->
      </xsl:matching-substring>
      <xsl:non-matching-substring>
        <xsl:message>
          Error: IN NON-MATCHING SUBSTRING
        </xsl:message>
      </xsl:non-matching-substring>
    </xsl:analyze-string>
  </type>
</xsl:template>

My input is in the following format:
<container>
 <type>
      managed_design_object
      =
      SELECT
      (
      adjacent_stratum_surface_definition
      ,
      adjacent_stratum_surface_embedded_component_surface_definition
      ,
      alias_identification
      ,
      alternate_select_product
      ,
    <!--  ......   limit seems to be about 814 characters.  The input I
need to handle is much greater -->
      )
      ;
      </type>
</container>

Any suggestions, short of tokenizing the string the old fashioned way?
Thanks.









***************************************************************************
Heidi Preston
Electric Boat Corporation
75 Eastern Point Road
Groton, CT 06340
(860) 433-8649

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-2011 All Rights Reserved.