Examples of QElement


Examples of com.caucho.xml.QElement

  protected String getXslLocal(Node node)
  {
    if (! (node instanceof Element))
      return null;

    QElement elt = (QElement) node;

    String ns = elt.getNamespaceURI();
    String prefix = elt.getPrefix();

    if (ns == null || ns.equals("")) {
      return (elt.getNodeName().startsWith("xsl:") ?
        elt.getNodeName().substring(4) :
        null);
    }
    else if (ns.startsWith(XSLNS) &&
             (ns.length() == XSLNS.length() || ns.charAt(XSLNS.length()) == '/'))
      return elt.getLocalName();
    else
      return null;
  }
View Full Code Here

Examples of com.caucho.xml.QElement

  protected String getXtpLocal(Node node)
  {
    if (! (node instanceof Element))
      return null;

    QElement elt = (QElement) node;

    String ns = elt.getNamespaceURI();
    String prefix = elt.getPrefix();

    if (ns == null || ns.equals("")) {
      return (elt.getNodeName().startsWith("xtp:") ?
        elt.getNodeName().substring(4) :
        null);
    }
    else if (ns.startsWith(XTPNS))
      return elt.getLocalName();
    else
      return null;
  }
View Full Code Here

Examples of com.caucho.xml.QElement

    throws Exception
  {
    XslNode xslNode = null;

    if (child instanceof QElement) {
      QElement elt = (QElement) child;

      Class cl = _tagMap.get(elt.getQName());

      if (cl != null) {
  xslNode = (XslNode) cl.newInstance();
  xslNode.setGenerator(this);
  xslNode.setParent(_xslNode);
 
  xslNode.setStartLocation(((QAbstractNode) child).getBaseURI(),
         ((QAbstractNode) child).getFilename(),
         ((QAbstractNode) child).getLine());

  QAttr attr = (QAttr) elt.getFirstAttribute();
  for (; attr != null; attr = (QAttr) attr.getNextSibling()) {
    xslNode.addAttribute(attr.getQName(), attr.getNodeValue());
  }

  xslNode.endAttributes();

  XslNode oldNode = _xslNode;
  _xslNode = xslNode;
 
  Node node = elt.getFirstChild();
  for (; node != null; node = node.getNextSibling()) {
    XslNode xslChild = createChild(node);

    if (xslChild != null)
      xslNode.addChild(xslChild);
  }

  xslNode.endElement();

  _xslNode = oldNode;
      }
      /*
      else if (elt.getNodeName().equals("jsp:decl") ||
         elt.getNodeName().equals("jsp:declaration") ||
         elt.getNodeName().startsWith("jsp:directive")) {
      }
      */
      else if (child.getNodeName().startsWith("xsl:") &&
         ! XSLNS.equals(child.getNamespaceURI())) {
  throw error(child, L.l("<{0}> has an xsl: prefix, but is not in the {1} namespace.  XSL requires an xmlns:xsl=\"{1}\" namespace attribute.",
             child.getNodeName(),
             XSLNS));
      }
      else if (! XSLNS.equals(child.getNamespaceURI()) &&
         ! XTPNS.equals(child.getNamespaceURI())) {
  xslNode = new XslElementNode(elt.getQName());
  xslNode.setGenerator(this);
  xslNode.setParent(_xslNode);
 
  xslNode.setStartLocation(((QAbstractNode) child).getBaseURI(),
         ((QAbstractNode) child).getFilename(),
         ((QAbstractNode) child).getLine());

  QAttr attr = (QAttr) elt.getFirstAttribute();
  for (; attr != null; attr = (QAttr) attr.getNextSibling())
    xslNode.addAttribute(attr.getQName(), attr.getNodeValue());

  xslNode.endAttributes();

  XslNode oldNode = _xslNode;
  _xslNode = xslNode;
 
  Node node = elt.getFirstChild();
  for (; node != null; node = node.getNextSibling()) {
    XslNode xslChild = createChild(node);
   
    xslNode.addChild(xslChild);
  }
View Full Code Here

Examples of com.caucho.xml.QElement

  }

  protected void printElement(Node node)
    throws Exception
  {
    QElement elt = (QElement) node;
    String name = node.getNodeName();

    if (name.equals("jsp:decl") || name.equals("jsp:declaration")) {
      println("if (out.isFlagFirst(" + _flagCount++ + ")) {");
      pushDepth();
    }
   
    String prefix = elt.getPrefix();
    String local = elt.getLocalName();
    String namespace = elt.getNamespaceURI();

    String []postPrefix = (String []) _namespaceAliases.get(namespace);
    if (postPrefix != null) {
      prefix = postPrefix[0];
      namespace = postPrefix[1];
View Full Code Here

Examples of com.caucho.xml.QElement

  ArrayList<Dependency> getDependencyList(Node node)
  {
    ArrayList<Dependency> dependList = null;

    if (node instanceof QElement) {
      QElement qelt = (QElement) node;

      QDocument doc = (QDocument) qelt.getOwnerDocument();

      if (doc == null)
        return null;
      else if (doc == _dependDocument)
        return _dependList;
View Full Code Here

Examples of com.caucho.xml.QElement

    }

    if (! (node instanceof Element))
      return null;

    QElement elt = (QElement) node;

    // ioc/2235
    for (Node attr = elt.getFirstAttribute();
         attr != null;
         attr = attr.getNextSibling()) {
      if (! "xml".equals(attr.getPrefix()))
        return null;
    }

    for (Node child = elt.getFirstChild();
         child != null;
         child = child.getNextSibling()) {
      if (child instanceof Element) {
        return null;
      }
View Full Code Here

Examples of com.caucho.xml.QElement

  ArrayList<Dependency> getDependencyList(Node node)
  {
    ArrayList<Dependency> dependList = null;

    if (node instanceof QElement) {
      QElement qelt = (QElement) node;

      QDocument doc = (QDocument) qelt.getOwnerDocument();

      if (doc == null)
        return null;
      else if (doc == _dependDocument)
        return _dependList;
View Full Code Here

Examples of com.caucho.xml.QElement

    }

    if (! (node instanceof Element))
      return null;

    QElement elt = (QElement) node;

    // ioc/2235
    for (Node attr = elt.getFirstAttribute();
         attr != null;
         attr = attr.getNextSibling()) {
      if (! "xml".equals(attr.getPrefix()))
        return null;
    }

    for (Node child = elt.getFirstChild();
         child != null;
         child = child.getNextSibling()) {
      if (child instanceof Element) {
        return null;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.