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

Forum statistics

Threads
474,001
Messages
2,570,254
Members
46,849
Latest member
Fira

Latest Threads

Top