L
Leonard T. Armstrong
I have an XML document that is structured similarly to the following
generalization:
<?xml version="1.0" encoding="UTF-8"?>
<A xmlns="urn:aaa-aaa-aaa:a-part">
<B>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>1</D>
<D>2</D>
</C>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>3</D>
<D>4</D>
</C>
</B>
<B>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>5</D>
</C>
</B>
</A>
is there a simpler XPATH expression to grab all <D> elements than the
following?
//*[namespace-uri()='urn:ccc-ccc-ccc:c-part' and local-name()='D']
The problem seems to stem from the fact the the documents I am given do
not have namespace prefixes.
Any thoughts?
Thanks,
Leonard Armstrong
generalization:
<?xml version="1.0" encoding="UTF-8"?>
<A xmlns="urn:aaa-aaa-aaa:a-part">
<B>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>1</D>
<D>2</D>
</C>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>3</D>
<D>4</D>
</C>
</B>
<B>
<C xmlns="urn:ccc-ccc-ccc:c-part">
<D>5</D>
</C>
</B>
</A>
is there a simpler XPATH expression to grab all <D> elements than the
following?
//*[namespace-uri()='urn:ccc-ccc-ccc:c-part' and local-name()='D']
The problem seems to stem from the fact the the documents I am given do
not have namespace prefixes.
Any thoughts?
Thanks,
Leonard Armstrong