Hi all,

my name is Anderson Guiera and i'm have a problem with idref function.
I use this function in the folow code:

XPath xpath = XPathFactory.newInstance().newXPath();
String expression = "idref('pessoaGA.1')";
NodeList nosEnderecos = (NodeList) xpath.evaluate(expression,
this.xmlDocument, XPathConstants.NODESET);

and i've got the folow error:

javax.xml.transform.TransformerException: Could not find function: idref
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.FunctionCall(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.PrimaryExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.FilterExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.PathExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.UnionExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.UnaryExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.MultiplicativeExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.AndExpr(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.OrExpr(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.Expr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(Unknown
Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(Unknown Source)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(Unknown
Source)
    at
com.copel.geo.cadastro.pessoa.XMLPessoaGADAOFactory.loadEnderecos(XMLPessoaGADAOFactory.java:61)
    at StartUP.main(StartUP.java:42)
--------------- linked to ------------------
javax.xml.xpath.XPathExpressionException
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.evaluate(Unknown
Source)
    at
com.copel.geo.cadastro.pessoa.XMLPessoaGADAOFactory.loadEnderecos(XMLPessoaGADAOFactory.java:61)
    at StartUP.main(StartUP.java:42)
Caused by: javax.xml.transform.TransformerException: Could not find
function: idref
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.error(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.FunctionCall(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.PrimaryExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.FilterExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.PathExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.UnionExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.UnaryExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.MultiplicativeExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.AndExpr(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.OrExpr(Unknown
Source)
    at com.sun.org.apache.xpath.internal.compiler.XPathParser.Expr(Unknown
Source)
    at
com.sun.org.apache.xpath.internal.compiler.XPathParser.initXPath(Unknown
Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    at com.sun.org.apache.xpath.internal.XPath.<init>(Unknown Source)
    at com.sun.org.apache.xpath.internal.jaxp.XPathImpl.eval(Unknown Source)
    ... 3 more


When i changed the function to id, I have no errors and the code retrive the
correct node.
I don't know why the function idref wasn't found.
Does anyone has any idea what is going wrong?

Thanks a lot.
Anderson.

Reply via email to