Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: A (simple) XPath Question.

From: Mukul Gandhi <mukul_gandhi@-----.--->
To: NULL
Date: 12/7/2008 9:35:00 AM
Here is another way (not as elegant as Martin's solution),

/*[local-name() =3D 'ItemInformation']/*[local-name() =3D 'ItemDetails']/*
[local-name() =3D '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() =3D '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=A0pm, Bubba <bu...@nowhere.com> wrote:
> Hi Group,
>
> I have been given a file in the following format:
>
> <ItemInformation xmlns=3D"http://tempuri.org/ItemInfo.xsd">
> =A0 =A0<ItemDetails>
> =A0 =A0 =A0<Title>This is the item title</Title>
> =A0 =A0 =A0<State>This is the item state</State>
> =A0 =A0 =A0<ItemCost ... />
> =A0 =A0 =A0<ItemCost ... />
> =A0 =A0 =A0<ReOrder>
> =A0 =A0 =A0 =A0 <MinLevel>25000</MinLevel>
> =A0 =A0 =A0 =A0 <MaxLevel ... />
> =A0 =A0 =A0</ReOrder>
> =A0 =A0</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.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent