Loading ...
Sorry, an error occurred while loading the content.

RE: [XSL-FO] Finding broken links

Expand Messages
  • Nicola Harlow
    Searching the PDf for glossarytt will help you finding the problematic cases. Thanks for the suggestion, but if the XSL can t find the correct glossary
    Message 1 of 6 , Mar 14, 2005
    • 0 Attachment
      "Searching the PDf for "glossarytt" will help you finding the
      problematic
      cases."





      Thanks for the suggestion, but if the XSL can't find the correct
      glossary item it outputs nothing, just leaves a little gap, which
      doesn't help the flow of the sentance much! I can look and check them
      all individually, but we're talking about a 100 page document (now!)
      with hundreds of entries. If I can find an automatic way of doing it,
      that would help.



      I have experimented with <if> statements, but they don't do anything at
      all, and I don't know why (yes I do, I can't write XSL ;)



      Any further suggestions, anyone????? This is my hacked version that
      fails...





      <!-- / / / / / / Glossary tooltips/ / / / / / / / / / / / / / / / / /
      / / / / -->

      <!--Link directly to an existing glossary -->

      <xsl:key name="glossaryitems-by-name" match="glossaryitem"
      use="@name"/>

      <!-- -->

      <xsl:template match="glossarytt">

      <xsl:for-each select="key('glossaryitems-by-name', @name)">

      <xsl:variable name="href">

      <xsl:value-of select="@name"/>

      </xsl:variable>

      <!-- find the glossary item to match this link -->

      <xsl:variable name="name" select="//glossaryitem[.=$href]"/>

      <fo:inline text-decoration="underline" color="green"
      font-weight="bold">



      <fo:basic-link>

      <xsl:if
      test="count(//*[glossaryitem/name=$href])=0">

      <xsl:attribute name="internal-destination">
      broken</xsl:attribute>

      </xsl:if>

      <xsl:attribute name="internal-destination">

      <xsl:value-of select="$href"/>

      </xsl:attribute>

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

      </fo:basic-link>

      </fo:inline>

      </xsl:for-each>

      </xsl:template>

      <!-- -->



      Thanks :)



      Nicola

      Nicola Harlow
      Technical Author
      The Program Management Group plc
      tel: +44 (0) 1937 547 171
      direct: +44 (0) 1937 547 165
      fax: +44 (0) 1937 547 154
      mail: nicola.harlow@...
      web: http://www.pm-group.com

      ________________________________

      From: J.Pietschmann [mailto:j3322ptm@...]
      Sent: 11 March 2005 20:22
      To: XSL-FO@yahoogroups.com
      Subject: Re: [XSL-FO] Finding broken links



      Nicola Harlow wrote:
      > I'm trying to get XSL:FO to highlight missing information in my PDF
      > output.

      Try something like
      <xsl:template match="glossarytt">
      <xsl:variable name="items" select="key('glossaryitems-by-name',
      @name)"/>
      <xsl:choose>
      <xsl:when test="$items">
      <xsl:for-each select="$items">
      <xsl:variable name="href" select="@name"/>
      <fo:inline text-decoration="underline" color="green"
      font-weight="bold">
      <fo:basic-link internal-destination="{$href}">
      <xsl:value-of select="term"/>
      </fo:basic-link>
      </fo:inline>
      </xsl:for-each>
      </xsl:when>
      <xsl:otherwise>
      <fo:inline color="red">Broken glossarytt: <xsl:value-of
      select="@name"/></fo:inline>
      </xsl:otherwise>
      <xsl:choose>
      </xsl:template>

      Searching the PDf for "glossarytt" will help you finding the problematic
      cases.

      J.Pietschmann




      Yahoo! Groups Sponsor

      ADVERTISEMENT
      click here
      <http://us.ard.yahoo.com/SIG=129748alb/M=298184.6018725.7038619.3001176/
      D=groups/S=1705016061:HM/EXP=1110658934/A=2593423/R=0/SIG=11el9gslf/*htt
      p:/www.netflix.com/Default?mqso=60190075>


      <http://us.adserver.yahoo.com/l?M=298184.6018725.7038619.3001176/D=group
      s/S=:HM/A=2593423/rand=130726529>



      ________________________________

      Yahoo! Groups Links

      * To visit your group on the web, go to:
      http://groups.yahoo.com/group/XSL-FO/

      * To unsubscribe from this group, send an email to:
      XSL-FO-unsubscribe@yahoogroups.com
      <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

      * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
      Service <http://docs.yahoo.com/info/terms/> .



      [Non-text portions of this message have been removed]
    • J.Pietschmann
      ... Did you try the code I provided in my message? ... Get a good book about XSLT, read the XSLT FAQ, and join the XSL list
      Message 2 of 6 , Mar 22, 2005
      • 0 Attachment
        Nicola Harlow wrote:
        > Thanks for the suggestion, but if the XSL can't find the correct
        > glossary item it outputs nothing, just leaves a little gap, which
        > doesn't help the flow of the sentance much! I can look and check them
        > all individually, but we're talking about a 100 page document (now!)
        > with hundreds of entries. If I can find an automatic way of doing it,
        > that would help.
        >

        Did you try the code I provided in my message?

        >
        > I have experimented with <if> statements, but they don't do anything at
        > all, and I don't know why (yes I do, I can't write XSL ;)

        Get a good book about XSLT, read the XSLT FAQ, and join the XSL list
        http://www.mulberrytech.com/xsl/xsl-list/

        J.Pietschmann
      • Nicola Harlow
        HI, Apologies, I didn t notice you d given me a code sample. I will try it when I get a chance to :) I have got several XSLT books, and am a member of several
        Message 3 of 6 , Mar 24, 2005
        • 0 Attachment
          HI,



          Apologies, I didn't notice you'd given me a code sample. I will try it
          when I get a chance to :)



          I have got several XSLT books, and am a member of several lists, but
          unfortunately I do not have a development background which makes it
          harder to know the questions to ask, let alone what to do! My experience
          is in basic HTML, so is a tad inadequate for the full job of XML :)



          Thanks for your help,



          Nicola



          Nicola Harlow
          Technical Author
          The Program Management Group plc
          tel: +44 (0) 1937 547 171
          direct: +44 (0) 1937 547 165
          fax: +44 (0) 1937 547 154
          mail: nicola.harlow@...
          web: http://www.pm-group.com

          ________________________________

          From: J.Pietschmann [mailto:j3322ptm@...]
          Sent: 22 March 2005 19:14
          To: XSL-FO@yahoogroups.com
          Subject: Re: [XSL-FO] Finding broken links



          Nicola Harlow wrote:
          > Thanks for the suggestion, but if the XSL can't find the correct
          > glossary item it outputs nothing, just leaves a little gap, which
          > doesn't help the flow of the sentance much! I can look and check them
          > all individually, but we're talking about a 100 page document (now!)
          > with hundreds of entries. If I can find an automatic way of doing it,
          > that would help.
          >

          Did you try the code I provided in my message?

          >
          > I have experimented with <if> statements, but they don't do anything
          at
          > all, and I don't know why (yes I do, I can't write XSL ;)

          Get a good book about XSLT, read the XSLT FAQ, and join the XSL list
          http://www.mulberrytech.com/xsl/xsl-list/

          J.Pietschmann




          Yahoo! Groups Sponsor

          ADVERTISEMENT
          click here
          <http://us.ard.yahoo.com/SIG=129t18h5t/M=298184.6191685.7192823.3001176/
          D=groups/S=1705016061:HM/EXP=1111605253/A=2593423/R=0/SIG=11el9gslf/*htt
          p:/www.netflix.com/Default?mqso=60190075>


          <http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=group
          s/S=:HM/A=2593423/rand=438468645>



          ________________________________

          Yahoo! Groups Links

          * To visit your group on the web, go to:
          http://groups.yahoo.com/group/XSL-FO/

          * To unsubscribe from this group, send an email to:
          XSL-FO-unsubscribe@yahoogroups.com
          <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

          * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
          Service <http://docs.yahoo.com/info/terms/> .



          [Non-text portions of this message have been removed]
        • Nicola Harlow
          Hi again, Just tried the code and it worked a treat, thank you! I tweaked it a tad so that it now creates a broken link this means that I am now alerted to
          Message 4 of 6 , Mar 24, 2005
          • 0 Attachment
            Hi again,



            Just tried the code and it worked a treat, thank you!



            I tweaked it a tad so that it now creates a broken 'link' this means
            that I am now alerted to any broken glossary items when I create a PDF.
            This will be a huge timesaver for me, and gives me a template for
            further development!



            And I swear from now on to read replies a bit more carefully :)



            <xsl:template match="glossarytt">

            <xsl:variable name="items" select="key('glossaryitems-by-name',

            @name)"/>



            <xsl:choose>

            <xsl:when test="$items">

            <xsl:for-each select="$items">

            <xsl:variable name="href" select="@name"/>

            <fo:inline text-decoration="underline"
            color="green"

            font-weight="bold">

            <fo:basic-link
            internal-destination="{$href}">

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

            </fo:basic-link>

            </fo:inline>

            </xsl:for-each>

            </xsl:when>

            <xsl:otherwise><fo:basic-link
            internal-destination="BrokenGlossaryTT">

            <fo:inline color="red">Broken glossarytt:
            <xsl:value-of

            select="@name"/></fo:inline></fo:basic-link>

            </xsl:otherwise>

            </xsl:choose>

            </xsl:template>



            Thanks again,



            Nicola

            Nicola Harlow
            Technical Author
            The Program Management Group plc
            tel: +44 (0) 1937 547 171
            direct: +44 (0) 1937 547 165
            fax: +44 (0) 1937 547 154
            mail: nicola.harlow@...
            web: http://www.pm-group.com


            ________________________________

            From: J.Pietschmann [mailto:j3322ptm@...]
            Sent: 22 March 2005 19:14
            To: XSL-FO@yahoogroups.com
            Subject: Re: [XSL-FO] Finding broken links



            Nicola Harlow wrote:
            > Thanks for the suggestion, but if the XSL can't find the correct
            > glossary item it outputs nothing, just leaves a little gap, which
            > doesn't help the flow of the sentance much! I can look and check them
            > all individually, but we're talking about a 100 page document (now!)
            > with hundreds of entries. If I can find an automatic way of doing it,
            > that would help.
            >

            Did you try the code I provided in my message?

            >
            > I have experimented with <if> statements, but they don't do anything
            at
            > all, and I don't know why (yes I do, I can't write XSL ;)

            Get a good book about XSLT, read the XSLT FAQ, and join the XSL list
            http://www.mulberrytech.com/xsl/xsl-list/

            J.Pietschmann




            Yahoo! Groups Sponsor

            ADVERTISEMENT
            click here
            <http://us.ard.yahoo.com/SIG=129t18h5t/M=298184.6191685.7192823.3001176/
            D=groups/S=1705016061:HM/EXP=1111605253/A=2593423/R=0/SIG=11el9gslf/*htt
            p:/www.netflix.com/Default?mqso=60190075>


            <http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=group
            s/S=:HM/A=2593423/rand=438468645>



            ________________________________

            Yahoo! Groups Links

            * To visit your group on the web, go to:
            http://groups.yahoo.com/group/XSL-FO/

            * To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@yahoogroups.com
            <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

            * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            Service <http://docs.yahoo.com/info/terms/> .



            [Non-text portions of this message have been removed]





            Yahoo! Groups Sponsor

            ADVERTISEMENT
            click here
            <http://us.ard.yahoo.com/SIG=129lsb70e/M=298184.6191685.7192823.3001176/
            D=groups/S=1705016061:HM/EXP=1111745788/A=2593423/R=0/SIG=11el9gslf/*htt
            p:/www.netflix.com/Default?mqso=60190075>


            <http://us.adserver.yahoo.com/l?M=298184.6191685.7192823.3001176/D=group
            s/S=:HM/A=2593423/rand=942774766>



            ________________________________

            Yahoo! Groups Links

            * To visit your group on the web, go to:
            http://groups.yahoo.com/group/XSL-FO/

            * To unsubscribe from this group, send an email to:
            XSL-FO-unsubscribe@yahoogroups.com
            <mailto:XSL-FO-unsubscribe@yahoogroups.com?subject=Unsubscribe>

            * Your use of Yahoo! Groups is subject to the Yahoo! Terms of
            Service <http://docs.yahoo.com/info/terms/> .



            [Non-text portions of this message have been removed]
          Your message has been successfully submitted and would be delivered to recipients shortly.