an extract of the xsd file:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.derivatexxl.de/derivatexxl/v1.1"
targetNamespace="http://www.derivatexxl.de/derivatexxl/v1.1"
elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:include schemaLocation="derivatexxlTypes.xsd"/>
<!-- Root -->
<xs:element name="DERIVATEXXL">
<xs:complexType>
<xs:sequence>
<xs:element ref="DELIVERY"/>
<xs:element ref="GENERAL_INFORMATION" minOccurs="0"/>
<xs:element ref="SENDER"/>
<xs:element ref="ISSUER"/>
<xs:element ref="PRODUCT" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
My code:
use warnings;
use strict;
use XML::Compile::Cache;
use XML::Compile::Util qw/pack_type/;
my $xsds = ['derivatexxlTypes.xsd', 'derivatexxl_110.xsd'];
my $schema = XML::Compile::Cache->new($xsds);
# This works, it prints all the available definitions
$schema->printIndex();
my $type = pack_type 'http://www.derivatexxl.de/derivatexxl/v1.1', 'DERIVATEXXL';
warn $schema->template('PERL' => $type);
I get this error message back: "regexp error : failed to compile: Expecting a char range"
If I change the last line to: warn $schema->template('PERL' => 'DERIVATEXXL');
I get the error: "error: cannot find element or attribute `DERIVATEXXL'"
To tell you the truth, I'm not sure if I just don't get it, or if XML::Compile can't work with these xsd files...
I'd be very grateful for any help.
Thank you.