Hello,
thanks for your hints, I will test it - few parts of xsd with float looks
like that, how to change the xsd to have the element name in error? It is
quite hard to find missing value in large xml.

<xsd:schema attributeFormDefault="unqualified"
elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

  <xsd:simpleType name="nonNegativeFloat">
    <xsd:restriction base="xsd:float">
      <xsd:minInclusive value="0"/>
    </xsd:restriction>
  </xsd:simpleType>

  <xsd:complexType name="WeightType">
    <xsd:simpleContent>
      <xsd:extension base="nonNegativeFloat">
        <xsd:attribute name="Unit" type="WeightUnitType" use="required"/>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

  <xsd:simpleType name="VatTypeType">
    <xsd:restriction base="xsd:float"/>
  </xsd:simpleType>


Thanks a lot.
Radek


2013/11/19 Mark Overmeer <[email protected]>

> * Radek Šťastný ([email protected]) [131119 11:43]:
>
> Taken from subject:
>        error: illegal value `' for type {
> http://www.w3.org/2001/XMLSchema}float
>
> The full error message contains a path (some kind of location indication)
> if
> there is more to say about it.  It seems the element you read only has a
> type,
> not a name.  It happens.
>
> Apparently, the message expects a float but find a blank field, hence
> validation fails.
>
> > code looks like this (simplified)
> >
> >     my $xsd = 'file.xsd';
> >     my $schema = XML::Compile::Schema->new();
> >     $schema->addSchemaDirs('somedir');
> >       $schema->importDefinitions("$xsd-file");
>
> You do not always need the addSchemaDirs().  Probably this is enough in
> your case:
>         my $schema = XML::Compile::Schema->new("$somedir/$xsd");
>
> Better start with ::Cache
>         my $schema = XML::Compile::Cache->new("$somedir/$xsd"
>           , prefixes => [...]
>           );
>
> >       my $xml = "$path/$file";
> >       my $reader = $schema->compile (
> >          READER => 'rootelement',
> >          elements_qualified => 'NONE');
>
> do you really need to overrule the elementFormDefault of the schema?
>
> >     my $data=$reader->("$xml");
>
> or directly $reader->("$path/$file");
>
> > thanks for help, documentation is complex and above my understandig a
> > little.
>
> XML Schema's are quite large, with too many (mis)features.  But you
> probably do not need much.
> --
> Regards,
>
>                MarkOv
>
> ------------------------------------------------------------------------
>        Mark Overmeer MSc                                MARKOV Solutions
>        [email protected]                          [email protected]
> http://Mark.Overmeer.net                   http://solutions.overmeer.net
>
>
_______________________________________________
Xml-compile mailing list
[email protected]
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile

Reply via email to