Namespaces when using XLST



I've been searching on this form to an answer of my question but haven't found any results. The problem is that I should be using a namespace to convert the XML below using XSLT. When adding the namespace to the XSLT, the convertion doesn't work.


XML file:



<?xml version="1.0"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR"
xmlns:ted="http://ift.tt/1iUy7pQ"
xmlns:rdf="http://ift.tt/oZyhLL"
xmlns:rdfs="http://ift.tt/177k8UL"
exclude-result-prefixes="xsl">


<xsl:template match="/">
<rdf:RDF>
<xsl:value-of select="//@EDITION"/>
</rdf:RDF>
test
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/ted:TECHNICAL_SECTION">
Technical Section
</xsl:template>


XLST file:



<xsl:stylesheet version="1.0" xmlns:xsl="http://ift.tt/tCZ8VR"
xmlns:ted="http://ift.tt/1iUy7pQ"
xmlns:rdf="http://ift.tt/oZyhLL"
xmlns:rdfs="http://ift.tt/177k8UL"
exclude-result-prefixes="xsl">


<xsl:template match="/">
<rdf:RDF>
<xsl:value-of select="//@EDITION"/>
</rdf:RDF>
test
<xsl:apply-templates/>
</xsl:template>

<xsl:template match="/ted:TECHNICAL_SECTION">
Technical Section
</xsl:template>


Note that I simplified this XSLT tool in order to focus on the namespace problem.


When removing the namespace from both the XML and the XSLT, the conversion works. Does any of you have a clue of what I'm doing wrong?


Thanks for helping out!


No comments:

Post a Comment