xPath and default namespaces.
I'm having some problems with resolving an xPath expression on some XML that sets a default namespace like this XHTML code. <?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Testing Title</title> </head> <body bgcolor="#FFFFFF" text="#000000"> <p>Test</p> </body> </html> The XPath expression will not work : "//body". Why not ? I've noticed it works if I include an extra colon in the xmlns or give the namespace a name. <html xmlns:xhtml="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> I assume this is not syntactically correct and a deviation from the XHTML standard I've been told that this behavior is part of the xPath specification. xPath doesn't like default namespaces. What is going on here ??? Dwight Funk POWERWAY, Inc. (317) 566-5401 MESSAGE IS INTENDED ONLY FOR THE USE OF THE INDIVIDUAL OR ENTITY TO WHICH IT IS ADDRESSED AND MAY CONTAIN INFORMATION THAT IS PRIVILEGED, CONFIDENTIAL AND EXEMPT FROM DISCLOSURE. If the reader of this message is not the recipient or an employee or agent responsible for delivering the message to the intended recipient, you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by E-Mail and return the original message to the sender. Thank you. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format