------ extPart_000_0016_01C54E91.42976650
Content-Type: text/plain;
charset so-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
I'm new to ruby.
I want to use ruby to process an xml file.
At the moment I am using the REXML but are open to other xml parsers.
In the xml file below how would I go about processing the section <details> in the following way: -
- when the tag <copy> is detected perform a method "copy". within the "copy" method extract other child tags within the current <copy> element.
- when the tag <mkdir> is detected perform a method "mkdir". within the "mkdir" method extract other tags within the current <mkdir> element.
I've looked at using XPATH, and have been able to extract specific information but have not worked out how to do it.
here is a sample xml file: -
<?xml version="1.0"?>
<fileGroup>
<summary>
<application>
This can state one or multiple applications
</application>
<owner>
Person from development who create this file
</owner>
<description>
This is a sample File group xml
</description>
</summary>
<details>
<copy>
<source version="3">//myPath/to/File.txt</source>
<target>target directory path goes here</target>
</copy>
<copy>
<source>//myPath/to/File2.txt</source>
<target>target directory path goes here</target>
</copy>
<mkdir>relative/Path</mkdir>
</details>
</fileGroup>
------ extPart_000_0016_01C54E91.42976650--