XML/Input: Difference between revisions

378 bytes added ,  15 years ago
→‎{{header|AWK}}: add solution using getXML.awk
(→‎{{header|Tcl}}: + pure-Tcl solution)
(→‎{{header|AWK}}: add solution using getXML.awk)
Line 106:
}
}</lang>
Using [http://awk.info/?getxml getXML.awk] written by Jan Weber, one could do this:
 
{{works with|gawk}} or {{works with|nawk}}
<lang sh>awk -f getXML.awk sample.xml | awk '
$1 == "TAG" {
tag = $2
}
tag == "Student" && /Name=/ {
print substr($0, index($0, "=") + 1)
}
'</lang>
producing this output
<pre>April
Bob
Chad
Dave
&amp;#x00C9;mily</pre>
 
=={{header|C}}==
Anonymous user