currently I’m receiving this
<root>
<event>bla</event>
</root>
What I want is only this
<event>bla</event>
My xsl looks like this
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" indent="yes" />
<xsl:param name="Number" />
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="/root/event" />
<xsl:template match="/root/event[1]">
<xsl:copy-of select="current()" />
</xsl:template>
</xsl:stylesheet>
I can’t figure out how to access the first node without going over /root first.
Pls help
This XSLT should answer your question. It will give
eventelements that are first child of their parent node :The
rootelement is skipped by thematch="*"template.Another way to do this (more simple but less evolutive) :