[xsd-users] Re: Accessing elements in sequence of choices. Elements are complex types

B Hart bhartsb at gmail.com
Thu Mar 15 12:46:16 EDT 2012


Sorry I didn't reply all so here it is again (with some extra editing):

What I mean by "reported in the corresponding XML" is that each procedure
is reported using an element which is itself a complex type having sub
elements included by reference.  For example ProcedurePTA (PTA means
procedure performed prior to Emergency Medical Services arrival).
ProcedurePTA includes by reference two child elements E19_01 and E19_03.
E19_03 is to hold the code for the procedure.

Another procedure I showed above is 89.701 (this is the code for an
assessment procedure), and it includes by reference sub elements E19_01,
E19_02, E19_03 and E19_09.

The XML file, used for reporting procedure data, will include data for one
or more procedures performed, by enclosing within the E19_01_0 elements,
procedure elements.  In the above example, I showed two procedures (both a
"ProcedurePTA") being reported.

Based on certain criteria I want to be able to check if a procedure was
reported or not.  For example I might want to see that at least one
assessment procedure was performed.

The problem that I'm having is that while I can get an E19_01_0 iterator I
can't figure out how to access the individual procedure elements with the
E19_01_0 element.   XSD generated a class for each procedure, so for
example there is a class P89_701, however I can't  find the right syntax to
gain access to an instance of it.  In other words, I want to iterate
through all the E19_01_0 elements, check for the presence of a given
procedure such as 89.701.

Do I have to do this via the DOM, or can I just check if P89_701 is
present?  Or alternately since every procedure has an element 19_03 (which
somewhat redundantly contains the procedure code), can I access that
element and check?

Make sense?

Thanks.

On Thu, Mar 15, 2012 at 5:25 AM, Boris Kolpackov <boris at codesynthesis.com>wrote:

> Hi,
>
> B Hart <bhartsb at gmail.com> writes:
>
> > How do I check if a choice of the three above procedures is reported in
> the
> > corresponding XML, and then access it's elements?
>
> I don't know what "reported in the corresponding XML" means. For more
> information on how to access particles in various compositors in C++/Tree,
> see Chapter 4, "Working with Object Models" in the C++/Tree Mapping
> Getting Strated Guide:
>
> http://www.codesynthesis.com/projects/xsd/documentation/cxx/tree/guide/#4
>
> Boris
>


More information about the xsd-users mailing list