Package org.jsoup.parser

Examples of org.jsoup.parser.Token$Doctype


  }

  @Test
  public void testOutputDocTypeInternalSubset() {
    String dec = "<!DOCTYPE root [\ninternal]>";
    DocType dt = new DocType("root");
    dt.setInternalSubset("internal");
    checkOutput(dt, dec, dec, dec, dec, dec);
  }
View Full Code Here


  }

  @Test
  public void testOutputDocTypeSystem() {
    String dec = "<!DOCTYPE root SYSTEM \"systemID\">";
    checkOutput(new DocType("root", "systemID"), dec, dec, dec, dec, dec);
  }
View Full Code Here

  }

  @Test
  public void testOutputDocTypePublic() {
    String dec = "<!DOCTYPE root PUBLIC \"publicID\">";
    checkOutput(new DocType("root", "publicID", null), dec, dec, dec, dec, dec);
  }
View Full Code Here

  }

  @Test
  public void testOutputDocTypePublicSystem() {
    String dec = "<!DOCTYPE root PUBLIC \"publicID\" \"systemID\">";
    checkOutput(new DocType("root", "publicID", "systemID"), dec, dec, dec, dec, dec);
  }
View Full Code Here

        rtdec + "\n");
  }

  @Test
  public void testOutputDocumentFull() {
    DocType dt = new DocType("root");
    Comment comment = new Comment("comment");
    ProcessingInstruction pi = new ProcessingInstruction("jdomtest", "");
    Element root = new Element("root");
    Document doc = new Document();
    doc.addContent(dt);
View Full Code Here

  }
 
  @Test
  public void testDeepNesting() {
    // need to get beyond 16 levels of XML.
    DocType dt = new DocType("root");
    Element root = new Element("root");
    Document doc = new Document();
    doc.addContent(dt);
    doc.addContent(root);
    String xmldec = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
View Full Code Here

          //            document.setProperty("ENCODING",
          //                ((StartDocument)event).getEncoding());
        } else if (event instanceof javax.xml.stream.events.DTD) {
          //List<?> list = (List<?>)reader.getProperty("javax.xml.stream.entities");
          //System.out.println(list);
          final DocType dtype = DTDParser.parse(((javax.xml.stream.events.DTD)event).getDocumentTypeDeclaration(), factory);
          document.setDocType(dtype);
        } else if (event.isStartElement()) {
          final Element emt = processElement(factory, event.asStartElement());
          if (current == null) {
            document.setRootElement(emt);
            final DocType dt = document.getDocType();
            if (dt != null) {
              dt.setElementName(emt.getName());
            }
          } else {
            current.addContent(emt);
          }
          current = emt;
View Full Code Here

        super(type,version);
    }

    protected Document createDocument(Element root) {
        Document doc = new Document(root);
        DocType docType = new DocType(RSS091NetscapeParser.ELEMENT_NAME,
                                      RSS091NetscapeParser.PUBLIC_ID,
                                      RSS091NetscapeParser.SYSTEM_ID);
        doc.setDocType(docType);
        return doc;
    }
View Full Code Here

    public Api2XmlConverter()
    {
        xmlOutputter = new XMLOutputter();
        doc = new Document();
        doc.setDocType(new DocType("xml"));
        doc.setProperty("version", "1.0");
        doc.setProperty("encoding", "UTF-8");
    }
View Full Code Here

    public Api1XmlConverter()
    {
        xmlOutputter = new XMLOutputter();
        doc = new Document();
        doc.setDocType(new DocType("xml"));
        doc.setProperty("version", "1.0");
        doc.setProperty("encoding", "UTF-8");
    }
View Full Code Here

TOP

Related Classes of org.jsoup.parser.Token$Doctype

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.