1 Reply Latest reply on Jan 29, 2005 4:26 AM by 843834

    Getting Invalid XPath expression

      I am parsing a XML document and reading a node with <xtags:valueOf .. select="product_name"/>. The value of product_name is :
      <product_name>SJE6 2004Q1, 1 RTU ESD, All platforms, 1 Year</product_name> , but I am getting the following exception :

      org.dom4j.InvalidXPathException: Invalid XPath expression: SJE6 2004Q1, 1 RTU ESD, All platforms, 1 Year Unexpected '2004'
      at org.dom4j.xpath.DefaultXPath.parse(DefaultXPath.java:316)
      at org.dom4j.xpath.DefaultXPath.<init>(DefaultXPath.java:63)
      at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:182)
      at org.dom4j.DocumentFactory.createXPath(DocumentFactory.java:198)
      at org.apache.taglibs.xtags.xpath.AbstractTag.createXPath(AbstractTag.java:195)
      at org.apache.taglibs.xtags.xpath.VariableTag.setSelect(VariableTag.java:143)

      I tried with <xtags:copyOf select=.../node() and text()/> but still getting the same exception. Not sure why its failing on 2004? Help!

        • 1. Re: Getting Invalid XPath expression
          The problem was not in the <xtags:valueOf> but in the following expression :
          <xtags:variable id="lName" select="<%= product_name %>"/>
          where I wasassigning the value of <product_name> to a String (java) variable defined. But this will be another question : why is <xtags:variable> failing?