if you are a human please do not click here
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
Username :
Password :
Home
Help
Calendar
Register
Login
XMetaL Community Forums
»
General
»
General XMetaL Discussion
»
Am i missing something in this Xpath?
Pages:
1
« previous
next »
Print
Author
Topic: Am i missing something in this Xpath? (Read 2075 times)
russurquhart1
Member
Posts: 25
Am i missing something in this Xpath?
«
on:
May 04, 2009, 02:25:58 PM »
Hi,
i am trying to use the following snippet to find any/all elements that have a filter attribute set to the value 'filter5':
var nodelist = ActiveDocument.getNodesByXpath("*[@filter='filter5']");
There are elements that meet this criteria in the file, but it keeps returning 0?
Am I missing something?
Thanks,
Russ
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1548
Re: Am i missing something in this Xpath?
«
Reply #1 on:
May 04, 2009, 02:38:26 PM »
Try this:
var nodelist = ActiveDocument.getNodesByXpath("//*[@filter='filter5']");
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1548
Re: Am i missing something in this Xpath?
«
Reply #2 on:
May 04, 2009, 02:45:35 PM »
I see the documentation in the Programmer's Guide is misleading in this instance (or we have strayed from the initial design of that API) which states that the path should be relative to the document's "DOMDocument" node (the document's root node). I'll follow this up with development.
Logged
russurquhart1
Member
Posts: 25
Re: Am i missing something in this Xpath?
«
Reply #3 on:
May 04, 2009, 02:47:45 PM »
I figured this out, right after i posted it, but thanks for the clarification!
Thanks,
Russ
Logged
Pages:
1
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General
-----------------------------
=> Forum Information
=> General XMetaL Discussion
=> DITA and XMetaL Discussion
=> XMetaL Tips and Tricks
=> XMetaL Announcements and Events
Loading...
email us