Hi Anderson, Xerces doesn't implement XPathFactory. Xalan does.
It would be better to ask questions about Xalan on the [EMAIL PROTECTED] mailing list instead of the Xerces-J list. Also, keep in mind that you're using Sun's fork of Xalan. The developers in Apache have no idea what modifications have been made to this fork and may not be able to help you unless you switch over to using the real (org.apache.xpath.*) Apache version. Thanks. Michael Glavassevich XML Parser Development IBM Toronto Lab E-mail: [EMAIL PROTECTED] E-mail: [EMAIL PROTECTED] "Anderson Guiera" <[EMAIL PROTECTED]> wrote on 11/11/2008 10:51:11 AM: > 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.