Yes! thx a lot Tony, exactly what i needed !
btw is this referenced anywhere in the cocoon docs, because i've been
looking for a while for some docs with this kind of practice or tips in
flowscript, but never found anything consistant ?
Marc
Tony Edwards a écrit :
Hi Marc,
I use the XPathAPI to navigate a DOM.
eg:
importClass(org.apache.xpath.XPathAPI); nl =
XPathAPI.selectNodeList(document, sXpath);
where sXpath could be something like xPath =
"//authorityLink[linkNumber='" + linkNum + "']";
I don't know if this is what you're after but I hope it helps!!
Regards
Tony
Marc Salvetti wrote:
Hello,
I've been using flow with cforms for a while and the framework is
great, but one thing that i found really uneasy is navigating in the
dom tree with the dom api.
For exemple, i often do things like :
users =
document.getDocumentElement().getElementsByTagName("users").item(0).getElementsByTagName("user");
and then i have to iterate all nodes to find the one i want :
for(var i=0; i < users.getLength(); i++){
//Test each node against a property eg : id to find the node i want
if(users.item(i).getAttribute('id').equals("foo")){
//The node is finally found...
}
}
Now i would like to know if there is a class somewhere in the cocoon
distribution that allows to use the much more convenient xpath syntax
to navigate in the dom.
Hopefully, sth like user = Utils.evalSax(document,
"authentication/users/[EMAIL PROTECTED]'foo']");
Does something similar to this exist ?
Thanks,
Marc
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
This email is from Civica Pty Limited and it, together with any
attachments, is confidential to the intended recipient(s) and the
contents may be legally privileged or contain proprietary and private
information. It is intended solely for the person to whom it is
addressed. If you are not an intended recipient, you may not review,
copy or distribute this email. If received in error, please notify the
sender and delete the message from your system immediately. Any views
or opinions expressed in this email and any files transmitted with it
are those of the author only and may not necessarily reflect the views
of Civica and do not create any legally binding rights or obligations
whatsoever. Unless otherwise pre-agreed by exchange of hard copy
documents signed by duly authorised representatives, contracts may not
be concluded on behalf of Civica by email. Please note that neither
Civica nor the sender accepts any responsibility for any viruses and
it is your responsibility to scan the email and the attachments (if
any). All email received and sent by Civica may be monitored to
protect the business interests of Civica.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]