[Xml-compile] Writer not playing nice

Mark Overmeer mark at overmeer.net
Wed Aug 29 09:31:39 GMT 2012


* Anthony Wood (bessington at gmail.com) [120829 08:38]:
> I'm playing around trying to make XML::Compile 'eat it's own dog-food' by
> consuming a Perl structure produced by the template() method.

The documentation of template() and the produced template both very
clearly state that you cannot use it directly.  For instance, when
there is a choice, it will include descriptions for all options of
that choice, not only one.

> error: attribute `LOCTYPE' is required at {
> http://www.loc.gov/METS/}mets/dmdSec/mdRef/@LOCTYPE

>   [ { # all of mdRef, mdWrap

oops, <all> is always a bit tricky.

>       # is an unnamed complex
>       # is optional
>       mdRef =>
>       { # is a xs:ID
>         ID => "id_0",
> 
>         # is a xs:string
>         # attribute LOCTYPE is required
>         # Enum: ARK DOI HANDLE OTHER PURL URL URN
>         LOCTYPE => "ARK",
> 
> As you can see LOCTYPE is present. What is the significance of the '@' in
> @LOCTYPE ?

In XPath syntax, that '@' means "attribute".

> <!-- METS XLink Schema, v. 2, Nov. 15, 2004 -->
> <schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="
> http://www.w3.org/1999/xlink" targetNamespace="http://www.w3.org/1999/xlink"
> elementFormDefault="qualified">
> etc.....
> 
> I've added both the xmlns and xmlns:xlink field / value pairs to work
> around issues generating errors during importDefinitions() - my bad ?
> Any ideas ?

That provided schema is broken.  You are correct.  The latest version
of it can be found at  http://www.w3.org/1999/xlink.xsd
-- 
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