Package nu.xom

Examples of nu.xom.Node$EmptyNamespaceContext


            }
          }
            //  velocity
          Element dynamics = notations.getFirstChildElement("dynamics");
          if (dynamics != null)
          {  Node dynamic = dynamics.getChild(0);
            if (dynamic != null)
            {  for (int x = 0; x < this.volumes.length; ++x)
              {  if (dynamic.getValue().compareToIgnoreCase(this.volumes[x]) == 0)
                {  this.curVelocity = (byte)(((this.maxVelocity - this.minVelocity)
                          (this.volumes.length - 1)) * x);
                }
               
              }
View Full Code Here


   
    return getEventType();
  }
 
  private Node nextChild(int i) {
    Node node = current.getChild(i);
    if (node instanceof Text) {
      textValue = node.getValue();
      if (isCoalescing) {
        // Merge adjacent Text nodes into a single virtual text node, ala XPath
        Node n;
        int count = current.getChildCount();
        while (++i < count && ((n = current.getChild(i)) instanceof Text)) {
          node = n;
          textValue += node.getValue(); // rare case
        }
View Full Code Here

        }
      }

      // append nodes:
      for (int j=0; j < nodes.size(); j++) {
        Node node = nodes.get(j);
        if (node instanceof Element) { // replace fake root with real root
          if (hasRootElement) {
            throw new IllegalAddException(
              "Factory returned multiple root elements");
          }
View Full Code Here

              + reader.getEventType());
      }
     
      // append nodes:
      for (int j=0; j < nodes.size(); j++) {
        Node node = nodes.get(j);
        if (node instanceof Element) { // replace fake root with real root
          if (hasRootElement) {
            throw new IllegalAddException(
              "Factory returned multiple root elements");
          }
View Full Code Here

  /** Iterative pull parser reading an entire element subtree. */
  private void readElement(ArrayByteList src, Element current, InputStream input)
    throws BinaryParsingException, IOException {
   
    while (true) {
      Node node = null;
      Element down = null;
      int type = src.get(); // look ahead
//      if (DEBUG) System.err.println("reading type = " + toString(type));
      switch (type & 0x07) { // three low bits indicate node type
        case TEXT: {
View Full Code Here

 
  /** Iterative pull parser reading an entire element subtree */
  private void readElement(Element current) throws XMLStreamException {
   
    while (true) {
      Node node = null;
     
      switch (reader.next()) {
        case XMLStreamConstants.START_ELEMENT: {
          Element elem = readStartTag();
          current.insertChild(elem, current.getChildCount());
View Full Code Here

 
  private static void appendNodes(Element elem, Nodes nodes) {
    if (nodes != null) {
      int size = nodes.size();
      for (int i=0; i < size; i++) {
        Node node = nodes.get(i);
        if (node instanceof Attribute) {
          elem.addAttribute((Attribute) node);
        } else {
          elem.insertChild(node, elem.getChildCount());
        }
View Full Code Here

  private static void appendNodes(Element elem, Nodes nodes) {
    if (nodes != null) {
      int size = nodes.size();
      for (int i=0; i < size; i++) {
        Node node = nodes.get(i);
        if (node instanceof Attribute) {
          elem.addAttribute((Attribute) node);
        } else {
          elem.insertChild(node, elem.getChildCount());
        }
View Full Code Here

 
  private void writeDocument(Document doc) throws IOException {
    if (DEBUG) System.err.println("writing document");
    writeXMLDeclaration(doc.getBaseURI());
    for (int i = 0; i < doc.getChildCount(); i++) {
      Node node = doc.getChild(i);
      if (node instanceof Element) {
        writeElement((Element) node);
      } else if (node instanceof Comment) {
        writeComment((Comment) node);
      } else if (node instanceof ProcessingInstruction) {
View Full Code Here

    String systemID = (String) invoke(info, "getDTDSystemId");
    if (systemID == MISSING_StAX2) return NONE;
   
    Nodes nodes = nodeFactory.makeDocType(rootName, publicID, systemID);
    for (int k=0; k < nodes.size(); k++) {
      Node node = nodes.get(k);
      if (node instanceof DocType) {
        DocType docType = (DocType) node;
        if (docType.getInternalDTDSubset().length() == 0) {
          // xom >= 1.1 only
          String subset = (String) invoke(info, "getDTDInternalSubset");
View Full Code Here

TOP

Related Classes of nu.xom.Node$EmptyNamespaceContext

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.