FAQ
Mark rightly noted this question should have been in a new thread, so
here goes.

This is an example of the element where I need a namedspaced attribute
added:

<Segment Apply="Included" ID="CELASSGS" xsi:type="SegmentInsuranceType">
<![CDATA[foo bar baz]]>
<Code Name="Code" Role="Reference" Value="xxx"/>
<Price Ref="PA" Value="100"/>
</Segment>

In my case there are only a few elements which need the attribute, so
a hook would probably suffice. A nicer way would be useful of
course. :-)

Drew
A new question: how can I specify a 'xsi:type="foo"' attribute on an
element? An example is: <Segment xsi:type="SegmentProductType">. I
tried passing " 'xsi:type' => 'foo' " in the data structure but it
was
ignored.

On the moment, there are no helpers to achieve this. Probably, I
should
create an option to have these added. It will be implemented as an
after-hook, which you can also make yourself:

$schema->addHook(type => $mytype, after =>
sub { my ($doc, $xml, $path, $val) = @_;
$xml->setAttribute("xsi:type" => $mytype);
$xml;
});

Unconvenient when you have many types which you want to make explicit.
XML::Compile::SOAP::Encoding knows how to do it better.

I have to think about a better solutions, although you should not need
it when using schemas the usual way.

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 4 | next ›
Discussion Overview
groupxml-compile @
postedAug 18, '08 at 12:16p
activeAug 18, '08 at 8:08p
posts4
users3
websiteperl.overmeer.net...

People

Translate

site design / logo © 2022 Grokbase