cancel
Showing results for 
Search instead for 
Did you mean: 

XPath expression

Former Member
0 Kudos

Hi everybody,

I am looking for the xpath expression

"Give back the titel for book number 222"

<?xml version="1.0" encoding="iso-8859-1"?>

<books>

<book>

<number>1111</number>

<titel>Das Silmarillion</titel>

</book>

<book>

<number>222</number>

<titel>Die Belgariad-Saga</titel>

</book>

<book>

<number>333</number>

<titel>Harry Potter</titel>

</book>

</books>

Thanks, Regards

Mario

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

got it:

/books/book/titel[preceding-sibling::number='222']

Thank you all

Regards Mario

Edited by: Mario Müller on Jan 25, 2008 6:06 AM

Jitendra_Jeswan
Contributor
0 Kudos

/books/book[2] /titel

or

/books/book[last()-1] /titel

or

/books/book/titel[number='222']

Regards.

Jeet.

Former Member
0 Kudos

Hi Mario Müller

As per my understanding you are looking for the usage of XPATH Expression to return back the node Book values having number 222.

Well that you need to handle it in mapping only.

If you are passing all the three nodes as seperatly then you could use XPATh expression to reidrect it absed on book number.

Please rectify me if I have interpreted in different way.

Thnaks

Swarup

Former Member
0 Kudos

Hi,

the following does NOT work

/books/book/titel[/books/book/number='222']

Former Member
0 Kudos

Hi,

Just have look if this could help you

/people/daniel.graversen/blog/2006/12/29/hack-using-xpath-in-xi-message-mappings

Probably this will give you some hint. I think you already have most of the settings as it should have to be.

/people/venkataramanan.parameswaran/blog/2006/03/17/illustration-of-enhanced-receiver-determination--sp16

Thanks

Swarup

Edited by: Swarup Sawant on Jan 25, 2008 11:56 AM

Jitendra_Jeswan
Contributor
0 Kudos

Hio Mario

This would work :

/books/book/titel [ number = '222' ]

/books/book/titel<open square bracket>number = '222' <close square bracket>

Regards.

Jeet