Package com.caucho.xpath

Examples of com.caucho.xpath.NamespaceContext


    println();
    println("_namespaces = new NamespaceContext[] { ");
    pushDepth();

    for (int i = 0; i < _namespaces.size(); i++) {
      NamespaceContext ns = _namespaces.get(i);

      printNamespaceDef(ns);
      println(",");
    }
    popDepth();
View Full Code Here


    if (nodeName == null) {
      if (child.getNodeType() == child.TEXT_NODE)
        generateText(child);
      else if (child.getNodeType() == child.ELEMENT_NODE) {
        NamespaceContext oldNamespace = addNamespace((Element) child);
        printElement((Element) child);
        _namespace = oldNamespace;
      }
      return;
    }

    if (child instanceof QElement) {
      NamespaceContext oldNamespace = addNamespace((QElement) child);
      generateChild(child, code);
      _namespace = oldNamespace;
    }
    else
      generateChild(child, code);
View Full Code Here

   *
   * @return the old namespace context
   */
  protected NamespaceContext addNamespace(Element elt)
  {
    NamespaceContext oldNamespace = _namespace;

    Node attr = ((QElement) elt).getFirstAttribute();
    for (; attr != null; attr = attr.getNextSibling()) {
      String name = attr.getNodeName();

      if (name.startsWith("xmlns:"))
        name = name.substring(6);
      else if (name.equals("xmlns"))
        name = "";
      else
        continue;

      // Note: according to the spec, the default namespace is not used
     
      String url = attr.getNodeValue();
      if (url.equals(XSLNS) || url.equals(XTPNS))
        continue;

      if (url.startsWith("quote:"))
        url = url.substring(6);

      _namespace = new NamespaceContext(_namespace, name, url);
    }

    return oldNamespace;
  }
View Full Code Here

      url = url.substring(6);
    */
   
    String localName = name.getLocalName();

    _outputNamespace = new NamespaceContext(_outputNamespace, localName, url);

    if (! localName.equals("xmlns")) {
      // xsl/04w3
      _matchNamespace = new NamespaceContext(_matchNamespace, localName, url);
    }
  }
View Full Code Here

  /**
   * Returns the XPath namespace context.
   */
  public final NamespaceContext getNamespaceContext()
  {
    NamespaceContext ns = null;

    for (Namespace ptr = _ns; ptr != null; ptr = ptr.getNext()) {
      // jsp/1g58
      if (! "".equals(ptr.getPrefix()))
        ns = new NamespaceContext(ns, ptr.getPrefix(), ptr.getURI());
    }

    return ns;
  }
View Full Code Here

    if (nodeName == null) {
      if (child.getNodeType() == child.TEXT_NODE)
        generateText(child);
      else if (child.getNodeType() == child.ELEMENT_NODE) {
        NamespaceContext oldNamespace = addNamespace((Element) child);
        printElement((Element) child);
        _namespace = oldNamespace;
      }
      return;
    }

    if (child instanceof QElement) {
      NamespaceContext oldNamespace = addNamespace((QElement) child);
      generateChild(child, code);
      _namespace = oldNamespace;
    }
    else
      generateChild(child, code);
View Full Code Here

   *
   * @return the old namespace context
   */
  protected NamespaceContext addNamespace(Element elt)
  {
    NamespaceContext oldNamespace = _namespace;

    Node attr = ((QElement) elt).getFirstAttribute();
    for (; attr != null; attr = attr.getNextSibling()) {
      String name = attr.getNodeName();

      if (name.startsWith("xmlns:"))
  name = name.substring(6);
      else if (name.equals("xmlns"))
  name = "";
      else
        continue;

      // Note: according to the spec, the default namespace is not used
     
      String url = attr.getNodeValue();
      if (url.equals(XSLNS) || url.equals(XTPNS))
        continue;

      if (url.startsWith("quote:"))
  url = url.substring(6);

      _namespace = new NamespaceContext(_namespace, name, url);
    }

    return oldNamespace;
  }
View Full Code Here

    println();
    println("_namespaces = new NamespaceContext[] { ");
    pushDepth();

    for (int i = 0; i < _namespaces.size(); i++) {
      NamespaceContext ns = _namespaces.get(i);

      printNamespaceDef(ns);
      println(",");
    }
    popDepth();
View Full Code Here

  /**
   * Returns the XPath namespace context.
   */
  public final NamespaceContext getNamespaceContext()
  {
    NamespaceContext ns = null;

    for (Namespace ptr = _ns; ptr != null; ptr = ptr.getNext()) {
      // jsp/1g58
      if (! "".equals(ptr.getPrefix()))
  ns = new NamespaceContext(ns, ptr.getPrefix(), ptr.getURI());
    }

    return ns;
  }
View Full Code Here

      url = url.substring(6);
    */
   
    String localName = name.getLocalName();

    _outputNamespace = new NamespaceContext(_outputNamespace, localName, url);

    if (! localName.equals("xmlns")) {
      // xsl/04w3
      _matchNamespace = new NamespaceContext(_matchNamespace, localName, url);
    }
  }
View Full Code Here

TOP

Related Classes of com.caucho.xpath.NamespaceContext

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.