[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Spam: Detecting missing link destinations
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)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|