Getting the markup inside an entity

"Jose E. Marchesi" <[email protected]>
Newsgroups gmane.text.xml.expat.general
Message-ID <[email protected]>
Hi all.

I am writing some xml based import/export features for GNU
Ferret[1]. The data i want to import/export is somewhat like:

<PROJECT>

  <DATAMODEL NAME="..." ...>
    <OBJECT_COLLECTION>

        <OBJECT OID="..." ...>

          <DATA>
            <!-- Object specific data -->
          </DATA>

        </OBJECT>
  
        ...

    </OBJECT_COLLECTION>
  </DATAMODEL>
  
  <DOMAIN_TREE>

    <!-- Domain tree data -->

  </DOMAIN_TREE>

  ...
</PROJECT>

Each object in a datamodel has a type. Each object type store a
different data structure. GNU Ferret is written in a way in that the
developer can "register" new object types. 

I want to use different expat parsers to manage the <DATA> entities
that contain the data of an object. In the same way i want to use a
different parser to manage the domain trees (the user may want to
import a domain tree stored in a separated file, beginning with the
<DOMAIN_TREE> entity).

Well, as i understand it, what i need is a way to get the complete
markup inside an entity. For example, when the datamodel parser finds
a <DATA> entity, it would get the markup inside that entity, call the
object type specific parser to process it, and ignore the contents of
<DATA> continuing the parsing.

Is that feasible? If not, there is another way to achieve the
modularity i want? (i was thinking in complex temporal handler and
user data reassignments).

Thanks in advance!!


[1] - http://www.gnu.org/software/ferret
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.