xsl-list
[Top] [All Lists]

RE: [xsl] Selecting content via attribute presence.

2007-04-11 00:01:47
In XSLT 2.0 you can do something like

<xsl:template match="*[(_at_)IDREF]" priority="100">
  .... process the IDREF ....
  <xsl:next-match/>
</xsl:template> 

In 1.0 you can use xsl:apply-imports in the same way, except that the above
template rule must then be in an importing module.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Ben Trafford [mailto:ben(_at_)prodigal(_dot_)ca] 
Sent: 11 April 2007 06:53
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Selecting content via attribute presence.


      Hi!

      I've got a document that has a RevisionID IDREF implied 
on every element. It may or may not be present. -If- it's 
present, it has a corresponding ID on an item in a 
RevisionList at the end of the document.

      What I want my stylesheet to do is check for the 
existence of the RevisionID on each element, and if it finds 
it, insert the value of the element content with the 
corresponding ID found at the end of the document. And I know 
I could do this with an xsl:if statement on every element, 
but there's got to be a better way to do it.

      Advice would be appreciated!

      (And yes, for those who are curious, I'm trying to 
basically enable change-tracking via stylesheets. It's pretty cool!)

--->Ben

      


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>