[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Namespace prefixes in Schemas
Hi Antsnio,
See my intermissions, Cheers, Abel Braaksma http://www.nuntia.nl Antsnio Mota wrote: Are you sure of that? Are you sayng that the target, not the prefix, is cheked by the processor? This should be right, yes.
This should be right too. But I'm afraid it will work with TransformIIX (Gecko based browsers use it) and not with MSXML. I had about the same problem a while, but I wasn't using Sarissa (but I am planning on using it).
It should work for both with any "normal" processor. But since you are using Sarissa, I expect you to use the XSLT as a client-side transformation in JavaScript. This changes the original question a bit, because there are a lot of incompatibilities between client side XSLT processors. Here's a copy of my function that does what you want. Put in a DOM element and a tagname. The tagname can be of the form "xs:element" or otherwise. It will replace the prefix for Gecko based browsers. There are other ways to do this, but this is a working version (and your post reminds me of adding some error handling in the function below). . getElementsByTagName = function(dom, tagname) { if(typeof dom.selectNodes != 'undefined') { return dom.selectNodes("//" + tagname); } else { tagname = tagname.replace(/[^:]+:(.*)/, "$1"); return dom.getElementsByTagName(tagname); } } Please note that, if your DOM object is obtained using AJAX technology outside the domain, you may need to request UniversalBrowserRead privileges for Gecko. In that case add the following to the "else" part (for IE, you must add the site to the trusted domains): try{typeof netscape!='undefined' && netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead"); } catch (e) {alert("Not allowed by user!" + e.message); return } Afaik, this should do the trick. Hmm, thinking. You should try this with a DOM object that is not expanded by Sarissa. Try it without Sarissa first.Then add this code in a way to Sarissa, so that it works for the Sarissa method "selectNodes". Good luck with it, hth, Abel Braaksma http://www.nuntia.nl
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|