After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 136678 - wrong validating schema (xsd)
wrong validating schema (xsd)
Status: VERIFIED FIXED
Product: libxml2
Classification: Platform
Component: general
2.6.7
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2004-03-09 19:48 UTC by kaliber
Modified: 2009-08-15 18:40 UTC
See Also:
GNOME target: ---
GNOME version: 2.5/2.6



Description kaliber 2004-03-09 19:48:05 UTC
Attribute use="required" doesn't work.

Demonstration:

bug.xsd
-------

<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="bug">
	<xsd:complexType>
		<xsd:sequence>
			<xsd:element ref="item" minOccurs="1" maxOccurs="unbounded">
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
</xsd:element>	

<xsd:element name="item">
	<xsd:complexType>
		<xsd:attribute name="id" type="xsd:integer" use="required" />
	</xsd:complexType>
</xsd:element>
	
</xsd:schema>

bug.xml
-------
<?xml version="1.0"?>
<bug>
	<item id="1" />
	<item />
</bug>

test
----
xmllint --schema bug.xsd bug.xml
Comment 1 Daniel Veillard 2004-04-16 16:51:23 UTC
  
Kasimier Buchcik provided a fix for this, which I just commited to CVS:

paphio:~/XML -> xmllint --noout --schema bug.xsd bug.xml
bug.xml:4: element item: Schemas validity error : required attribute id on item
is missing
bug.xml:4: element item: Schemas validity error : required attribute id on item
is missing
bug.xml:4: element item: Schemas validity error : required attribute id on item
is missing
bug.xml fails to validate
paphio:~/XML ->

I don't know why the error is reported 3 times, but except for
that small trouble this seems fine :-)

Daniel
Comment 2 Daniel Veillard 2004-04-19 00:00:55 UTC
  This should be closed by release 2.6.9,
                                                                                
   thanks,
                                                                                
Daniel