[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Selecting content via attribute presence.

Subject: Re: Selecting content via attribute presence.
From: George Cristian Bina <george@xxxxxxxxxxxxx>
Date: Wed, 11 Apr 2007 10:06:38 +0300
Re:  Selecting content via attribute presence.
Hi Ben,

You do not need an if. If your expression selects nothing then you will not get anything inserted. For instance

<xsl:value-of select="noSuchElementInTheDocument"/>

will not insert anything in the output if there is no such element in the file.

In this case you should consider using a key to access the information, match on the revision list items and use the revision id to select the item.

Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Ben Trafford wrote:

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.