xom-interest AT lists.ibiblio.org
Subject: XOM API for Processing XML with Java
List archive
- From: "Grzegorz Kaczor" <grzegorz.kaczor AT gmail.com>
- To: "Narjis Malik" <narjismalikster AT gmail.com>
- Cc: xom-interest AT lists.ibiblio.org
- Subject: Re: [XOM-interest] Append in XML file
- Date: Fri, 2 Mar 2007 17:29:47 +0100
Hello,
did you try parsing the document and then manipulating the resultant
DOM tree? Just build the document, then run an XPath query (something
like: //service[@name='GetFuture...'] ) to find all the elements you
want to replace, after you get the result list, for each node found
access its parent and replace the found node with a new 'synonym'
element. This should be straightforward, however I did not implement
it.
Regards,
Grzegorz
On 02/03/07, Narjis Malik <narjismalikster AT gmail.com> wrote:
Hello,
I am working on XML files using nux and xPath, I want to append xml
doucument at a particular location, how can I do it....
I will demonstrate my question with the following example
i have a xml document
___________________________________________________________________________________
<?xml version="1.0" encoding="UTF-8"?>
<service name="GetFutureSybmolization">
<synonym name="bvcvcvc">
</synonym>
</service>
_____________________________________________________________________________________
now what i need , i want to append this xml file with new element :
as i scan this xml and when there is service element with name =
"GetFutureSybolization"
then i want to add new element <synonym name="XYZDGD"></synonym>
please help me how can i do it...
as i tried to do it but it append at the end of file but i cant append in
some where else
waiting for a reply
_______________________________________________
XOM-interest mailing list
XOM-interest AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/xom-interest
--
"Imagination is more important than knowledge."
A.E.
-
[XOM-interest] Append in XML file,
Narjis Malik, 03/02/2007
-
Re: [XOM-interest] Append in XML file,
Grzegorz Kaczor, 03/02/2007
-
Message not available
- Re: [XOM-interest] Append in XML file, Grzegorz Kaczor, 03/02/2007
-
Message not available
-
Re: [XOM-interest] Append in XML file,
Grzegorz Kaczor, 03/02/2007
-
Re: [XOM-interest] Append in XML file,
Wolfgang Hoschek, 03/02/2007
- Re: [XOM-interest] Append in XML file, Wolfgang Hoschek, 03/02/2007
Archive powered by MHonArc 2.6.24.