[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Namespaces and XSD

Subject: Re: [xsl] Namespaces and XSD
From: "Liam R E Quin liam@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 19 Dec 2014 07:37:36 -0000

On Thu, 18 Dec 2014 20:53:12 -0000
"Craig Sampson craig.sampson@xxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

>   I finally removed the namespace from the root element so it's not output anymore. Now I have no extraneous namespaces in my output. But, how will the output XML file know which schema defines it?

Use xsi:schemaLocation - the namespace URI is *not* the location of a schema; it's just a name, to say who defined the format.

> [...]
> Here's the title template so you can see I am doing nothing to output a namespace:
> <xsl:template match="title[parent::refDictEntry]">
>   <title>

You are creating a title element in the default namespace of your XSLT document. This is probably no namespace, so you are creating a title element that's not in any namespace.

You need either to use <foo:title>, where foo is bound to the namespace URI you want to use, or put xmlns="your URI here" on the xsl:stylesheet element.


Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/

Current Thread