[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Namespace prefixes in Schemas

Subject: Re: Namespace prefixes in Schemas
From: Emmanouil Batsis <Emmanouil.Batsis@xxxxxxxxxxx>
Date: Tue, 12 Sep 2006 12:46:26 +0300
sarissa setxpathnamespaces
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2011 All Rights Reserved.