Re: [xml] regular expressions - bug or feature?



On Mon, Apr 19, 2004 at 11:21:22AM +0200, Petr Novak wrote:
Hallo,
I have one question about regular expressions in RELAX NG schema. I have the 
follow schema:

<?xml version="1.0" encoding="utf-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0";
         datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes";>
  <start>
    <element>
      <name ns="">test</name>
      <data type="string">
        <param name="pattern">test(A{0,4})</param>
      </data>
    </element>
  </start>
</grammar>

So, it would mean that tag 'test' must contain zero or at most four caracters
'A'. Bud libxml2 interprets it as a already one incidence. I tested it with
the follow document:

<?xml version="1.0" encoding="utf-8"?>
<test xmlns="">test</test> 

Bud xmllint return me:

data_test0.xml:2: element test: Relax-NG validity error : Error validating datatype string
data_test0.xml:2: element test: Relax-NG validity error : Element test failed to validate content
data_test0.xml fails to validate

Only if I change test element content to some as a 'A', 'testA'... it works.
If there is no 0 in the regular expression, it works fine to (e.g., A{1,5}...).

Is this some feature of the regular expression in the RELAX NG or it is the
bug? I tested it by xmllint from libxml2 2.6.8

  Looks like a bug, can you bugzilla it please ?

   thanks,

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/



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