Here is another way (not as elegant as Martin's solution),
/*[local-name() = 'ItemInformation']/*[local-name() = 'ItemDetails']/*
[local-name() = 'Title']
Though this will cause a problem, if there are elements with same
local name but different namespace URIs. But it seems this could work
for you.
Writing like this
//*[local-name() = 'Title']
could have been easily acceptable, but writing local-name() function
at every step is certainly inelegant. you can use what I wrote if you
want ...
On Dec 6, 8:05*pm, Bubba <bu...@nowhere.com> wrote:
> Hi Group,
>
> I have been given a file in the following format:
>
> <ItemInformation xmlns="http://tempuri.org/ItemInfo.xsd">
> * *<ItemDetails>
> * * *<Title>This is the item title</Title>
> * * *<State>This is the item state</State>
> * * *<ItemCost ... />
> * * *<ItemCost ... />
> * * *<ReOrder>
> * * * * <MinLevel>25000</MinLevel>
> * * * * <MaxLevel ... />
> * * *</ReOrder>
> * *</ItemDetails>
> </ItemInformation>
>
> The ItemInfo.xsd file does not exist. But how do I extract the Title
> element using XPath from this file? I've tried all manner of syntax but
> never get any results, can anyone help here please.
|