Jump to content

xlink and xsl not working


kifmonkey

Recommended Posts

Hi everyone...I'm having trouble with using xlink and formating it with xsl. The problem is that when I attach a xsl file to the xml doc it formats correctly but ignores the xlink, however if I attach a blank xsl link file it displays the link but isn't formated.Any help would be much appreciated.Thanks in advance :) Rob***********below is the xml code********<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="introsXSL.xsl"?> // xlink doesn't work<?xml-stylesheet type="text/xsl" ?> // xlink works<blogs xmlns:xlink="http://www.w3.org/1999/xlink"><blog><title>test blog title</title><date>12/12/08</date><by>Rob Cush</by><intro>Quo vividendam aucestiam hae, culiceri poporum nons ad rem in aus, opoptius es Cast prario, orit fatilia sunt dero et fue nondepse essa iampoti liendenicio ina, mordit? Milis, C. me etimis, fue ciacere, int? Nos anum opublicatiam sedo, prarte diist pracive ribunumus? An tercepercere fuius fex sulla L. </intro><readMore xlink:type="simple" xlink:href="blog1.xml">read more</readMore></blog></blogs>***********below is the 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> <table width="500"> <xsl:for-each select="blogs/blog"> <tr> <td align="center"><xsl:value-of select="title"/></td> </tr> <tr> <td align="center"><xsl:value-of select="by"/></td> </tr> <tr> <td><xsl:value-of select="date"/></td> </tr> <tr> <td><xsl:value-of select="intro"/></td> </tr> <tr> <td><xsl:value-of select="readMore"/></td> </tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet>

Link to comment
Share on other sites

Hi everyone...I'm having trouble with using xlink and formating it with xsl. The problem is that when I attach a xsl file to the xml doc it formats correctly but ignores the xlink, however if I attach a blank xsl link file it displays the link but isn't formated.Any help would be much appreciated.Thanks in advance :) Rob***********below is the xml code********<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="introsXSL.xsl"?> // xlink doesn't work<?xml-stylesheet type="text/xsl" ?> // xlink works<blogs xmlns:xlink="http://www.w3.org/1999/xlink"><blog><title>test blog title</title><date>12/12/08</date><by>Rob Cush</by><intro>Quo vividendam aucestiam hae, culiceri poporum nons ad rem in aus, opoptius es Cast prario, orit fatilia sunt dero et fue nondepse essa iampoti liendenicio ina, mordit? Milis, C. me etimis, fue ciacere, int? Nos anum opublicatiam sedo, prarte diist pracive ribunumus? An tercepercere fuius fex sulla L. </intro><readMore xlink:type="simple" xlink:href="blog1.xml">read more</readMore></blog></blogs>***********below is the 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> <table width="500"> <xsl:for-each select="blogs/blog"> <tr> <td align="center"><xsl:value-of select="title"/></td> </tr> <tr> <td align="center"><xsl:value-of select="by"/></td> </tr> <tr> <td><xsl:value-of select="date"/></td> </tr> <tr> <td><xsl:value-of select="intro"/></td> </tr> <tr> <td><xsl:value-of select="readMore"/></td> </tr> </xsl:for-each> </table> </body> </html></xsl:template></xsl:stylesheet>
:) Just thought I should update all the readers of my post as I have found a work around. Although it may not be the best way to resolve the issue it works for me.Instead of using an xsl file to format and display my xml, I chose the more simple option of using CSS - and guess what it the xlink works fine.For more information on this view the w3 tutorial section on XML with CSS.......http://w3schools.com/xml/xml_display.aspHope this helps! Now back to coding :)
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...