RE: [xsl] Namespace problems

Subject: RE: [xsl] Namespace problems
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Tue, 21 Sep 2004 17:14:01 +0100
> I'm having some problems related to namespaces (I think).

Correct :)

> The source file for the transformation:
>
> <rdf:RDF xml:base="http://a.com/ontology";
> xmlns="http://a.com/ontology#";
  ^^^^^^^^^^^^^

Your source xml has put all elements in this namespace.

[snip]

> On the xsl I'm trying to enter the Products element but with
> no sucess...
>
> <xsl:stylesheet version="1.0" xmlns="http://a.com/ontology#";
                                   ^^^^^^^^^^
This puts the literal result elements of your stylesheet into a
namespace but won't help you with match patterns - you need to specify a
prefix here.  For example xmlns:myprefix="http://a.com/ontology#";

Then use this prefix in your match pattern:

> <xsl:template match="Products">
> 	<xsl:element name="Product_class"/>
> </xsl:template>

<xsl:template match="myprefix:Products">
                    ^^^^^^^^^^^^
Cheers
andrew

Current Thread