Hi all,

I have the pleasure of working with a schema which has lots of
complexTypes that allow mixed elements (<complexType name="FooType"
mixed="true">). If it matters, I'll mostly be making requests to a
service and parsing the response. It seems that this is generally not
well supported based on my reading of the docs and experimentation. I
can use a hashref to specify the attributes of given mixed element,
but must pass an XML::LibXML::Node object for the nested elements/
text. The $64k question is: how can I create the nodes as easily as I
can create non-mixed XML?

Here's an example I'm dealing with. This is how I expected to be able
to pass the data:

Control =>
# <Control>
# <Requester Channel="Extranet" Code="TO-TEST-PV"> <Company
# <Code Role="Rebate" Value="xxx" Name="salesContractId"/> </
# <Country Code="FR"/> </Requester> </Control>
Requester => # element
Channel => 'Extranet',
Code => 'TO-TEST-PV',
Company =>
Is => 'TourOperator',
Code => { Role => "Rebate", Value => 'xxx', Name =>
'salesContractId' },
Country => { Code => 'FR' },
# <Style Direction="Out"><Language Code="EN"/></Style>
Style =>
Direction => 'Out', # an attribute
Language => { Code => 'EN' }, # element

But it appears that for the Requester element I have to construct an
XML::LibXML node, and also for the Language element. Is there a
shortcut I can use to reduce the boiler plate I'd be using to generate
the XML nodes? How are other people handling mixed schemas?


Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 9 | next ›
Discussion Overview
groupxml-compile @
postedAug 11, '08 at 6:16p
activeAug 25, '08 at 8:35p



site design / logo © 2022 Grokbase