[Xml-compile] Possible problem with regex compilation?

Dan Lyke dlyke at corp.sonic.net
Fri Mar 29 17:45:32 GMT 2013


I'm struggling with some code that I suspect may be a problem with
XML::Compile's conversion of the conversion of a pattern to an internal
regex.

In testing yesterday, we ran into an issue where the
XML::Compile::Daemon code is rejecting the XML SOAP snippet

  <m4:AdditionalTroubleStatusInfoItem>SPECIAL CHARACTERS &amp;lt;]@#$??^&amp;amp;*() +:&amp;quot;?&amp;gt;&amp;lt;{}!</m4:AdditionalTroubleStatusInfoItem>

with a

  Catching error: string `SPECIAL CHARACTERS &lt;]@#$??^&amp;*() +:&quot;?&gt;&lt;{}!' does not match pattern `[A-Z|a-z|0-9|\s|'|\(|\)|\+|,|\-|\.|/|:|=|\?|@|;|!|”|#|$|%|*|`|\[|\]|\\|^|_|{|\||}|~|&|<|>]*' at {http://att.com/ebta/EbXmlNotification/}ATTAttributeValueChangeNotification/AttributeValueChangeNotification/EventData/AdditionalTroubleStatusInfo/AdditionalTroubleStatusInfoItem#facet

The type is eventually (after much '<restriction base="...">')
specified (as you can tell from the above error message) as:

  <simpleType name="GraphicStringType">
    <restriction base="string">
       <pattern
         value="[A-Z|a-z|0-9|\s|'|\(|\)|\+|,|\-|\.|/|:|=|\?|@|;|!|”|#|$|%|*|`|\[|\]|\\|^|_|{|\||}|~|&amp;|&lt;|&gt;]*"/>
    </restriction>
  </simpleType>

Which, for the sake of testing, I reduced to the Perl expression:

  /^[A-Za-z0-9\s'()\+,\-\.\/:=\?@;!”#\$%*`\[\]\\^_{\|}~&<>]*$/

Which doesn't seem to have a problem with the string in question (even
when I reduce the entity encoding in the input string one more level).

So it looks like this is an issue in the XML::Compile handling of the
WSDL regex somewhere, but it could also be me (and the guy at our
partner organization whose code is talking to other systems) missing
something obvious.

So, two questions:

First, does anyone see any obvious stupidity?

Second, any hints for me to dig into this and see more detail where
that error message is being tossed?

Thanks,

Dan



More information about the Xml-compile mailing list