[Xml-compile] error: element not processed
Craig Marchant
cmarchant at staff.ventraip.com
Mon Mar 20 14:28:54 GMT 2017
Hi,
Having an issue with trying to process xml.
Test code is:
#!/usr/bin/perl
use strict;
use warnings;
use XML::Compile::Cache;
use XML::Compile::Util qw(pack_type);
use Data::Dumper;
use Log::Report mode => 'DEBUG';
my $schemas = XML::Compile::Cache->new( [glob "testxsd/*.xsd"],
'allow_undeclared' => 1 );
$schemas->declare( READER => pack_type( 'urn:ietf:params:xml:ns:epp-1.0',
'epp' ) );
$schemas->compileAll;
my $doc = XML::LibXML->new->parse_string(<<"END_XML");
<?xml version="1.0" encoding="utf-8"?>
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
<response>
<result code="1000">
<msg>Command completed successfully</msg>
</result>
<resData>
<domain:chkData xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
<domain:cd>
<domain:name avail="1">1980s.game</domain:name>
</domain:cd>
</domain:chkData>
</resData>
<extension>
<fee:chkData xmlns:fee="urn:ietf:params:xml:ns:fee-0.7">
<fee:cd>
<fee:name>1980s.game</fee:name>
<fee:currency>USD</fee:currency>
<fee:command>create</fee:command>
<fee:period unit="y">2</fee:period>
<fee:class>standard</fee:class>
<fee:fee grace-period="P0D" description="Domain registration (per
year)" refundable="1">600.00</fee:fee>
</fee:cd>
</fee:chkData>
</extension>
<trID>
<clTRID>4d19dd959727a0f3e1225df2ee9a55e4</clTRID>
<svTRID>eaefc4f9dd5e9c43288308348a21c30b</svTRID>
</trID>
</response>
</epp>
END_XML
my $struct =
$schemas->reader(pack_type('urn:ietf:params:xml:ns:epp-1.0','epp'))->(
$doc->documentElement );
print Dumper($struct);
Running the script presents the following output:
trace: cache parsed file
/root/craig/EPP/testxsd/domain-1.0.xsd-1490007452-14154
trace: parsing XML from file testxsd/domain-1.0.xsd
trace: register prefix domain for 'urn:ietf:params:xml:ns:domain-1.0'
trace: register prefix host for 'urn:ietf:params:xml:ns:host-1.0'
trace: register prefix epp for 'urn:ietf:params:xml:ns:epp-1.0'
trace: register prefix eppcom for 'urn:ietf:params:xml:ns:eppcom-1.0'
trace: cache parsed file
/root/craig/EPP/testxsd/epp-1.0.xsd-1490007452-12773
trace: parsing XML from file testxsd/epp-1.0.xsd
trace: cache parsed file
/root/craig/EPP/testxsd/eppcom-1.0.xsd-1490007452-2531
trace: parsing XML from file testxsd/eppcom-1.0.xsd
trace: cache parsed file /root/craig/EPP/testxsd/fee-0.7.xsd-1490007452-8524
trace: parsing XML from file testxsd/fee-0.7.xsd
trace: register prefix fee for 'urn:ietf:params:xml:ns:fee-0.7'
trace: declare {urn:ietf:params:xml:ns:epp-1.0}epp READER
trace: schema compile READER for {urn:ietf:params:xml:ns:epp-1.0}epp
trace: using preparsed XML node <{urn:ietf:params:xml:ns:epp-1.0}epp>
trace: schema compile READER for {urn:ietf:params:xml:ns:domain-1.0}chkData
trace: auto-convert known type for 'any':
{urn:ietf:params:xml:ns:domain-1.0}chkData
trace: using preparsed XML node <{urn:ietf:params:xml:ns:domain-1.0}chkData>
trace: schema compile READER for {urn:ietf:params:xml:ns:fee-0.7}chkData
trace: auto-convert known type for 'any':
{urn:ietf:params:xml:ns:fee-0.7}chkData
trace: using preparsed XML node <{urn:ietf:params:xml:ns:fee-0.7}chkData>
error: element `{urn:ietf:params:xml:ns:fee-0.7}fee' not processed for
fee:chkData/cd at /*/*/*[3]/fee:chkData/fee:cd/fee:fee
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 585
Log::Report::error("Log::Report::Message=HASH(0x3291f38)") at
/usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 585
XML::Compile::Translate::Reader::_not_processed("XML::LibXML::Element=SCALAR(0x334ff08)",
"fee:chkData/cd") at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm
line 634
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x33652b8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 502
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x33652b8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 476
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x33652b8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 456
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32bc268)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 134
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32bc268)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 632
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32bc268)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 502
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32bc268)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 93
XML::Compile::Translate::Reader::__ANON__("XML::LibXML::Element=SCALAR(0x3346390)")
at /usr/local/share/perl5/XML/Compile/Cache.pm line 596
XML::Compile::Cache::_convertAnyTyped("XML::Compile::Cache=HASH(0x308fdc0)",
"{urn:ietf:params:xml:ns:fee-0.7}chkData", "ARRAY(0x3360ab0)",
"epp:epp/response/extension#any",
"XML::Compile::Translate::Reader=HASH(0x30f63b8)") at
/usr/local/share/perl5/XML/Compile/Cache.pm line 96
XML::Compile::Cache::__ANON__("{urn:ietf:params:xml:ns:fee-0.7}chkData",
"ARRAY(0x3360ab0)", "epp:epp/response/extension#any",
"XML::Compile::Translate::Reader=HASH(0x30f63b8)") at
/usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 1049
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x30f6448)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 133
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x30f6448)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 632
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x30f6448)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 502
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x30f6448)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 418
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32436e8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 145
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32436e8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 632
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32436e8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 502
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32436e8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 476
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x32436e8)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 412
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x2169f40)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 188
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x2169f40)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 632
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x2169f40)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 502
XML::Compile::Translate::Reader::__ANON__("XML::Compile::Iterator=HASH(0x2169f40)")
at /usr/local/share/perl5/XML/Compile/Translate/Reader.pm line 93
XML::Compile::Translate::Reader::__ANON__("XML::LibXML::Element=SCALAR(0x30f38d0)")
at testnew.pl line 49
The fee Schema is attached, if anybody could tell me what I'm doing wrong
that would be amazing.
Cheers.
Craig Marchant
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20170321/7b19ee03/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fee-0.7.xsd
Type: application/octet-stream
Size: 8524 bytes
Desc: not available
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20170321/7b19ee03/attachment-0001.obj>
More information about the Xml-compile
mailing list