[Xml-compile] What is $action in XML::Compile::Tester synopsis

Mark Overmeer mark at overmeer.net
Mon Nov 24 14:12:56 GMT 2008


* Zbigniew Lukasiak (zzbbyy at gmail.com) [081124 13:56]:
> On Mon, Nov 24, 2008 at 2:44 PM, Mark Overmeer <mark at overmeer.net> wrote:
> 
> In the XML::Compile::Tester there is similar part:
> 
> # set default namespace, such that $type only needs to use local
>  my $type   = pack_type($ns, 'localName'); # X::C::Util
>  set_default_namespace($ns);
>  my $type   = 'localName';
> 
> But it is never  explained what should be in  the $ns variable above.

XML uses namespaces: each type and element has a name based on two
components: the namespace and a localname.  For instance, in this
fragment:

    <p:book xmlns:p="http://mybookshelf"/>

the element's name is:
    namespace=http://mybookshelf localname=book

You need this pair to refer to an element: "book" is defined in
http://mybookshelf  (a schema with targetNamespace http://mybookshelf)

Have a look at the schema's defined in your WSDL, and see which
targetNamespaces they use.  You can also try:
  $wsdl->schemas->printIndex

Namespace undef == namespace '' == namespace-less (global) types
and elements.  This must be avoided!

The use of namespaces is so very basic XML that I do not explain
this in the manual-pages of my modules.  Although there could be
some FAQ page explaining very basic terminology.
-- 
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