As far as I can see Apache XPath does not implement idref() - see here - http://xml.apache.org/xalan-j/apidocs/org/apache/xpath/functions/Functio nOneArg.html
That may be because idref() is not in the XPath 1.0 Specification - see here - http://www.w3.org/TR/xpath#section-Node-Set-Functions ________________________________ From: Anderson Guiera [mailto:[EMAIL PROTECTED] Sent: 11 November 2008 15:51 To: j-users@xerces.apache.org Subject: Error using idref function 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(Unkn own Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.PrimaryExpr(Unkno wn Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.FilterExpr(Unknow n 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.MultiplicativeExp r(Unknown Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(Unkn own Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(Un known Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(Unkn own 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(XMLPes soaGADAOFactory.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(XMLPes soaGADAOFactory.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(Unkn own Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.PrimaryExpr(Unkno wn Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.FilterExpr(Unknow n 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.MultiplicativeExp r(Unknown Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.AdditiveExpr(Unkn own Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.RelationalExpr(Un known Source) at com.sun.org.apache.xpath.internal.compiler.XPathParser.EqualityExpr(Unkn own 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. Registered Office: 7 Abbey Court, Eagle Way, Sowton, Exeter, Devon, EX2 7HY Registered Number 2892803 Registered in England and Wales This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email The information contained in this e-mail is confidential and may be subject to legal privilege. If you are not the intended recipient, you must not use, copy, distribute or disclose the e-mail or any part of its contents or take any action in reliance on it. If you have received this e-mail in error, please e-mail the sender by replying to this message. All reasonable precautions have been taken to ensure no viruses are present in this e-mail. Landmark Information Group Limited cannot accept responsibility for loss or damage arising from the use of this e-mail or attachments and recommend that you subject these to your virus checking procedures prior to use.