| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| I seem to think that xgawk would be a good use for this, but I can't seem to get my brain around what I need to do. I have thousands of XML files that look like: <tag1 attrb="1"> <tag2 attrb2="1"/> <tag3 decision="Y"/> </tag1> I want to use xgawk to print the entire tree iff decision="y". I know how to find decision="Y" -- I just don't know how to back-track to print out the entire document at "tag1". Any ideas? -- mhostetl@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org |
|
#2
| |||
| |||
| Mike Hostetler escribió: > I seem to think that xgawk would be a good use for this, but I can't seem to get my brain around what I need to do. > > I have thousands of XML files that look like: > > <tag1 attrb="1"> > <tag2 attrb2="1"/> > <tag3 decision="Y"/> > </tag1> > > I want to use xgawk to print the entire tree iff decision="y". I know how to find decision="Y" -- I just don't know how to back-track to print out the entire document at "tag1". > > Any ideas? > Please try the xmltree library included in the xgawk distribution. It automatically stores the whole XML tree and allows to do the desired processing in the END rule. To print the whole tree just invoke: XmlPrintNodeTree(1) Regards. |
|
#3
| |||
| |||
| Manel Collado <m.collado@fi.upm.es> wrote: > Please try the xmltree library included in the xgawk distribution. It > automatically stores the whole XML tree and allows to do the desired > processing in the END rule. To print the whole tree just invoke: > > XmlPrintNodeTree(1) Yep, that did it. Funny, I had your xgawk page open when I read this. Thanks for the help. -- mhostetl@sdf.lonestar.org SDF Public Access UNIX System - http://sdf.lonestar.org |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.