Re: [xml] Inserting node using xpath and schema



On Fri, Aug 18, 2006 at 12:40:08PM -0400, Kreidler Joseph-QA1818 wrote:
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
extensions)
- 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
siblings.

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

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

  create the node, then use xmlAddPrevSibling or xmlAddNextSibling 

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?

  no

Daniel

-- 
Red Hat Virtualization group http://redhat.com/virtualization/
Daniel Veillard      | virtualization library  http://libvirt.org/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine  http://rpmfind.net/



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