xslt-xpath

T

Tomislav Jakopec

Help please!

my xml element is

<?xml version="1.0"?>
<ROOT>
<el1 id="d">111111</el1>
<el2 id="c">222222</el2>
</ROOT>

I wana list all element that start with el (el1, el2)

it is not a problem with element value or attribute value but i can't
get value of element name
 
M

Martin Honnen

Tomislav said:
<ROOT>
<el1 id="d">111111</el1>
<el2 id="c">222222</el2>
</ROOT>

I wana list all element that start with el (el1, el2)

You can use the XPath
/ROOT/*
to select all child elements of the <ROOT> element and then filter those
on the name e.g.
/ROOT/*[starts-with(local-name(.), 'el')]
 
T

Tomislav Jakopec

Martin said:
Tomislav said:
<ROOT>
<el1 id="d">111111</el1>
<el2 id="c">222222</el2>
</ROOT>

I wana list all element that start with el (el1, el2)


You can use the XPath
/ROOT/*
to select all child elements of the <ROOT> element and then filter those
on the name e.g.
/ROOT/*[starts-with(local-name(.), 'el')]
That it's, TNX!
 
M

mzi

Tomislav said:
Help please!

my xml element is

<?xml version="1.0"?>
<ROOT>
<el1 id="d">111111</el1>
<el2 id="c">222222</el2>
</ROOT>

I wana list all element that start with el (el1, el2)

it is not a problem with element value or attribute value but i can't
get value of element name

I shink its "./name()" you are looking for.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,269
Messages
2,571,099
Members
48,773
Latest member
Kaybee

Latest Threads

Top