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

Re: Spam: Detecting missing link destinations

Subject: Re: Spam: Detecting missing link destinations
From: JBryant@xxxxxxxxx
Date: Fri, 13 May 2005 10:05:18 -0500
fop link
Hi, Peter,

What FO processor are you using? FOP gives me errors when I manage to 
create internal-destination="" from my XSLT.

Short of changing processors, you could try checking the value of the xref 
before you use it, thus:

<xsl:variable name="xref" select="whatever-you-use-for-an-xref-value"/>

<xsl:choose>
  <xsl:when test="string-length($xref) = 0">
    <xsl:message>Ruh Roh! Empty internal destination!</xsl:message>
  </xsl:when>
  <xsl:otherwise>
    <fo:basic-link internal-destination="$xref"/>
  </xsl:otherwise>
</xsl:choose>

Of course, you can add identifying values to the message. For example, if 
there's always an element named heading with a title attribute somewhere 
above the point where you have inserted a cross-reference, you could add 
<xsl:value-of select="ancestor::heading/@title"/> and get the name of the 
nearest heading in the message. (You may need to add a predicate if you 
have heading elements within heading elements. In that case [1] gets the 
nearest one.) If you do have that kind of structure, the message 
instruction could look like this:

    <xsl:message>Ruh Roh! Empty internal destination below <xsl:value-of 
select="ancestor::heading/@title"/>!</xsl:message>

HTH

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)

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.