Results 1 to 3 of 3

Thread: How do i reference my xsl file from xml ?

  1. #1

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    How do i reference my xsl file from xml ?

    Have seen this done but can't anything on it.

    I have both xml and xsl files created only need to add a reference to the xsl file ?

  2. #2

    Thread Starter
    Frenzied Member Jmacp's Avatar
    Join Date
    Jul 2003
    Location
    UK
    Posts
    1,959

    Re: How do i reference my xsl file from xml ?

    got that one.

    If my xml is,

    Code:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <?xml-stylesheet type="text/xsl" href="XXsl.xsl"?>
    <START>
       <HEAD>
         <ID>etc</ID>
         <Time-Date>etc</Time-Date>
         <Ref>etc</Ref>
       </HEAD>
    </START>
    and my xsl,

    Code:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
      <html>
      <body>
        <h2>Test</h2> 
    
        <table border="1">
    
          <tr bgcolor="#9acd32">
            <th align="left">ID</th> 
            <th align="left">Time-Date</th> 
            <th align="left">Ref</th>
          </tr>
    
    
          <xsl:for-each select="START/HEAD">
    
          <tr>
            <td><xsl:value-of select="ID" /></td>
            <td><xsl:value-of select="Time-Date" /></td>
            <td><xsl:value-of select="Ref" /></td>
          </tr>
    
          </xsl:for-each>
    
      </table>
      </body>
      </html>
    
    </xsl:template></xsl:stylesheet>
    I want to make both the ID and Ref sections clickable (linkable) any idea how i do this, i know i have to change the xsl side of things?

  3. #3
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: How do i reference my xsl file from xml ?

    At a guess:
    Code:
    <td><a href="#"><xsl:value-of select="ID" /></a></td>
    And replace the # with the URL. How you get the URL is up to you, maybe another node in the XML source is required.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width