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
»
ID List Retrieval
Pages:
1
« previous
next »
Print
Author
Topic: ID List Retrieval (Read 240 times)
scotth
Member
Posts: 35
ID List Retrieval
«
on:
August 03, 2011, 08:02:28 AM »
Using XMetaL 6.0, what is the most efficient way to retrieve a list of all ID attribute values in the document? Below is what I am currently doing. I was just curious if there is a better way.
XMetaLControlLib.DOMNodeList idNodes = _xHost.Document.NativeObject.getNodesByXPath("//@id");
Thanks,
Scott
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member
Posts: 1548
Re: ID List Retrieval
«
Reply #1 on:
August 04, 2011, 12:45:28 AM »
It depends on what you need to do with this information afterwards. If you need to visit each node to change it in some way it can be more efficient to walk the document element by element (there are various APIs for moving between nodes or elements) and check each for an @ID. If you just need to gather the list of nodes for use elsewhere then getNodesByXPath may be more efficient.
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