You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by "Gagnon, Joseph - 0553 - MITLL" <Jo...@ll.mit.edu> on 2015/07/31 19:01:40 UTC

Creating a DOM element that is abstract

Suppose that I have an XML schema that includes some schema types that are
abstract (as well as some schema types that provide concrete implementations
of the abstract types).  Now assume that I'm using the Xerces C++ API to
build a DOM (xercesc::DOMDocument) for a schema type from my schema that
happens to be abstract.  I will construct the element structure and content
appropriate for a concrete implementation of that abstract type.  What I
don't understand is: how does the DOM "know" the concrete type
implementation that I built?

 

To put this another way, if I were to write XML that does the same thing
described above, I'd have something like the following:

 

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<SomethingThatIsAbstract xmlns="." xsi:type="ConcreteImplementorA" .>

                <!-internal elements, etc. representing the structure of
ConcreteImplementorA -->

</SomethingThatIsAbstract>

 

There does not appear to be anything in the API that allows for the
specification of the "type" when creating an element.  How does this work?

 

Thanks,

Joe Gagnon

 

Engineer II

Group 53 - Secure Resilient Systems and Technology

MIT Lincoln Laboratory

Lexington, MA