PDA

View Full Version : DomQuery.compile() doesnt accept list of selectors



sjivan
28 Jun 2007, 4:53 AM
Unlike DomQuery.select(selector), DomQuery.compile(selector) doesn't accept a comma separated list of selectors. If this is the desired behaviour, maybe the docs can be updated to reflect this.

btw is compile() really required to be public? I see that select also looks in the cache before compiling a new query so a user could just pass use the selector String each time instead of a reusable function created by compile().

Thanks,
Sanjiv

jack.slocum
29 Jun 2007, 12:47 AM
compile() compiles a single selector into a function. There's no where in the docs it suggests otherwise.

/**
* Compiles a selector/xpath query into a reusable function. ...

There's no reason it can't be public. There are some cases where it could be useful.

sjivan
29 Jun 2007, 7:55 AM
compile() compiles a single selector into a function. There's no where in the docs it suggests otherwise.

I guess the undocumented part is that DomQuery.select(selector) accepts a comma separated list of selectors (and not that compile() doesnt accept a list of selectors). I'll add this to the doc issues thread.

Sanjiv