Re: [xsl] Namespace prefixes in Schemas

Subject: Re: [xsl] Namespace prefixes in Schemas
From: Emmanouil Batsis <Emmanouil.Batsis@xxxxxxxxxxx>
Date: Tue, 12 Sep 2006 12:46:26 +0300
Just spotted this; i assume you have figured it out by now so i just want to reply for future ref.

Antsnio Mota wrote:

var nodes = xmlSchema.selectNodes("//xs:element");

after declaring

Sarissa.setXpathNamespaces(xmlSchema,
'xmlns:xs="http://www.w3.org/2001/XMLSchema";');


If you check the docs, you'll see setXpathNamespaces should only be used for binding a URI to the default namespace (there is no other way to do it AFAIK). You should be following the howto from [1] instead:

xmlSchema.setProperty("SelectionLanguage", "XPath");
xmlSchema.setProperty("SelectionNamespaces",
                 'xmlns:xs="http://www.w3.org/2001/XMLSchema";');
var nodes = xmlSchema.selectNodes("//xs:element");

All this follows IEs API design, which sarissa emulates for browsers able to do DOM L3 XPath. It would be ideal if sarissa emulated DOMI L3 for IE instead, but i cant find time to look into it.

[1] http://sarissa.sourceforge.net/doc/overview-summary.html#xpath

cheers,

Manos

Current Thread