Another note, I'm beginning to think this might be related to namespaces. When I generate the document, I use Namespace ns = DocumentHelper.createNamespace("prefix", nsuri); root.add(ns);
Obviously, when it is read in using the SAXReader, it infers the namespaces from the document. I'm not sure, how to specify a namespace for a document generated using Dom4j. Thanks, Muzaffer > -----Original Message----- > From: [EMAIL PROTECTED] [mailto:dom4j-user- > [EMAIL PROTECTED] On Behalf Of Ozakca, Muzaffer > Sent: Tuesday, July 17, 2007 3:10 PM > To: dom4j-user@lists.sourceforge.net > Subject: [dom4j-user] XPath and document creation > > Hi all, > > I'm generating a document using DocumentHelper.createElement() calls. When I > try to query the document generated using XPath, I get no matches. But if I > do this: > > String docString = doc.asXML(); > SAXReader reader = new SAXReader(); > doc = reader.read(new StringReader(docString)); > > The same XPath queries do match. I'm a new Dom4J user and might be making > some mistake somewhere. > > Can anybody point me what I might be doing wrong? > > Thanks, > Muzaffer > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > dom4j-user mailing list > dom4j-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/dom4j-user ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user