Subject: | error: no value for facet `simpleType' |
Date: | Tue, 19 May 2009 13:56:30 +0200 |
To: | bug-XML-Compile [...] rt.cpan.org |
From: | Erich Weigand <erich.weigand [...] nureg.de> |
Hello,
I got problems using the modul XML::Compile. The error message is
error: no value for facet `simpleType' at products#facet
the perl script is
####################
#!/usr/bin/perl
use XML::Compile;
use XML::Compile::Schema;
my $content = {
language => 'de',
_ => 'Hallo Welt',
};
my $schema = XML::Compile::Schema->new( 'test.xsd' );
my $write = $schema->compile( WRITER => 'products' );
my $doc = XML::LibXML::Document->new();
my $xml = $write->( $doc, $content );
print $xml->toString( 1 )."\n";
####################
The xsd-file is
####################
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="products">
<xs:complexType>
<xs:simpleContent>
<xs:restriction base="xs:anyType">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
</xs:restriction>
</xs:simpleType>
<xs:attribute name="language" use="required"/>
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
</xs:element>
</xs:schema>
####################
if you delete the restriction 'minLength' the perl script works just
fine. It also works if you delete the attribute language. If you need
more information you can reach me at weigand@nureg.de
Erich Weigand
/// IT/Software-Entwicklung ///
NUREG GmbH ///
Dorfäckerstraße 31 | 90427 Nürnberg | Germany
Tel. +49-911-32002-203 | Fax +49-911-32002-299
Nürnberg HRB 22653 | USt.ID DE 814 685 653
Geschäftsführer: Michael Schmidt, Stefan Boas
www.nureg.de