[Xml-compile] Schema Template wants a target Namespace

DEIGNAN Ciaran C.DEIGNAN at rsd.com
Wed Jun 11 10:19:07 GMT 2014


Hi Mark and list,

I upgraded to XML ::Compile 1.44.
I thought I had a testcase working where I could parse a schema and then use "template()" to see a framework hash structure.

my $schema = XML::Compile::Schema->new($schema_xml);
print $schema->template('XML', 'node'); exit;

Now I can't get it to work. It always says

error: application requires that element `node' has a targetNamespace

My schema doesn't specify a namespace explicitly. I've tried setting an empty namespace like "{}node" or "#node".
I've tried specifying http://www.w3.org/2001/XMLSchema as the namespace.
I've tried various options in my call to new().

Oddly, if I continue my script, I can execute "compile() and pass it in (incorrect) hash structure without getting the namespace error.

my $write   = $schema->compile(WRITER => 'node');
my $xml    = $write->($doc, $record_data);

So possibly it's a bug?

Ciaran Deignan
RSD Open Systems Support
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/xml-compile/attachments/20140611/0a8fa7be/attachment.htm>


More information about the Xml-compile mailing list