domingoazul Posted April 23, 2007 Share Posted April 23, 2007 Hello,I would like to change a value of my xhtml document using XPath.This is a summary of my document: <?xml ....?><html ....> <head> ... </head> <body> ... <object> <param name="..." value="..." /> </object> </body></html> I use this XPath argument: "/html/body/object/param/@value" but it does not work.The element who uses this XPath argument is an xforms:setvalue like this: <xforms:setvalue ref="/html/body/object/param/@value" value="instance('appletData')/ws:docRoute" /> I can do something near of what I want with Javascript, but I do not know ho to do it with XPath.Thanks Link to comment Share on other sites More sharing options...
boen_robot Posted April 24, 2007 Share Posted April 24, 2007 Do you have a namespace declared in the XHTML? That is: <html xmlns="http://www.w3.org/1999/xhtml"> If so, your XPath expression needs to specify that by using: "/{http://www.w3.org/1999/xhtml}html/{http://www.w3.org/1999/xhtml}body/{http://www.w3.org/1999/xhtml}object/{http://www.w3.org/1999/xhtml}param/@value" You can also simply remove the xmlns though. Link to comment Share on other sites More sharing options...
domingoazul Posted April 25, 2007 Author Share Posted April 25, 2007 Yes, I do. I didn't think about the default namespace..Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.