Changing Node Values for Dereference function



I’m trying to dereference an XML document (i.e., copy referenced nodes and replace the referencer), as in:

 

FROM

 

<top>

  <member> data data data </member>

  <member> asdf asdf asdf</member>

  <other>

   <member reference=”/top/member[2]”/>

    <member reference=”/top/member”/>

   </other>

</top>

 

TO

 

<top>

  <member> data data data </member>

  <member> asdf asdf asdf</member>

  <other>

    <member> asdf asdf asdf</member>

    <member> data data data </member>

   </other>

</top>

 

If I make a copy (using create_root_node_by_import), cannot simply update lower nodes with node::import_node, because it doesn’t overwrite  and simply tacks the new node to end of the node-list, potentially destroying order.

 

Only way I see to do this is to individually and completely copy each node (without using the built-in recursive).  Is there a simpler way?

 

(Constraint: I need control of which nodes are actually dereferenced, so a general program is probably not suitable.)

 

Stan



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