RE: [xml-dev] XML-Linking(A small problem)
Hi,
Thanks a lot.I tried fixing the problem.It works but still there is a problem.I'm not sure how to use the generate id() function.See here is my xml doc,
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="example.xsl"?>
<Grants>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>AT - Air Tickets</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>AI - Auto Insurance</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>BS - Bachelor Of Science</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>PH - Pretty & Humble</Category_and_Discipline>
<Category>PH</Category>
<Handout_Number>-5</Handout_Number>
<Sponsor>National Institute Of Media</Sponsor>
<Program>Fellowship Program FY 2000</Program>
<Program_Number></Program_Number>
<Description>The purpose of the Fellowship is to award fellowships to eligible students of superior ability, selected on the basis of demonstrated achievement.</Description>
<url>http://www.msn.com</url>
<Deadline_Dates>Deadline:11/29/1999</Deadline_Dates>
</Grant>
</Grants>
<?xml-stylesheet type="text/xsl" href="example.xsl"?>
<Grants>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>AT - Air Tickets</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>AI - Auto Insurance</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>BS - Bachelor Of Science</Category_and_Discipline>
<Category>BS</Category>
<Handout_Number>-11</Handout_Number>
<Sponsor>National Endowment</Sponsor>
<Program>Cooperative Agreement for a Feasibility Study for Increased Private Support for the Folk and Traditional Arts</Program>
<Program_Number>PS 99-05</Program_Number>
<Description>The National Endowment for the Arts is requesting proposals leading to the award of a Cooperative Agreement to conduct a national feasibility study of the potential for increasing private funding for the folk and traditional arts.</Description>
<url>http://www.yahoo.com</url>
<Deadline_Dates>Deadline:9/30/1999</Deadline_Dates>
</Grant>
<Grant>
<Issue_Number ID="00-03"></Issue_Number>
<Category_and_Discipline>PH - Pretty & Humble</Category_and_Discipline>
<Category>PH</Category>
<Handout_Number>-5</Handout_Number>
<Sponsor>National Institute Of Media</Sponsor>
<Program>Fellowship Program FY 2000</Program>
<Program_Number></Program_Number>
<Description>The purpose of the Fellowship is to award fellowships to eligible students of superior ability, selected on the basis of demonstrated achievement.</Description>
<url>http://www.msn.com</url>
<Deadline_Dates>Deadline:11/29/1999</Deadline_Dates>
</Grant>
</Grants>
and here is the XSL,
<?xml version='1.0' encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/TR/REC-html40">
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/TR/REC-html40">
<xsl:output method ="html"/>
<xsl:template match="Grants">
<HTML>
<HEAD>
<TITLE>Grant</TITLE>
</HEAD>
<BODY>
<A NAME="TOP"/>
<h2 align="center"><font color="#800000">MSN<BR/>MSN HOME</font></h2><BR/>
<p align="left"><font color="#004080" face="Times New Roman"><a name="Sorted by Disciplines"><big>Sorted by Disciplines</big></a></font> </p>
<HTML>
<HEAD>
<TITLE>Grant</TITLE>
</HEAD>
<BODY>
<A NAME="TOP"/>
<h2 align="center"><font color="#800000">MSN<BR/>MSN HOME</font></h2><BR/>
<p align="left"><font color="#004080" face="Times New Roman"><a name="Sorted by Disciplines"><big>Sorted by Disciplines</big></a></font> </p>
<p align="left"><font face="Times New Roman">
<a href="#Category_and_Discipline"><big>AT - Air Tickets</big></a><br/>
<a href="#Category_and_Discipline"><big>AI - Auto Insurance</big></a><br/>
<a href="#Category_and_Discipline"><big>BS - Bachelor Of Science </big></a><br/>
<a href="#Category_and_Discipline"><big>PH - Pretty & Humble</big></a><br/>
<a href="#Category_and_Discipline"><big>AT - Air Tickets</big></a><br/>
<a href="#Category_and_Discipline"><big>AI - Auto Insurance</big></a><br/>
<a href="#Category_and_Discipline"><big>BS - Bachelor Of Science </big></a><br/>
<a href="#Category_and_Discipline"><big>PH - Pretty & Humble</big></a><br/>
</font> </p>
<xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Category_and_Discipline">
<P><B><center><strong><font color="#000080"><big><big><a name="Category_and_Discipline">
<xsl:value-of select="."/></a></big></big></font></strong></center></B></P>
</xsl:template>
<br/>
<xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>
<xsl:template match="Category_and_Discipline">
<P><B><center><strong><font color="#000080"><big><big><a name="Category_and_Discipline">
<xsl:value-of select="."/></a></big></big></font></strong></center></B></P>
</xsl:template>
<br/>
<xsl:template match="Grant/Category">
<B><xsl:value-of select="."/></B>
</xsl:template>
<B><xsl:value-of select="."/></B>
</xsl:template>
<xsl:template match="Grant/Handout_Number">
<B><xsl:value-of select="."/></B><br/>
</xsl:template>
<B><xsl:value-of select="."/></B><br/>
</xsl:template>
<xsl:template match="Grant/Sponsor">
<font color="#0000FF"><xsl:value-of select="."/></font><br/>
</xsl:template>
<font color="#0000FF"><xsl:value-of select="."/></font><br/>
</xsl:template>
<xsl:template match="Grant/Program">
<B><U><xsl:value-of select="."/></U></B><br/><br/>
</xsl:template>
<B><U><xsl:value-of select="."/></U></B><br/><br/>
</xsl:template>
<xsl:template match="Grant/Description">
<xsl:value-of select="."/><br/>
</xsl:template>
<xsl:value-of select="."/><br/>
</xsl:template>
<xsl:template match="Grant/url">
<I><font color="#0000FF">
<A TARGET="_blank">
<xsl:attribute name ="HREF">
<xsl:apply-templates/>
</xsl:attribute>
<xsl:apply-templates/>
</A>
</font>
</I><br/>
</xsl:template>
<I><font color="#0000FF">
<A TARGET="_blank">
<xsl:attribute name ="HREF">
<xsl:apply-templates/>
</xsl:attribute>
<xsl:apply-templates/>
</A>
</font>
</I><br/>
</xsl:template>
<xsl:template match="Grant/Deadline_Dates">
<B>
<xsl:value-of select="."/>
</B><br/><br/><hr/><p><center>[<a href="#TOP">TOP</a>]</center></p><hr/>
</xsl:template>
<B>
<xsl:value-of select="."/>
</B><br/><br/><hr/><p><center>[<a href="#TOP">TOP</a>]</center></p><hr/>
</xsl:template>
</xsl:stylesheet>
When I try to click on the AT - Air Tickets or the AI - Auto Insurance,it always take me to the first paragraph which is of AT-Air Tickets.
Can someone pls help?Thanks a lot,
Regards,