[Xml-compile] xsi:type woes

Petar Shangov pshangov at yahoo.com
Tue Mar 3 17:08:11 GMT 2009


Maybe for the update call you can use an 'after' hook (see how they work in XML::Compile::Translate::Writer) and add the xsi:type attribute directly on the xml node (via the XML::LibXML interface).

Retards,

Petar



----- Original Message ----
> From: Stig Brautaset <stig at brautaset.org>
> To: xml-compile at lists.scsys.co.uk
> Sent: Tuesday, 3 March, 2009 1:12:56
> Subject: [Xml-compile] xsi:type woes
> 
> I've been attempting to use XML::Compile against an internal web service at 
> $WORK. A lot of it works well, but some calls fail. The reason is that the 
> xsi:type attribute is omitted from the perl datastructure I get back, though the 
> WSDL specifies this as far as I can see. Actually it's not such a problem on the 
> get call, as I can live with not knowing the content on it for what I'm doing 
> but when it comes to save this information back this fails because the xsi:type 
> information is essential here.
> 
> I'm not sure if the problem is compounded by the XML having a bare "type" 
> attribute in a different namespace as well. I'm afraid I don't have access to 
> the details at home, and can't post to this list from work, so I'm typing this 
> from memory. Essentially the XML I get back contains a snippet like this:
> 
> 
> 
> and the Perl structure I get omits the xsi:type attribute:
> 
> {
> type => "BAR",
> alpha => "1",
> beta => "2",
> }
> 
> passing the the "xsi:type='ns2:Foo'" is, unfortunately, required in the 
> corresponding update call. But the generated XML looks like this:
> 
> 
> 
> , again omitting the xsi:type attribute. I've been reading and re-reading the 
> documentation, and trying out options to no avail. Is there some magic 
> incantation that will preserve the xsi:type attribute? I'd appreciate some 
> pointers...
> 
> 
> 
> Stig
> --http://code.brautaset.org
> http://devblog.brautaset.org
> 
> 
> 
> 
> 
> _______________________________________________
> Xml-compile mailing list
> Xml-compile at lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/xml-compile




More information about the Xml-compile mailing list