Jump to content

Match all nodes except for the first


yoshimura
 Share

Recommended Posts

I'd like to match everything for the first child node of the root.Here's how my XSLT starts out:

<xsl:template match="/">		<html>			<head>				<link rel="stylesheet" type="text/css" href="lexpress.css" />				<title>L'Express — <xsl:value-of select="/Lexpress/Date"/></title>			</head>			<body>				<h1>L'Express</h1><p class="date"><xsl:value-of select="/Lexpress/Date"/></p>				<xsl:apply-templates/>			</body>		</html>	</xsl:template>

The DOM tree looks like this:Root Date Article Article Article ArticleI don't want the Date element to show up at the top of the HTML output document.

Link to comment
Share on other sites

This:

<xsl:apply-templates select="Root/Article"/>

Does indeed work.I was being too generic with my DOM tree example; Each Article element actually have different names. There is a possibility of 30-something different element names that are children of the root.The code below didn't work:

<xsl:template match="Date"/>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...