[xml] Inserting node using xpath and schema

I'm fairly new to xmllib2 and could not find answers to my questions
below by searching the FAQ and list archives. I'm trying to determine
how I can use xmllib2 to accomplish the following:

- I have a parsed XML document in memory 
- I have multiple schemas for the document (a base schema and
- I have an Xpath element expression and an element value

I want to be able to add the new element and value to the document based
on the Xpath expression and the schemas. The schema contains sequences
so the Xpath element has to inserted as a child node in between existing

I can add a child node but its always after all of the existing

Are there APIs that allow me to insert a node in between existing
sibling nodes?

Is there a way to use a schema to tell libxml2 to insert a node as a
child of a parent and the schema is used to determine the proper
location of the node amongst the existing children?

Thanks in advance,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]