[Xml-compile] ANY => [ "Anything", ], - really ?
Mark Overmeer
mark at overmeer.net
Fri Sep 7 09:11:53 GMT 2012
* Anthony Wood (bessington at gmail.com) [120907 08:57]:
> I have this snippet in my template :
> ANY => [ "Anything", ], },
>
> originally trying to load this with e.g.
> { '{mods}mods' => [ 'xmlns' => 'http://www.loc.gov/mods/v3',
>
> I get the error :
> error: elements for 'any' are XML::LibXML nodes, not HASH(0x20a87da8) at {
> http://www.loc.gov/METS/}mets/dmdSec/mdWrap/xmlData#any
Yes, with "any" you need to construct these trees by hand, calling writer
more than once. People should use substitutionGroups
> So i try e.g.
> {
> '{mods}mods' => bless
> [
> # XML as an interpolated string
> "<mods:mods xmlns=\"http://www.loc.gov/mods/v3\">
> ... etc ...
> ",
> ],
> 'XML::LibXML::NodeList',
> },
>
> Can't call method "string_value" without a package or object reference at
> /usr/lib/perl5/vendor_perl/5.14/i686-cygwin-threads-64int/XML/LibXML/NodeList.pm
> line 108.
You should create an ::Element, not a ::NodeList.
Usually, you create that element with another writer (use the same $doc
object)
--
Success,
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