From: "Donald Ball" <[EMAIL PROTECTED]>
> On Thu, 2002-04-18 at 21:28, James Strachan wrote:
>
> > The matches() method in dom4j used to just mean 'return true if the
XPath
> > expression finds *anything*'. Its now changed its semantics (more on
this
> > later). You can still use the old semantics via the selectSingleNode()
> > method instead.
>
> ...
>
> > The matches() method now means, does the XPath expression return myself
in
> > the result set.
>
> might i suggest the javadocs need updating then? i see what threw me off
> now that i went back and poked around. they currently state:
>
> "matches returns true if evaluating the given XPath expression on this
> node returns true or a non-empty node set. So calling this method is
> equivalent to calling <xsl:if test="xpathExpression"/> in XSLT."
Agreed. I've updated the javadoc in CVS - will be on the site later today...
> > So the document node isn't a title element, so
> >
> > document.matches( "/html/head/title" )
> >
> > will no longer return true.
>
> <xsl:if test="/html/head/title"/> will return true on any valid xhtml
> document, while document.matches("/html/head/title") returns false as
> you said.
Agreed. Though I think the new matches() method is more useful; though we
can still get the effect of <xsl:if/> via the selectSingleNode().
James
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user