Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Xlink to html link conversion

Status
Not open for further replies.

kyru

Programmer
Jan 17, 2009
45
ES
¿How can this process be done? I believe the following code should work nicely:

XML document

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ecosistemas SYSTEM "C:Documents and SettingsUsuarioEscritorioPruebas XMLsimplexlink.dtd">
<?xml-stylesheet href="simplelink.xsl" type="text/xsl"?>
<ecosistemas
xmlns:xlink="xlink:type="simple"
xlink:show ="new"
xlink:actuate ="user"
xlink:role="ecosistema panel"
xlink:title="Panel de ecosistemas del Parque"
xlink:href="./Ecosistema1.xml" >
Ecosistema Mediterráneo
</ecosistemas>

XSL document

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl=" xmlns:fo=" xmlns:xs=" xmlns:fn="
<xsl:template match="/">
<html>
<body>
<a> <xsl:value-of select="ecosistemas"/> </a>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

Shouldn't it show a document with an hyperlink that when clicked would open Ecosistema1.xml? Why does it just show "Ecosistema mediterraneo" as simple text?

Thanks in advance.
 
><a> <xsl:value-of select="ecosistemas"/> </a>
[tt]<a [red]href="{xlink:href}" xmlns:xlink="[ignore][/ignore][/red]> <xsl:value-of select="ecosistemas"/> </a>[/tt]
 
It's not completely correct. The code that works fine for me is the following one:

XML file:

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="simplelink.xsl"?>


<ecosistemas xmlns:xlink=' xlink:href="./ecosistema1.xml"
xlink:title="Ecosistema mediterráneo"
xlink:type="simple"
xlink:show ="new"
xlink:actuate ="user">

</ecosistemas>

XSL file:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=" xmlns:xlink=' exclude-result-prefixes='xlink'
>

<xsl:template match="ecosistemas">
<!-- shortest way -->
<a href="{@xlink:href}">
<xsl:value-of select='@xlink:title' />
</a>

</xsl:template>
</xsl:stylesheet>

You helped me a lot anyway. Thanks.
 
>It's not completely correct.
So you say... but you have a strange sense of correctness.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top