[Xml-compile] XML Compile write with xsd to validate
Mark Overmeer
mark at overmeer.net
Mon Jun 17 11:48:44 GMT 2013
Hi Jose,
* JOSE RAMON GONZALEZ MARTINEZ (joseramon.gonzalez at ext.mpsa.com) [130617 11:22]:
> <?xml version="1.0" encoding=" UTF-8"?>
> < application xmlns=' http://www.example.org/esquemas/application'
> xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
> xsi:noNamespaceSchemaLocation="variables.xsd">
This is wrong: there is a big difference between "no namespace"
and "default namespace".
> < prdocc>XXXXX</x0:prdocc>
You probably mean
<prdocc>XXXXX</prdocc>
It theory, it is possible to mix elements which have no (target)namespace
with elements which use the default prefix for their namespace. So, that
is forbidden by a writte rule. XML::Compile is automated, and can not
predict beforehand whether it will encounter elements without namespace.
Therefore, by default, it will not use a default namespace However,
with the compile(use_default_namespace) option
You can also set the prefixes globally when you use ::Cache, not ::Schema.
I do not 100% understand your question. Do you want to use the output
of $schema->template(XML => ) to interpolate your values into? That is
an extremely bad idea, not supported and not kept backwards-compatible.
I hope I did not understand that correctly.
--
Regards,
MarkOv
------------------------------------------------------------------------
Mark Overmeer MSc MARKOV Solutions
Mark at Overmeer.net solutions at overmeer.net
http://Mark.Overmeer.net http://solutions.overmeer.net
More information about the Xml-compile
mailing list