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

Re: XSLT for XSL-FO internal-destination

Subject: Re: XSLT for XSL-FO internal-destination
From: Robert Siebens <telehodown@xxxxxxxxx>
Date: Thu, 19 Nov 2009 18:27:58 -0800 (PST)
Re:  XSLT for XSL-FO internal-destination
David,

Thanks for clarifying that issue with the invalid URI. Also, I am using xslt
1, but it looks like I could use the translate function.

I'm not quite clear on the mechanics of getting the new id for the href into
an FO block at the beginning of each file. Here is a simplified anchor
template. Is this correct method for generating the href id?

<xsl:template match="a|A">
   <fo:inline>
      <fo:basic-link color="blue">
              <xsl:attribute name="internal-destination">
                 <xsl:value-of select="translate(@href,':/','')" />
              </xsl:attribute>
              <xsl:apply-templates />
      </fo:basic-link>
    </fo:inline>
</xsl:template>

Also, I search through a table of contents file to open each source file; so,
I thought I could try inserting the href id in <fo:block> in the page flow,
but this doesn't work:

    <!-- Page sequence for body pages -->
	<fo:page-sequence master-reference="only" format="1">
    	     <fo:static-content flow-name="footer">
                <fo:block text-align="center">
                   <fo:page-number/>
                 </fo:block>
            </fo:static-content>
              <fo:flow flow-name="xsl-region-body">

                   <fo:block id="{@href}">

        			<xsl:for-each select="//TocEntry">
        				<xsl:for-each select="document(@Link)//body">
                			  <xsl:apply-templates/>
        		        </xsl:for-each>
        		     </xsl:for-each>
                   </fo:block>
              </fo:flow>
   </fo:page-sequence>

Can you tell me where I'm going off track?

Thanks,

Rob

--- On Thu, 11/19/09, David Carlisle <davidc@xxxxxxxxx> wrote:

> From: David Carlisle <davidc@xxxxxxxxx>
> Subject: Re:  XSLT for XSL-FO internal-destination
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Date: Thursday, November 19, 2009, 8:02 PM
>
>
> >  <a href="c:/Help_Files/File_Two.htm">.
>
> not that it matters to xslt but that URI is in error.. If
> browsers
> conformed to the spec that would be a URI using an unknown
> URI
> protocol. "c". should just be href="File_Two.htm" or if you
> need
> absolute uri href="file:///c:/Help_Files/File_Two.htm"
>
> You haven't said if you are using xslt 1 or 2, string
> manipulation is
> easier in 2 but you perhaps dont need any string
> manipulation.
>
>
> > None of the help system files have the filename in the
> <TITLE> or
> > anywhere else in the file, so I'm not able to use the
> > generate-id function to create a target.
>
> not sure why the title being empty affects the use of
> generate-id().
> You could use generate-id() on the document node or the
> empty title
> element, but actually I'd advise against using genereted-id
> for link
> anchors, it makes for very unstable documents, if yu
> regenerate them
> after any sort of edit, or potentially even after no edits,
> all the
> anchors change.
>
> It depends a bit how general you want to be but your
> example would be
> a valid reference if you just wused
> translate(@href,':/','')
> which would make an id of cHelp_FilesFile_Two.htm which you
> could use in
> an fo:simple-link and in an id at the first fo:block that
> you generate
> from a document.
>
> David
>
> ________________________________________________________________________
> The Numerical Algorithms Group Ltd is a company registered
> in England
> and Wales with company number 1249803. The registered
> office is:
> Wilkinson House, Jordan Hill Road, Oxford OX2 8DR, United
> Kingdom.
>
> This e-mail has been scanned for all viruses by Star. The
> service is
> powered by MessageLabs.
> ________________________________________________________________________

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.