2
Contributors
1
Reply
24
Views
3 Years
Discussion Span
Last Post by xml_looser
0

in the first xquery query an error is included
substring-before and substring-after only possess
maximum of 2 arguments
then from the query

substring-after (substring-before (/ / ul [@ id = 'biblio'] / li [3], ']'), '[')

as an example

<? xml version = "1.0"?>
<root>
<ul id="biblio">
<li>
</ li>
<li>
</ li>
<li> [abcdef] </ li>
</ ul>
</ root>

result

abcdef

in the second query the predecessor of h1 h2 tag is used to find content name blank will be deleted

as for example

<? xml version = "1.0"?>
<root>
<h1> aaaaaaa </ h1>
<h1> bbbbbbb </ h1>
<h2> name </ h2>
</ root>





/ / h2 [normalize-space (string ()) = 'name'] / preceding :: h1 [1]

result
bbbbbbb

/ / h2 [normalize-space (string ()) = 'name'] / preceding :: h1 [2]

result
aaaaaaa

/ / h2 [normalize-space (string ()) = 'name'] / preceding :: h1

result
aaaaaaa
bbbbbbb

hope this will help you

Edited by xml_looser

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.