[xml-compile] namespace prefixes

Mark Overmeer mark at overmeer.net
Thu Sep 30 21:24:36 GMT 2010


* Wes Young (wes at ren-isac.net) [100930 16:37]:
> $ perl test.pl
> <iodef:IODEF-Document xmlns:iodef="urn:ietf:params:xml:ns:iodef-1.0"
> rock'n... thank you very much!
> 
> one more question, when building this sort of thing (off of xsd's),
> is it more "appropriate" to use the XML::Compile::Cache paradigm or
> is that really for when you have multiple possible schema's (or
> xsd's) you're trying to wrap?

No, Both XML::Compile::Schema and ::Cache administer multiple
schemas.

when your application grows larger, you will produce a large number of
code-refs. And they all need comparible parameters which you have to pass
around in your program... XML::Compile::Cache does that administration
for you, You can do
   $cache->declare(WRITER => $type, @opts);
   # somewhere else
   $cache->writer($type)->($doc, $data);

in stead of
   my $call = $schema->compile(WRITER => $type, @opts);
   # somewhere else
   $call->($doc, $data);

It is a nicer abstraction, especially for general purpose implementations
like CPAN modules.

> This RFC only has a single XSD (and namespace), so it seems to work
> OK with just ::Schema... want to make sure I'm using
> (/understanding) it correctly based on your GML examples...

Geo::GML is very complex.  Geo::KML is simpler.  XML::Compile::RPC is
the easiest, I think.

If you plan to publish your module on CPAN, I'll happily proof-read
your code ;-)
-- 
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