How can I extract the value of an attribute node via XPath?
A sample XML file is:
//Parent[@id='1']/Children/child/@name
Your original child[@name] means an element child which has an attribute name. You want child/@name.
child[@name]
child
name
child/@name