[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
XML namespaces and XSLT
- From: Kris Vloeberghs <kris.vloeberghs@elias.be>
- To: xml-dev@lists.xml.org
- Date: Mon, 30 Apr 2001 12:15:29 +0200
Hi,
I've got an XML file here wich makes use of two different namespaces. This
file has to be parsed by XSLT, but there seems to be a problem.
example 1:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html><head><title>OAI</title></head>
<body><table width="80%" align="left" cellspacing="0" cellpadding="1"
border="1">
<xsl:for-each select="GetRecord/record/metadata/dc">
This works perfectly when I remove all namespace declarations from my source
XML doc.
example 2: ==> the differences are in 'template match' and 'for-each'
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="GetRecord/record/metadata">
<html><head><title>Open Archive Initiative</title></head>
<body><table width="80%" align="left" cellspacing="0" cellpadding="1"
border="1">
<xsl:for-each select="dc">
This version works with the original XML-doc, but all the HTML tags included
in my XSLT-file seem to be ignored. So, no tables are generated. All the
data coming from the XML-doc are presented as one line.
Thanks,
kris