xsl-list
[Top] [All Lists]

Unprefixed namespace and XSL

2004-11-10 02:19:47
Dear list-members,

I've problems with viewing an XML file with XSL in an Internet Explorer. I've read the XPath 2.0 and XSLT standards, and I know that if I have unprefixed namespace in an XML schema I should use xpath-default-namespace in the XSL file. Could you just explain me exactly where to put (and how) this? How could I solve the problem?

I have a version, but is doesn't work... The value of "value-of select=..." doesn't appear on the screen...

XML file (xmlns="http://mireg.org/schema/1.0/";):

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="standard_mireg.xsl"?>
<metadata
xmlns="http://mireg.org/schema/1.0/";
xmlns:dc="http://purl.org/dc/elements/1.1/";
xmlns:dcterms="http://purl.org/dc/terms/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://mireg.org/schema/1.0/
http://mireg.org/model/XSD/metadata.xsd";
about="...">
<mireg>
<dc:title>
...
</dc:title>
...
</mireg>
</metadata>

XSL file:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xpath-default-namespace="http://mireg.org/schema/1.0/";
xmlns="http://mireg.org/schema/1.0/";
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:dc="http://purl.org/dc/elements/1.1/";
xmlns:dcterms="http://purl.org/dc/terms/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://mireg.org/schema/1.0/ http://mireg.org/model/XSD/metadata.xsd";> <xsl:template match="/" xpath-default-namespace="http://mireg.org/schema/1.0/";>
<html>
<body>
<p>
Text
</p>
<table border="1">
<xsl:for-each select="metadata/mireg">
<tr>
<td>
<b>Title</b>
</td>
<td>
<xsl:value-of select="dc:title"/>
</td>
</tr>
...

Thanks in advance!

Aron

----------------------------------------------------
Aron Szabo, M. Sc.
Research Associate,
Center of Information Technology
Budapest University of Technology and Economics



<Prev in Thread] Current Thread [Next in Thread>