D
David Gordon
Hi Folks,
I wonder if anyone can help me with the following (perhaps trivial) problem:
<xml>
<node name="a" type="a"/>
<node name="b" type=""/>
<node name="c"/>
<node name="d" type="b"/>
</xml>
we're using a command line xpath script to pluck values from
configuration files, e.g. to get the list of node names:
xpath test.xml '/xml/node/@name'
Returns the list of names in the file, easy.
a
b
c
d
Because of the way our other command line tools work, we're relying on
the result being a return separated list. We can get the list of types
like this:
xpath test.xml '/xml/node/@type'
which returns
a
b
But passes over the node with no type attribute. Is there an xpath query
which would give the result:
a
b
So where no type attribute existed, an empty string is returned?
thanks in advance,
David Gordon
I wonder if anyone can help me with the following (perhaps trivial) problem:
<xml>
<node name="a" type="a"/>
<node name="b" type=""/>
<node name="c"/>
<node name="d" type="b"/>
</xml>
we're using a command line xpath script to pluck values from
configuration files, e.g. to get the list of node names:
xpath test.xml '/xml/node/@name'
Returns the list of names in the file, easy.
a
b
c
d
Because of the way our other command line tools work, we're relying on
the result being a return separated list. We can get the list of types
like this:
xpath test.xml '/xml/node/@type'
which returns
a
b
But passes over the node with no type attribute. Is there an xpath query
which would give the result:
a
b
So where no type attribute existed, an empty string is returned?
thanks in advance,
David Gordon