You may want to look into using Apache's xerces/xalan implementation of DOM/XPath. I had no problems running normal XPath expressions such as "/html/body/[EMAIL PROTECTED]'content']" against an XHTML document. The code for running XPath is much less convenient though... I also had serialization format issues with apache's implementation. Looks like maybe they've a new version now.
--Evan S. Sharif wrote: > Yes, I agree. I am converting a non-Java application > to Java in which XPath was used quite extensively in > the code. In the old non-Java language the XPath > worked just fine without using namespace prefixes. It > would be nice if I could use those XPath expressions > as is, without going through the trouble of prefixing > every single node in the XPath expression. > > > In regards to the code that you showed me for removing > the namespace from an xml document, I was just > wondering if there was an easier way for doing it. Is > there a command in dom4j by which you can remove the > namespace from the root element, and by doing so there > would no longer be any namespace in the xml document. > > I mean for example, if we have the following xml > > <Document xmlns="http://www.web.com/apps/RunRequest"> > <LOGIN_LIST filter="Primary"> > <LOGIN> > <USERID>testuser1</USERID> > <PASSWORD>password</PASSWORD> > </LOGIN> > </LOGIN_LIST> > </Document> > > > Could I do something like this > > > document.getRootElement().removeNamespace(...) > > > and then the resulting xml document would become > > <Document> > <LOGIN_LIST filter="Primary"> > <LOGIN> > <USERID>testuser1</USERID> > <PASSWORD>password</PASSWORD> > </LOGIN> > </LOGIN_LIST> > </Document> > > > Is there such a thing in dom4j? I am asking since I > am still fairly new to dom4j and maybe the dom4j > experts could let me know. > > Thanks. > > > --- Evan Kirkconnell <[EMAIL PROTECTED]> wrote: > > >> Yeah, I did something similar for a while. The >> XPath is still ugly >> IMO. You may be surprised at how fast dom4j can >> strip them. I did some >> tests to see if it was viable, and I think it was >> only like 10 >> milliseconds for a decent size document. It was a >> long time ago though... >> > > > ********************************************************** > * Saladin Sharif > * e-mail: [EMAIL PROTECTED] > * Visit homepage @ http://gaia.ecs.csus.edu/~sharifs > ********************************************************** > > > > ____________________________________________________________________________________ > Have a burning question? > Go to www.Answers.yahoo.com and get answers from real people who know. > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > dom4j-user mailing list > dom4j-user@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/dom4j-user > ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ dom4j-user mailing list dom4j-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dom4j-user