> Bryce, am I to assume you're saying one can't have multiple XML
> documents, seriatim, in one physical file? This isn't a programming
> question, as this isn't a programming mailing list, but I was supposing
> there might be some way to use SAX or DOM input streams and exceptions
> to force multiple documents in through the same file. Even if not, you
> can always package separate XML documents in multiple MIME containers
> within one sequential file.
>
Correct. For an XML document to be valid (i.e. well-formed) it must contain
one, and only one document level element. If you had more than one, you
would not be able to use any standard libraries to parse it. All SAX/DOM
parsers that I know of would throw an exception once it found that second
document level editor. You would have to write your own parser that allowed
multiple XML documents in one file.
Wrapping multiple documents in MIME containers makes it no longer an XML
file, it's a MIME file, so you introduce another layer of parsing (which may
or may not be acceptable, depending on your circumstances).
> I just wanted to make sure that someone reading your e-mail doesn't run
> to some suit with this "deficiency," causing all interest to dry up for
> gussied-up UML-modeled core-componentized ISO 11179 compliant XML based
> e-business standards like OASIS UBL.
>
Not sure how my post would be taken in that context. What I was trying to
infer was that if you're moving an EDI document into XML, a hierarchical
nesting of nodes is a very desirable thing. Particularly if you have one
file with multiple EDI documents. This was one consideration in our
EDI-to-XML product xmlLinguist. The document level node in a translated file
has nothing to do with the EDI file being translated, it's merely a
container with a user-defined name. Each ISA segment is then a child node
directly off of this node. For example, you would see something like this:
<MyEDIMap>
<ISA>
<!-- fields -->
<GS>
<!-- etc -->
</GS
</ISA>
<ISA>
<!-- fields -->
<GS>
<!-- etc -->
</GS
</ISA>
</MyEDIMap>
The point being that now each ISA node contains all the segments for that
particular EDI document. The GS/ST/etc nodes are all child nodes of the ISA
node. So, if a second ISA is found, it's children won't be confused with the
first ISAs.
HTH,
Bryce K. Nielsen
SysOnyx, Inc. (www.sysonyx.com)
Read our latest EDI/XML tutorial:
http://www.sysonyx.com/xml-to-edi-850
.
Please use the following Message Identifiers as your subject prefix: <SALES>,
<JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>
Access the list online at: http://groups.yahoo.com/group/EDI-L
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/EDI-L/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/