...

View Full Version : How do I Read -> Modify -> Write an XML Document



frazras
06-24-2008, 12:49 AM
I have an XML Document that I want to read in, then add a few tags, values and attributes then Output it as a modified XML. How would I get this accomplised. Do you have any suggested methods or Libraries. I am a java programmer but can use practically any language[xcept Msoft tools].

Alex Vincent
06-24-2008, 01:45 AM
Which application would be doing this? A web browser? A server-side script? Some other source?

What's the original source look like? What would you be adding, and where? Where's the output going (to a web browser, to an e-mail address...)

We need many more details before we can really help.

frazras
06-24-2008, 02:02 AM
Which application would be doing this? A web browser? A server-side script? Some other source?

I said I know java, so a regular desktop application would do. I also know php, so the it doesnt matter I just want the problem solved.


What's the original source look like? What would you be adding, and where?

excerpt code below. I will be adding the path tag and the ID attributes in some of the tags.



<store id="1">
- <products>
- <product id="2">
- <categories>
- <category id="3">
<description />
<id>430</id>
<name />
<parent />
</category>
</categories>
<cost>121.49</cost>
<description>510 g (18 OZ)</description>
<id>0</id>
- <image id="4">
<path>/home/epocolis/Desktop/downloads/Completed/no_pic.jpg</path>
</image>
<imagePath />
<listPrice>0.00</listPrice>
<model>11224P</model>
<name />
<sellPrice>151.21</sellPrice>
<type>product</type>
<unique_hash>3935b9d1465fdf5ec5233659c1bb303e</unique_hash>
<weight>0</weight>
</product>




Where's the output going (to a web browser, to an e-mail address...) The output is going to another [edited] XML file - thats it



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum