I've been having to do an XML project at work and I was wondering if anyone else who reads this has had experience in transforming xml using XSLT stylesheets to transform xml into plain text.
I've had success in such simple elements in xml format, but am stuck again when the file is more complicatied such as:
<parent>
<child1>
<tag>value</tag>
<tag>value</tag>
<grandchild1>
<tag>value</tag>
<tag>value</tag>
</grandchild>
<grandchild2>
<tag>value</tag>
<tag>value</tag>
</grandchild>
</child1>
<child2>
<tag>value</tag>
<tag>value</tag>
<grandchild3>
<tag>value</tag>
<tag>value</tag>
</grandchild>
<grandchild4>
<tag>value</tag>
<tag>value</tag>
</grandchild>
</child2>
.....
</parent>
*Note the tag elements are different names, but this pattern is repeatedly defined, of course.
So I want it to look like this
as a plain text output , deliminted by a special character such as | . (note the bullets are not output!). I don't want the tags themselves to be output, only the values
I've had success in such simple elements in xml format, but am stuck again when the file is more complicatied such as:
<parent>
<child1>
<tag>value</tag>
<tag>value</tag>
<grandchild1>
<tag>value</tag>
<tag>value</tag>
</grandchild>
<grandchild2>
<tag>value</tag>
<tag>value</tag>
</grandchild>
</child1>
<child2>
<tag>value</tag>
<tag>value</tag>
<grandchild3>
<tag>value</tag>
<tag>value</tag>
</grandchild>
<grandchild4>
<tag>value</tag>
<tag>value</tag>
</grandchild>
</child2>
.....
</parent>
*Note the tag elements are different names, but this pattern is repeatedly defined, of course.
So I want it to look like this
- child1_tag child1_tag grandchild1_tag grand_child1_tag
- child1_tag child1_tag grandchild2_tag grand_child2_tag
- child2_tag child2_tag grandchild3_tag grand_child3_tag
- child2_tag child2_tag grandchild4_tag grand_child4_tag
- .......
as a plain text output , deliminted by a special character such as | . (note the bullets are not output!). I don't want the tags themselves to be output, only the values
- Mood:
confused
