xerces-j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Glavassevich <mrgla...@ca.ibm.com>
Subject Re: Exception in thread "main" javax.xml.transform.TransformerException: Could not find function: if
Date Mon, 17 Aug 2009 16:23:36 GMT

Hi,

You got the wrong organization (this is Sun's implementation not Apache's)
and mailing list (Xerces doesn't even implement the JAXP XPath API). You
should ask your question in a more appropriate forum (e.g.
forums.java.sun.com).

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

sridhar veerappan <sriasarch@gmail.com> wrote on 08/17/2009 02:45:47 AM:

> Hi,
> I am getting parsing error in xpath transformation
>
>
> String s = "if (/blah/text()!='') then blah/text() else ''";
> XPathExpression expression = xpath.compile(s);
>
> Object o = expression.evaluate(target, XPathConstants.NODESET);
>
> I am using normal core java and xml packages to parse
> import javax.xml.parsers.DocumentBuilder;
> import javax.xml.parsers.DocumentBuilderFactory;
>
> import javax.xml.xpath.XPath;
> import javax.xml.xpath.XPathConstants;
> import javax.xml.xpath.XPathExpression;
> import javax.xml.xpath.XPathFactory;
>
> import org.w3c.dom.Document;
> import org.w3c.dom.Node;
>
> import org.w3c.dom.NodeList;
>
>
> Exception:
> Exception in thread "main" javax.xml.transform.TransformerException:
> Could not find function: if
>     at com.sun.org.apache.xpath.internal.compiler.XPathParser.
> error(XPathParser.java:602)
>
>     at com.sun.org.apache.xpath.internal.compiler.XPathParser.
> FunctionCall(XPathParser.java:1449)
>     at com.sun.org.apache.xpath.internal.compiler.XPathParser.
> PrimaryExpr(XPathParser.java:1388)
>     at com.sun.org.apache.xpath.internal.compiler.XPathParser.
> FilterExpr(XPathParser.java:1287)

<snip/>

> Thanks
> Sri
Mime
View raw message