Input:
<a q='r'>
<b x='1' y='2' z='3'/>
<!-- other a content -->
</a>
Desired output:
<A q='r' x='1' y='2' z='3'>
<!-- things derived from other a content, no b -->
</A>
Could someone kindly give me a recipe?
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.
Easy.
The
<xsl:apply-templates />is not necessary if you have no further children of<a>you want to process.Note
<xsl:copy-of>to insert source nodes into the output unchanged|to select several unrelated nodes at onceEDIT: If you need to narrow down which attributes you copy, and which you leave alone, use this (or a variation of it):
or even
Note how the parentheses make the predicate apply to all matched nodes.