Subject: Re: [xsl] Find the root element from an attribute node From: "vladimir@xxxxxxxxxxxxxxxxxxxx" <vladimir@xxxxxxxxxxxxxxxxxxxx> Date: Thu, 10 Jul 2008 08:22:21 -0700 |
> > <xsl:template match="@href[ancestor::html]"> > > > > Is never going to work. I've read with bewilderment the threads about the > > xslt spec and that attributes are children of elements but elements are not > > parents of children... So, that being the case, how exactly do I find out > > where my current @href came from? > > What you've done should be fine, but its slow to walk the ancestor > axis to the root element each time, so just do: > > <xsl:variable name="isHTML" select="exists(/html)" as="xs:boolean"/> > > and then: > > match="@href[$isHTML]" This code is based on the assumption that xsl:apply-templates is called for the input tree only, and not for any other loaded or constructed. -- Vladimir Nesterovsky
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Find the root element fro, Marroc | Thread | Re: [xsl] Find the root element fro, Andrew Welch |
[xsl] OpenOffice 3.X probably will , Vyacheslav Sedov | Date | Re: [xsl] Find the root element fro, Andrew Welch |
Month |