![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| du -k shows different size in two nodes | KhawHL | UNIX for Advanced & Expert Users | 15 | 10-01-2007 02:11 AM |
| Managing nodes??? | TRUEST | UNIX for Advanced & Expert Users | 5 | 03-21-2003 05:47 AM |
| nodes | kamisi | UNIX for Dummies Questions & Answers | 3 | 05-30-2002 03:47 PM |
| compare date of files on different nodes | isacs | UNIX for Advanced & Expert Users | 3 | 03-12-2002 02:11 PM |
| i-nodes | djatwork | UNIX for Dummies Questions & Answers | 4 | 09-25-2001 12:29 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
Shell script to map XML nodes
Hi folks,
I'm a bit of a novice at this but here goes. I want to read in nodes from an XML file, and map the path to each. eg the file is structured <node><nodename>.</nodename> <node><nodename>topnode</nodename> <node><nodename>subnode1</nodename></node> <node><nodename>subnode2</nodename></node> </node> </node> and i want my output to be something along the lines of . ./topnode ./topnode/subnode1 ./topnode/subnode2 The XML files I am working with are 5-15 thousand lines long, and have many layers as above. I am able to get the nodes and so forth using SED and GREP without issue, but mapping them is a whole other challenge. Any one any ideas? thanks in advance, mark |
|
||||
|
Traditional Unix tools are not particularly good at this. If the file is monotonously structured you can get lucky but you're probably better off in the long run if you learn some basic XSLT or similar. This should be quite natural in that formalism (for perverse values of "natural"; it's a horrible formalism, as such).
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|