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

Re: [XSL-FO] xsl newbie question..

Expand Messages
  • G. Ken Holman
    ... Two ways: Using the attribute instruction: index.cfm?reportId=
    Message 1 of 8 , Nov 4, 2002
    • 0 Attachment
      At 2002-11-04 21:43 -0500, Tony Weeg wrote:
      ><xsl:attribute name="value"><xsl:value-of select="id" /></xsl:attribute>
      >
      >if i have this in my code, and i wanted to take the value that
      ><xsl:value-of select="id" /> parses to, how would i make that
      >part of a dynamically assigned url string such as this...
      >
      ><a href="index.cfm?reportId=<xsl:value-of select="id" />">Go back to the
      >Report</a>
      >or something like that....

      Two ways:

      Using the attribute instruction:

      <a>
      <xsl:attribute name="href">
      <xsl:text>index.cfm?reportId=</xsl:text>
      <xsl:value-of select="id"/>
      </xsl:attribute>
      <xsl:text>Go back to the Report</xsl:text>
      </a>

      Using an attribute value template:

      <a href="index.cfm?reportId={id}">Go back to the Report</a>

      The use of braces in a result element's attribute is an attribute value
      template and is an expression for "value-of".

      I hope this helps.

      ................... Ken


      --
      Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO:
      - North America: Feb 3 - Feb 7,2002

      G. Ken Holman mailto:gkholman@...
      Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
      Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
      ISBN 0-13-065196-6 Definitive XSLT and XPath
      ISBN 0-13-140374-5 Definitive XSL-FO
      ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
      ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
      Next public training: 2002-12-08,2003-02-03,06,03-03,06
    • Tony Weeg
      thanks KEN! that worked like a charm....where can i get info like this, is there a good site? also, while im at it, and you are 1 for 1, ill try another
      Message 2 of 8 , Nov 4, 2002
      • 0 Attachment
        thanks KEN!

        that worked like a charm....where can i get info like
        this, is there a good site?

        also, while im at it, and you are 1 for 1, ill try another
        question, fer ya....can i parse cookie held variables
        in and xsl/xml page...

        for instance, if i had a cookie variable called, TTT, and i wanted
        that to show up in a url, could i call that cookie variable in xsl
        and have it dynamically become part of the same url?

        thanks.
        tw

        -----Original Message-----
        From: G. Ken Holman [mailto:gkholman@...]
        Sent: Monday, November 04, 2002 10:05 PM
        To: XSL-FO@yahoogroups.com
        Subject: Re: [XSL-FO] xsl newbie question..


        At 2002-11-04 21:43 -0500, Tony Weeg wrote:
        ><xsl:attribute name="value"><xsl:value-of select="id"
        /></xsl:attribute>
        >
        >if i have this in my code, and i wanted to take the value that
        ><xsl:value-of select="id" /> parses to, how would i make that
        >part of a dynamically assigned url string such as this...
        >
        ><a href="index.cfm?reportId=<xsl:value-of select="id" />">Go back to
        the
        >Report</a>
        >or something like that....

        Two ways:

        Using the attribute instruction:

        <a>
        <xsl:attribute name="href">
        <xsl:text>index.cfm?reportId=</xsl:text>
        <xsl:value-of select="id"/>
        </xsl:attribute>
        <xsl:text>Go back to the Report</xsl:text>
        </a>

        Using an attribute value template:

        <a href="index.cfm?reportId={id}">Go back to the Report</a>

        The use of braces in a result element's attribute is an attribute value
        template and is an expression for "value-of".

        I hope this helps.

        ................... Ken


        --
        Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO:
        - North America: Feb 3 - Feb 7,2002

        G. Ken Holman mailto:gkholman@...
        Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
        Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
        ISBN 0-13-065196-6 Definitive XSLT and XPath
        ISBN 0-13-140374-5 Definitive XSL-FO
        ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
        ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
        Next public training: 2002-12-08,2003-02-03,06,03-03,06


        To unsubscribe from this group, send an email to:
        XSL-FO-unsubscribe@egroups.com



        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]
      • G. Ken Holman
        ... There is an *excellent* FAQ at: http://www.dpawson.co.uk Also, we sell from our web site an extensively hyperlinked electronic book on XSL-FO that we
        Message 3 of 8 , Nov 5, 2002
        • 0 Attachment
          At 2002-11-04 22:31 -0500, Tony Weeg wrote:
          >that worked like a charm....where can i get info like
          >this, is there a good site?

          There is an *excellent* FAQ at:

          http://www.dpawson.co.uk

          Also, we sell from our web site an extensively hyperlinked electronic book
          on XSL-FO that we author in XML and produce using XSL-FO (if you buy any
          edition you have access to all future editions at no charge). Prentice
          Hall is releasing a paper rendition in February, and it is also produced
          using XSL-FO, as was true for the paper rendition of our XSLT/XPath book.

          Yet another option is we also offer public hands-on courses in North
          America (you travel) and deliver on-site training anywhere in the world (I
          travel) http://www.CraneSoftwrights.com/f/ as do many other companies
          (check out both Mulberry Technologies http://www.MulberryTech.com and
          ISOGEN International http://www.ISOGEN.com as they have quality materials
          and quality instructors ... the three of our companies have long histories
          in SGML that we have taken to XML ... you have lots of choices available to
          you).

          Our materials are licensed by companies around the world, so you may find
          there is someone close to you who is already teaching these technologies
          using our material.

          >can i parse cookie held variables
          >in and xsl/xml page...

          I'm not too sure what you mean by the use of the verb "to parse" in the
          above statement. If you have the cookie value somewhere in your XML source
          instance, you can use the XPath address of that value in an attribute value
          template as before. The XML processor in your XSLT processor has been used
          once to produce the XPath tree that your stylesheet addresses in the act of
          creating the result tree.

          >for instance, if i had a cookie variable called, TTT, and i wanted
          >that to show up in a url, could i call that cookie variable in xsl
          >and have it dynamically become part of the same url?

          <a href="index.cfm?reportId={$TTT}">Go back to the Report</a>

          Variables are referenced using $name notation ... but be aware that in any
          given scope variables do not vary. It may take some planning ahead for you
          to have the required value in your variable at the time you need it.

          Don't, however, be mistaken as many programmers approaching XSLT are that
          the value has to be in a variable before you can use it ... if the value
          you need can be obtained by an XPath address, you can just address
          it. XPath, like the DOM, gives access to the entire XML source instance at
          all times during the transformation process.

          I hope this helps.

          ............ Ken


          --
          Upcoming hands-on in-depth XSLT/XPath and/or XSL-FO:
          - North America: Feb 3 - Feb 7,2003

          G. Ken Holman mailto:gkholman@...
          Crane Softwrights Ltd. http://www.CraneSoftwrights.com/f/
          Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995)
          ISBN 0-13-065196-6 Definitive XSLT and XPath
          ISBN 0-13-140374-5 Definitive XSL-FO
          ISBN 1-894049-08-X Practical Transformation Using XSLT and XPath
          ISBN 1-894049-10-1 Practical Formatting Using XSL-FO
          Next public training: 2002-12-08,2003-02-03,06,03-03,06
        Your message has been successfully submitted and would be delivered to recipients shortly.