[Xml-compile] Need help with XML::Compile::Translate::Writer and attributes with namespace

Mark Overmeer mark at overmeer.net
Fri Aug 3 22:55:16 GMT 2012


* David McMath (mcdave at stanford.edu) [120803 15:13]:
> This question came out of my trying to add "Create" and "Nonce"
> elements to a wsse:Security element and use them to create a
> password digest.  I got my case to work, in that the server is
> accepting my password now. I've appended the code below in case it's
> relevant.

Some protocols are clean and strict.  Other standards are
much less descriptive and fragmented.  The WSSE conglomate
is mainly described in paper and little in technology.

> My code works, and I shouldn't complain too much, ...

Congratulations... from all XML protocols I support, this is
probably the least convenient.  Besides, I have never used it
myself, so hope it fulfills people's needs.

> Whenever I try to put an attribute from another namespace into my
> element, I get warnings that are variations on "tag `wsu_Id' not
> used", as in the following:

For XML::Compile, it is important to know beforehand (compile-time)
what to expect on a certain node.  With 'any' and 'anyAttribute',
the schema explicitly hints on unspecified extensions (gladly we
now have substitutionGroups).  However: any element is allowed to
have any number of attributes... wildly checking for that on every
element would be very expensive.

With some tricks using hooks, it is possible to get this to
work.  Probably I should create a generic hook for this, because
       $schema->addHook(...)
is certainly not easy enough.  Adding/parsing an attribute in a hook
can be simple... however the generic implementation (understanding
fixed/default/validation/etc) is a bit more work.

> PS.  My code.  For purposed of my experiment, I stuck the method in
> XML::Compile::SOAP::WSS because I started out thinking I'd just
> override wsseBasicAuth but that didn't end up making sense.

It seems that everyone needs something else :(  At least what I
read in the many specs, there are many separate groups which
invented their own extensions.  If some extensions are used more
regularly, I can include a standard implementation for that.
-- 
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