Package nu.xom

Examples of nu.xom.ProcessingInstruction


 
  private ProcessingInstruction readProcessingInstruction(ArrayByteList src) {
    int type = src.get(src.position() - 1);
    String target = readString(src, 4, type);
    String value = readString(src, 6, type);
    return new ProcessingInstruction(target, value);
  }
View Full Code Here


      }
      case XMLStreamConstants.START_DOCUMENT:
      case XMLStreamConstants.END_DOCUMENT:
        return new NodeFactory().startMakingDocument();
      case XMLStreamConstants.PROCESSING_INSTRUCTION:
        return new ProcessingInstruction(
            reader.getPITarget(), reader.getPIData());
      case XMLStreamConstants.COMMENT:
        return new Comment(reader.getText());
      case XMLStreamConstants.SPACE:
      case XMLStreamConstants.CDATA:
View Full Code Here

          current = (Element) current.getParent(); // recurse up
          if (current == null) return; // we're done with the root element
          continue;
        }
        case XMLStreamConstants.PROCESSING_INSTRUCTION:
          node = new ProcessingInstruction(
              reader.getPITarget(), reader.getPIData());
          break;
        case XMLStreamConstants.COMMENT:
          node = new Comment(reader.getText());
          break;
View Full Code Here

        break;
      case Type.COMMENT:
        value = new Comment(node.getStringValue());
        break;
      case Type.PROCESSING_INSTRUCTION:
        value = new ProcessingInstruction(node.getLocalPart(), node.getStringValue());
        break;
      case Type.NAMESPACE:
        value = convertAtomicValue(new AnyURIValue(node.getStringValue()));
//        value = new nu.xom.Namespace(node.getLocalPart(), node.getStringValue(), (Element) convertNodeInfo(node.getParent()));
        break;
View Full Code Here

        log("", new DocType(rootElementName, publicID, systemID));
        return child.makeDocType(rootElementName, publicID, systemID);
      }
 
      public Nodes makeProcessingInstruction(String target, String data) {
        log("", new ProcessingInstruction(target, data));
        return child.makeProcessingInstruction(target, data);
      }
     
      public Nodes makeText(String text) {
        log("", new Text(text));
View Full Code Here

      }
 
      public Nodes makeProcessingInstruction(String target, String data) {
        flush();
        try {
          serializer.write(new ProcessingInstruction(target, data));
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
        return NONE;
      }
View Full Code Here

          build(elem, factory, root);
          nodes = factory.finishMakingElement(root);
        } else if (child instanceof Comment) {
          nodes = factory.makeComment(child.getValue());
        } else if (child instanceof ProcessingInstruction) {
          ProcessingInstruction pi = (ProcessingInstruction) child;
          nodes = factory.makeProcessingInstruction(
            pi.getTarget(), pi.getValue());
        } else if (child instanceof DocType) {
          DocType docType = (DocType) child;
          nodes = factory.makeDocType(
              docType.getRootElementName(),
              docType.getPublicID(),
View Full Code Here

        } else if (child instanceof Text) {
          nodes = factory.makeText(child.getValue());
        } else if (child instanceof Comment) {
          nodes = factory.makeComment(child.getValue());
        } else if (child instanceof ProcessingInstruction) {
          ProcessingInstruction pi = (ProcessingInstruction) child;
          nodes = factory.makeProcessingInstruction(
            pi.getTarget(), pi.getValue());
        } else {
          throw new IllegalArgumentException("Unrecognized node type");
        }
       
        appendNodes(result, nodes);
View Full Code Here

        Element parent = new Element("Test");
        Element child = new Element("child");
        parent.appendChild(child);
        grandparent.appendChild(parent);
       
        ProcessingInstruction p1 = new ProcessingInstruction("c1", "1");
        ProcessingInstruction p2 = new ProcessingInstruction("c1", "2");
        ProcessingInstruction p3 = new ProcessingInstruction("c1", "3");
        ProcessingInstruction p4 = new ProcessingInstruction("c1", "4");
       
        doc.insertChild(p1, 0);
        grandparent.insertChild(p2, 0);
        parent.insertChild(p3, 0);
        child.insertChild(p4, 0);
View Full Code Here

       
        doc.insertChild(c1, 0);
        grandparent.insertChild(c2, 0);
        parent.insertChild(c3, 0);
        child.insertChild(c4, 0);
        ProcessingInstruction pi = new ProcessingInstruction("appendix", "text");
        doc.appendChild(pi);
        ProcessingInstruction pi2 = new ProcessingInstruction("test", "text");
        parent.appendChild(pi2);
       
        Nodes result = doc.query("descendant::processing-instruction('test')");
        assertEquals(1, result.size());
        assertEquals(pi2, result.get(0));
View Full Code Here

TOP

Related Classes of nu.xom.ProcessingInstruction

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.