Re: [xml] A rare bug?

On Thu, Jan 03, 2008 at 03:34:07PM -0800, David Zhuo wrote:

   hi All,
   I have a schema and a XML file and used xmllint to verify that the XML
   is  in  fact confirm to the schema. The rare problem I am running into
   is that different version of xmllint will have very different behavior
   and I am not certain which version is at fault. Here is an example:
   $ /usr/bin/xmllint --version
   /usr/bin/xmllint: using libxml version 20620
       compiled  with: DTDValid FTP HTTP HTML C14N Catalog XPath XPointer
   XInclude Iconv Unicode Regexps Automata Schemas Modules
   $ /usr/bin/xmllint --noout --schema
   [1] /tmp/test.xml
   /tmp/test.xml validates
   a new version 20623, however, fails:
   $ /usr/bin/xmllint --version
   /usr/bin/xmllint: using libxml version 20623
       compiled  with:  Threads  Tree  Output Push Reader Patterns Writer
   SAXv1  FTP  HTTP  DTDValid  HTML  Legacy  C14N  Catalog XPath XPointer
   XInclude   Iconv   ISO8859X  Unicode  Regexps  Automata  Expr  Schemas
   Schematron Modules Debug
   $ /usr/bin/xmllint --noout --schema
   [2] /tmp/test.xml
   /tmp/test.xml:18:  element  keywords: Schemas validity error : Element
   '{  [3]}keywords':  [facet  'pattern'] The
   value   'London,Sci   Fi,Aliens'   is  not  accepted  by  the  pattern
   /tmp/test.xml:18:  element  keywords: Schemas validity error : Element
   '{  [4]}keywords':  'London,Sci Fi,Aliens'
   is not a valid value of the local atomic type.
   /tmp/test.xml fails to validate
   the  test  is  performed  with  the  same  XML and schema and the only
   different  is  the  version  of  xmllint  used.  Build  version  20620
   successfully validate the XML while version 20623 does not.
   the  sample  XML  is attached. can someone tell me if this is a bug or

  There have been some rather nasty bugs introduced, and then fixed in libxml2
regexp engine over the last 2 years. I really suggest you try with very recent
versions for XSD validation like 2.6.30

In your example it seems the regexp should match as your string includes at
least 2 commas, and indeed the latest version validates it:

laptop:~/XML -> ./testRegexp '(.*,){2,}.*' 'London,Sci   Fi,Aliens'
Testing (.*,){2,}.*:
London,Sci   Fi,Aliens: Ok
laptop:~/XML -> 


Red Hat Virtualization group
Daniel Veillard      | virtualization library
veillard redhat com  | libxml GNOME XML XSLT toolkit | Rpmfind RPM search engine

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]