[xml-compile] namespace prefixes

Mark Overmeer mark at overmeer.net
Thu Sep 30 16:25:52 GMT 2010


* Wes Young (wes at ren-isac.net) [100930 16:08]:
> why does everything come up as "x0:"
> $ perl test.pl
> <x0:IODEF-Document xmlns:x0="urn:ietf:params:xml:ns:iodef-1.0"

The default for XML::Compile is not to use the default empty prefix
(option use_default_namespace)  When no namespace can be deducted
for the namespace from the schema, it will start generating them,
starting with 'x0'.

You can set your preference with
  $schema->compile(prefixes =>
      [ mypref => 'urn:ietf:params:xml:ns:iodef-1.0' ]
    , ...etc.. );

or   ->new(use_default_namespace => 1)
-- 
               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