FAQ

On 15 Sep 2008, at 09:55, Mark Overmeer wrote:

* mirod (xmltwig@gmail.com) [080915 08:06]:
<eb:PaymentMethod xsi:type="eb:UniversalBankTransactionType">
Probably, you should address this like: (untested)

use XML::Compile::Util 'SCHEMA2001i';

my $xml = XML::Compile->dataToXML($msg);
my $root = $xml->documentElement;
my $type = $root->getAttributeNS(SCHEMA2001i, 'type');
my ($prefix) = $type =~ s/(.*)\://;
my $ns = $root->namespaceURI($prefix);

if($type eq 'UniversalBankTransactionType')
{ my $call = $schema->compile(READER => "{$ns}$type");
my $data = $call->($root);
}
So continuing this thread, I have a schema (XFT) which makes extensive
use of xsi:type attributes on many elements besides the root element.
I hate this schema with a passion, but I have to work with it. An
example looks like:

<Segment xsi:type="SegmentProductType">
<Code Value="R2Y"></Code>
<Segments>
<Segment xsi:type="SegmentStayType">
<Begins>
.....

Is there any chance that this will be supported in the near future? My
employer will consider sponsoring the development of the feature if
that will help. :-)

Thanks,
Drew

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupxml-compile @
postedSep 15, '08 at 9:55a
activeSep 24, '08 at 10:04a
posts2
users2
websiteperl.overmeer.net...

2 users in discussion

Drew Taylor: 1 post Mark Overmeer: 1 post

People

Translate

site design / logo © 2022 Grokbase