[Project_owners] Re: Using XPath to validate fields

Eric Jung grimholtz at yahoo.com
Thu Mar 31 10:07:13 EST 2005


Thanks. I'll update the article to work with XML namespaces when I
get a chance, or, if you find the time, feel free to do it yourself.

--- Axel Hecht <axel at pike.org> wrote:
> 
> > 
> > David,
> > 
> > You might consider changing:
> >   textboxes[z].focus();
> > to something like
> >   textboxes[z].setAttribute("style", "background: red; color:
> > white");
> > to make them stand out.
> > 
> > Also, I've updated the XPath code sample on kb.mozillazine.org to
> > work with code like yours (I think -- would appreciate it if you
> > could try it out again). I'm the one who wrote that article
> > originally.
> > 
> 
> The code still lacks any hint on what to do if your XML document is
> 
> using a default namespace.
> 
> <foo xmlns="http://some.domain.tld/bar">
>   <bar/>
> </foo>
> 
> and /foo/bar will not match, you will need to do something like
> 
> /p:foo/p:bar and use
> function resolver(aPrefix) {
>    if (aPrefix == "p") {
>      return "http://some.domain.tld/bar";
>    }
>    return "";
> }
> 
> as resolver. You can't use a resolver created from a node.
> 
> Axel
> _______________________________________________
> Project_owners mailing list
> Project_owners at mozdev.org
> http://mozdev.org/mailman/listinfo/project_owners
> 


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 


More information about the Project_owners mailing list