DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: XML with embedded <A HREF> tags

  1. #1
    Greg Rothlander Guest

    XML with embedded <A HREF> tags



    I'm new to XML and I have an XSL document that I am using to build a table.
    In this table I read through the elements to build a Zip Code listing.
    Something like:

    Zip City
    12345 The City Name
    12345 The City Name
    12345 The City Name
    12345 The City Name
    12345 The City Name

    I have a third column that only has the word "Select" and it's a link to
    another page. Inside the <A HREF=""> tag I need to add the zip code as a
    query string so the next page will be passed the select zip code from the
    current page. I am not having much luck doing so... so I'm asking for help.

    Here is a sample of the method I'm using to build the table. How can I add
    the value of the zip code field to the <A Href>?

    Any help would be very much appreciated.

    Thanks,
    Greg Rothlander

    <!-- Detail Records -->
    <table>

  2. #2
    Greg Rothlander Guest

    Re: XML with embedded <A HREF> tags


    For some reason my posting are being cut in half. Here is the sample code.
    Sorry for the annoyance!

    <!-- Records -->
    <xsl:for-each select="./" order-by="./*[0]">
    <tr class="detail">
    <xsl:for-each select="./*">
    <td>&#160;<xsl:value-of/></td>
    </xsl:for-each>
    <td><A Href="Testing?var">Select</A></td>
    </tr>
    </xsl:for-each>

  3. #3
    Russell Jones Guest

    Re: XML with embedded <A HREF> tags

    It's unclear exactly what you're trying to do, since you don't list the XML
    itself, but maybe this will help. Use the <xsl:attribute> command to build
    the href attribute value. The command requires a name attribute. Place the
    value between the start and end <xsl:attribute> tags.

    <A>
    <xsl:attribute name="href">
    Testing?var=<xsl:value-of select="Zip">
    </xsl:attribute>
    Select
    </A>
    "Greg Rothlander" <grothlander@austin400.com> wrote in message
    news:3b1bb87d$1@news.devx.com...
    >
    > For some reason my posting are being cut in half. Here is the sample

    code.
    > Sorry for the annoyance!
    >
    > <!-- Records -->
    > <xsl:for-each select="./" order-by="./*[0]">
    > <tr class="detail">
    > <xsl:for-each select="./*">
    > <td>&#160;<xsl:value-of/></td>
    > </xsl:for-each>
    > <td><A Href="Testing?var">Select</A></td>
    > </tr>
    > </xsl:for-each>




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center