Hello, Vincent Lefevre, le Sat 01 Jan 2005 23:20:33 +0100, a écrit : > In a conversion from an XML file, trang considers that an attribute > that has a default value is always present. This leads to invalid > files. For instance: > > ay:~> cat test.xml > <?xml version="1.0"?> > <!DOCTYPE root [ > <!ELEMENT root (#PCDATA)> > <!ATTLIST root > type (text|number) "text" > > > ]> > <root>Test</root> > ay:~> trang test.xml test.rng > ay:~> cat test.rng > <?xml version="1.0" encoding="UTF-8"?> > <grammar ns="" xmlns="http://relaxng.org/ns/structure/1.0" > datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> > <start> > <element name="root"> > <attribute name="type"> > <data type="NCName"/> > </attribute> > <data type="NCName"/> > </element> > </start> > </grammar> > ay:~> xmllint --noout --relaxng test.rng test.xml > test.xml:8: element root: Relax-NG validity error : Element root failed to > validate attributes > test.xml fails to validate
See the upstream answer: http://code.google.com/p/jing-trang/issues/detail?id=87 “This is a bug in xmllint. I guess --relaxng tells xmllint not to do any DTD processing, which is not correct: it should at least do the minimum amount of processing required by the XML Recommendation, which includes defaulting attributes specified in the internal subset.” Do you agree? Samuel -- To UNSUBSCRIBE, email to [email protected] with a subject of "unsubscribe". Trouble? Contact [email protected]

