What is the lowest-cost, cross-platform approach to parse XML using ksh? -


need parse basic xml (one root element, 3-4 subelements, 1-3 attributes each) ksh script (ideally stick ksh, given script exists , it's trying read configuration created in xml program).

i know can use sed , pattern matching, it's not foolproof given input xml change , attributes duplicated on various subelements (or new subelements).

so far, i'm thinking of using xslt against xml extract few attributes (for specific elements) ksh script cares individual fields. can use oracle given db-driven product, , oracle installed on our systems, seems bit heavy handed.

any other safe approach extract specific attributes input xml in cross-platform manner doesn't require access 3rd-party parser/transformer?

you might want take @ pure bash implementation, if keeping in shell script important.

that said, other scripting languages such python , perl highly portable, , make life lot easier. perl's xml::twig module, instance, comes end-user script called "xml_grep", can passed --text_only option extract text of node found complex search. shouldn't harder modify return specified attribute well.


Comments

Popular posts from this blog

c++ - How do I get a multi line tooltip in MFC -

asp.net - In javascript how to find the height and width -

c# - DataTable to EnumerableRowCollection -