Package org.apache.xpath

Examples of org.apache.xpath.XPathContext


    public String valueOf(Node n, String xpath) throws JspTagException  {
        //p("******** valueOf(" + n + ", " + xpath + ")");
        staticInit();
        // @@@ but where do we set the Pag4eContext for the varaiblecontext?
        JstlVariableContext vs = new JstlVariableContext();
        XPathContext xpathSupport = new XPathContext();
        xpathSupport.setVarStack( vs);
       
        Vector varVector = fillVarStack(vs, xpathSupport);               
       
        Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() );
       
View Full Code Here


    public boolean booleanValueOf(Node n, String xpath)
    throws JspTagException {
       
        staticInit();
        JstlVariableContext vs = new JstlVariableContext();
        XPathContext xpathSupport = new XPathContext();
        xpathSupport.setVarStack( vs);
       
        Vector varVector = fillVarStack(vs, xpathSupport);       
       
        Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() );
        xpath = modifiedXPath;
View Full Code Here

     */
    public List selectNodes(Node n, String xpaththrows JspTagException {
       
        staticInit();
        JstlVariableContext vs = new JstlVariableContext();
        XPathContext xpathSupport = new XPathContext();
        xpathSupport.setVarStack( vs);
       
        Vector varVector = fillVarStack(vs, xpathSupport);               

        Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() );
        xpath = modifiedXPath;
View Full Code Here

        //p("selectSingleNode of XPathUtil = passed node:" +
        //   "xpath => " + n + " : " + xpath );
       
        staticInit();
        JstlVariableContext vs = new JstlVariableContext();
        XPathContext xpathSupport = new XPathContext();
        xpathSupport.setVarStack( vs);
       
        Vector varVector = fillVarStack(vs, xpathSupport);               

        Node contextNode = adaptParamsForXalan( vs, n, xpath.trim() );
        xpath = modifiedXPath;
View Full Code Here

     * doXPath
     */
    private XObject doXPath(String path)
    throws javax.xml.transform.TransformerException {
        // If not there - create or else reset().
        if (xpathSupport == null) xpathSupport = new XPathContext();
        else xpathSupport.reset();

        Node namespaceNode = (Node)data;

        if (prefixResolver == null) prefixResolver = new PrefixResolverDefault(
View Full Code Here

               if ( d == null )
                  continue;

               Node n = d.getDocumentElement();

               XPathContext xpc = new XPathContext();
               PrefixResolver pfx;
               if ( pr == null ) {
                  pfx = new PrefixResolverDefault(d.getDocumentElement());
                  xp = new XPath(query, null, pfx, XPath.SELECT, errors);
               }
View Full Code Here

     * that can be used to compile an XPath expression.
     */
    private XPathContext getXPathContext()
    {
        if (xpContext == null)
            xpContext = new XPathContext();

        return xpContext;
    }
View Full Code Here

    this.rootNode = rootNode;

    // Since we don't have a XML Parser involved here, install some default
    // support for things like namespaces, etc.
    XPathContext xpathSupport = new XPathContext();

    PrefixResolver prefixResolver = null;
    // Create an object to resolve namespace prefixes.
    if (namespace != null)
    {
View Full Code Here

  String getCountString(TransformerImpl transformer, int sourceNode)
          throws TransformerException
  {

    long[] list = null;
    XPathContext xctxt = transformer.getXPathContext();
    CountersTable ctable = transformer.getCountersTable();

    if (null != m_valueExpr)
    {
      XObject countObj = m_valueExpr.execute(xctxt, sourceNode, this);
View Full Code Here

    Locale locale = null;

    if (null != m_lang_avt)
    {
      XPathContext xctxt = transformer.getXPathContext();
      String langValue = m_lang_avt.evaluate(xctxt, contextNode, this);

      if (null != langValue)
      {

        // Not really sure what to do about the country code, so I use the
        // default from the system.
        // TODO: fix xml:lang handling.
        locale = new Locale(langValue.toUpperCase(), "");

        //Locale.getDefault().getDisplayCountry());
        if (null == locale)
        {
          transformer.getMsgMgr().warn(this, null, xctxt.getDTM(contextNode).getNode(contextNode),
                                       XSLTErrorResources.WG_LOCALE_NOT_FOUND,
                                       new Object[]{ langValue })//"Warning: Could not find locale for xml:lang="+langValue);

          locale = Locale.getDefault();
        }
View Full Code Here

TOP

Related Classes of org.apache.xpath.XPathContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.