|
Yes, Very nice Barbara. The advent of fully qualified data structures immediately led me to think of writing procedures that facilitated mapping an XML document into a DS which of course would have assumed the well formedness and expected that the structure must be predefined to match the XML. I no longer need to think about this. Peter -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Barbara Morris Sent: Saturday, 4 February 2006 10:50 a.m. To: rpg400-l@xxxxxxxxxxxx Subject: Re: RPG XML Parsers and Schemas was -> Bob's letter on V5R4 RPG stuff Aaron Bartell wrote: > > >No - not yet. It makes the assumption that the XML is well-formed and > valid. Although if there are missing/extra elements/attributes you can deal > with it. > > Just want a little clarification on this one because I don't know what they > are using under the covers (assuming Xerces). A parser (usually) _does_ care > about well-formed and will throw errors (with column and line number) if not > well formed. > > Did you mean to say that it assumes the XML meets the constraint criteria of > whatever schema/dtd it represents? So even though a <order> tag might > require one <item> element based on the schema (XSD), the parser could care > less. > The parser simply requires that the XML be well-formed. It's a non-validating parser, so schemas or DTDs are irrelevant to it. RPG's XML-INTO operation does put a constraint on the XML: that the XML conform to the RPG variable. For example, if you specify a data structure INFO with subfields IDNO and ADDRESS, the default behaviour of XML-INTO is that the XML document is expected to have the document element named "info", with two children (either elements or attributes), one named "idno" and one named "address". D info ds D addr 100a D idno 5p 0 /free xml-into info %xml(xmldoc); This XML-INTO statement requires the XML document be something like this: <info idno="1350"> <addr>Whatever</addr> </info> or this <info> <addr>Whatever</addr> <idno>12345</idno> </info>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.