This is a problem I came across.
source xml:
<n0>Hello1</n0>
<n1>Hello3</n1>
<name>Hello2</name>
I can use
<xsl:template match="*[starts-with(name(),'n')]">
to match n0,n1. but I dont want to match ‘name’, what can I do to match only n0,n1?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The best match would depend on your rules.
For example if you just want to exclude ‘name’ specifically, then use…
On the other hand if you wanted to match ‘n’ followed by a digit (as opposed to n following by a letter or dash), then use…
It is not possible to give an optimal solution, until you can unambiguously and rigorously define the desired matching condition.
Also, if it is ONLY n1 and n2 that you want to match, then you can use…