Hi- Two questions:
(1) Ok, I have about a dozen places througout my system where I call Document.selectSingleNode("some xpath"). This has been working fine since the XML I've been processing has no default namespace. (I'm assuming that "default namespace" is a xmlns="..." attribute in the root element.) Now, all of the sudden, I'm getting a document that has a root element with a xmlns="something" attribute, and all my selectSingleNodes are returning zilch. How can I compensate for this... without having to bother with creating namespace contexts and such... with as little change to my code as possible? ==== (2) As a related question, the XML I'm processing is actually the output of a transform which I read back into a dom4j Document, do some things, then write to XML using Document.asXML(). It is this call that is writing the xmlns attribute to the root element. Why? Here's the relevant part of the xslt: <?xml version="1.0" encoding="UTF-8"?> <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.a4networks.com/schemas/opl" xmlns:conversions="conversions.uri" exclude-result-prefixes="conversions"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:strip-space elements="*"/> ...... <xsl:template match="/"> <xsl:element name="Pip3A4PurchaseOrderRequest"> <xsl:element name="fromRole"> ...... The output looks like this: <?xml version="1.0" encoding="UTF-8"?> <Pip3A4PurchaseOrderRequest xmlns="http://www.a4networks.com/schemas/opl"> <fromRole> ...... [It is this namespace that is causing my problem in question (1) above. If I take out this xmlns attribute, all my selectSingleNode() calls work.] All help appreciated. ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ dom4j-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dom4j-user