🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #294

[JS] using evaluateXPathExpression with namespaces?

#294
From: Peter Davis
Date: Fri, 20 Mar 2009 14:30
20 lines
1880 bytes
I'm trying to find all the XML elements that match abc:xyz, using the
evaluateXPathExpression function.

This works beautifully if I just have local tag names, <abc ...>.
However, I can't find any way to get the namespace matching to work.
I've tried

var xpath = "//xyz"'
var prefixMatchingTable = [["abc", "http://www.abc.com"]];
var elems = root.evaluateXPathExpression(xpath, prefixMatchingTable);

but this returns nothing.  I've tried with and without the
prefixMatchingTable argument, and with and without including the
actual prefix, "abc:" in the xpath.  None of these permutations seems
to work.

Any examples or info on this?

Thanks!
-pd
Technical Details
Message-ID: <86492a16-e642-4c8f-8fac-1534a8008c73@w35g2000yqm.googlegroups.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!postnews.google.com!w35g2000yqm.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,41f5e98241e96152,start
X-Google-Attributes: gidf939a,domainid0,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!postnews.google.com!w35g2000yqm.googlegroups.com!not-for-mail
From: Peter  Davis <pfdavis@gmail.com>
Newsgroups: adobe.scripting.indesign
Subject: [JS] using evaluateXPathExpression with namespaces?
Date: Fri, 20 Mar 2009 07:30:19 -0700 (PDT)
Organization: http://groups.google.com
Lines: 20
Message-ID: <86492a16-e642-4c8f-8fac-1534a8008c73@w35g2000yqm.googlegroups.com>
NNTP-Posting-Host: 66.150.206.225
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1237559419 31423 127.0.0.1 (20 Mar 2009 14:30:19 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 20 Mar 2009 14:30:19 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: w35g2000yqm.googlegroups.com; posting-host=66.150.206.225; 
 posting-account=G2l8pgoAAABQYixzPXgqN3qQugbP4n5s
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; 
 rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7,gzip(gfe),gzip(gfe)