Node not being matched to template


Firstly I will say im a complete and total novice when it comes to XSLT and XML so this could be a very obvious mistake on my behalf.

<xsl:stylesheet version="1.0"

  <xsl:template match="node()">
      <xsl:copy-of select="@*"/>

  <xsl:template match="TestNode">
      <xsl:copy-of select="."/>


When running the above, even though <TestNode> exists it does not match and rename the node and I cannot figure out why :/

Is anyone able to shed some light on why this is the case?

Thanks in advance


Can you please post your XML? I would initially check your node names and structure.


I cannot post the actual XML due to what it is used for however I will quickly recreate the structure of the document.


Problem has been solved. It was an issue to do with the namespace the XML used (wasnt aware this had an impact due to inexperience with XSL)


Question Answered as of 3 Years Ago by StephNicolaou

Okay that's good news! I thought so, it has to match correctly with the XSL :)

Isn't it about time forums rewarded their contributors?

Earn rewards points for helping others. Gain kudos. Cash out. Get better answers yourself.

It's as simple as contributing editorial or replying to discussions labeled or OP Kudos

This question has already been solved: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: