xsl-list
[Top] [All Lists]

[xsl] RE: XSL-FL Basic-link results in wrong Adobe Acrobat link action specified

2011-09-27 08:24:42
I am trying to dynamically create active hyperlinks in PDF output using XSL-FO. 
The code I am using traverses the Release_Notes_Documentation node, which then 
calls the hyperlink template that specifies instructions for finding a string 
beginning w/ http:// and turning that string into a basic link. Everything 
looks great in the PDF output as the links display as active. 

Unfortunately, only the 1st occurrence of an active link works correctly. 
Launches the browser to display the Web page associated w/ the url. All of the 
other active links (contain different but valid urls) do not launch a browser 
as the action specified when viewing the link properties in Adobe Acrobat for 
the other links is to "go to a page in another document" and "file" prefixes 
the url. On the 1 active link that does work correctly, the action specified in 
Adobe Acrobat is "open a web link".

How do I ensure that all of the active links uses the "open a web link" action?


XSL-FO Code Snippet:
--------------------
            <xsl:template match="Release_Notes_Documentation">
                        <fo:table-cell xsl:use-attribute-sets="TableCell">
                                    <fo:block 
xsl:use-attribute-sets="HyphenateUseZeroWidthSpace">
                                                <xsl:choose>
                                                            <xsl:when 
test="following-sibling::Alternate_Internal_RN_Wording/text()">
                                                                        
<xsl:analyze-string select="following-sibling::Alternate_Internal_RN_Wording" 
regex="Before:|Enhancement:|Informational:|Note:|Now:">
                                                                                
    <xsl:matching-substring>
                                                                                
                <fo:inline xsl:use-attribute-sets="TextBold">
                                                                                
                            <xsl:value-of select="."/>
                                                                                
                </fo:inline>
                                                                                
    </xsl:matching-substring>
                                                                                
    <xsl:non-matching-substring>
                                                                                
                <xsl:call-template name="hyperlink"/>
                                                                                
    </xsl:non-matching-substring>
                                                                        
</xsl:analyze-string>
                                                            </xsl:when>
                                                            <xsl:otherwise>
                                                                        
<xsl:analyze-string select="." 
regex="Before:|Enhancement:|Informational:|Note:|Now:">
                                                                                
    <xsl:matching-substring>
                                                                                
                <fo:inline xsl:use-attribute-sets="TextBold">
                                                                                
                            <xsl:value-of select="."/>
                                                                                
                </fo:inline>
                                                                                
    </xsl:matching-substring>
                                                                                
    <xsl:non-matching-substring>
                                                                                
                <xsl:call-template name="hyperlink"/>
                                                                                
    </xsl:non-matching-substring>
                                                                        
</xsl:analyze-string>
                                                            </xsl:otherwise>
                                                </xsl:choose>
                                    </fo:block>
                        </fo:table-cell>
            </xsl:template>

<xsl:template name="hyperlink">
                        <xsl:param name="string" select="string(.)"/>
                        <xsl:analyze-string select="$string" regex="http://[^ 
]+">
                                    <xsl:matching-substring>
                                                <fo:block>
                                                            <fo:basic-link 
xsl:use-attribute-sets="Hyperlink">
                                                                        
<xsl:attribute name="external-destination"><xsl:value-of 
select="."/></xsl:attribute><xsl:value-of select="."/>
                                                            </fo:basic-link>
                                                </fo:block>
                                    </xsl:matching-substring>
                                    <xsl:non-matching-substring>
                                                <xsl:value-of select="."/>
                                    </xsl:non-matching-substring>
                        </xsl:analyze-string>
            </xsl:template>

XML Code Snippet:
-----------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Root 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
            <Row>
                        <Key>ULTI-55437</Key>
                        <Functional_Area>Human Resources</Functional_Area>
                        <Category>Add Employee Process</Category>
                        <Resolved_Known_Issue>Yes</Resolved_Known_Issue>
                        <Release_Notes_Documentation>Before: System 
administrators were able to assign more than one regular pay earnings plan to 
an earnings group (System Admin &gt; Business Rules &gt; Earning Groups), which 
caused issues when running Payroll. Now: System administrators can assign only 
one regular pay earnings plan to an earnings 
group.</Release_Notes_Documentation>
                        <Alternate_Internal_RN_Wording>This is for Internal 
audiences only. Note: Test of bolding of specific 
text.</Alternate_Internal_RN_Wording>
                        <Platform>UltiPro .NET portal</Platform>
                        <Affects_GUI>Yes</Affects_GUI>
                        <Region>US only</Region>
                        <Customer_Type>Enterprise Hosted-Dedicated, Enterprise 
Hosted-Shared, Enterprise On Premise, Internal Only - Workplace</Customer_Type>
            </Row>
            <Row>
                        <Key>ULTI-55436</Key>
                        <Functional_Area>Human Resources</Functional_Area>
                        <Category>Business Processes</Category>
                        <Release_Notes_Documentation>Enhancement: Business 
process names are now translated based on the selected language preference. For 
more information, 
http://documentation.ultimatesoftware.com/onlineguides/RNsRelatedFiles/RN1052R2/HR_page_names.pdf.</Release_Notes_Documentation>
                        <Platform>UltiPro .NET portal</Platform>
                        <Affects_GUI>Yes</Affects_GUI>
                        <Region>All Regions</Region>
                        <Customer_Type>Enterprise Hosted-Dedicated, Enterprise 
Hosted-Shared, Enterprise On Premise, Workplace</Customer_Type>
            </Row>

Thanks for your help!
_______________________________
Sharon



--~------------------------------------------------------------------
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>