public Nodes makeDocType(String rootElementName, String publicID, String systemID) { flush(); try { serializer.write(new DocType(rootElementName, publicID, systemID)); } catch (IOException e) { throw new RuntimeException(e); } return NONE; }
/** Does not pack indexes of doctype (infrequent anyway) */ final void writeDocType(DocType docType) { nodeTokens.add((byte)DOC_TYPE); writeIndex(docType.getRootElementName()); writeIndex(docType.getPublicID() == null ? DOCTYPE_NULL_ID : docType.getPublicID()); writeIndex(docType.getSystemID() == null ? DOCTYPE_NULL_ID : docType.getSystemID()); writeIndex(docType.getInternalDTDSubset() == null ? "" : docType.getInternalDTDSubset()); }
/** Does not pack indexes of doctype (infrequent anyway) */ private Nodes readDocTypeF(ArrayByteList src) { String rootElementName = symbols[src.getInt()]; String publicID = symbols[src.getInt()]; if (DOCTYPE_NULL_ID.equals(publicID)) publicID = null; String systemID = symbols[src.getInt()]; if (DOCTYPE_NULL_ID.equals(systemID)) systemID = null; String internalDTDSubset = symbols[src.getInt()]; if (internalDTDSubset.length() == 0) internalDTDSubset = null; Nodes nodes = factory.makeDocType(rootElementName, publicID, systemID); for (int i=0; i < nodes.size(); i++) { if (nodes.get(i) instanceof DocType) { DocType docType = (DocType) nodes.get(i); if (docType.getInternalDTDSubset().length() == 0) { try { docType.setInternalDTDSubset(internalDTDSubset); } catch (IllegalAccessError e) { ; // ignore; setInternalDTDSubset() is private in xom < 1.1 } } } } return nodes; }
/** Does not pack indexes of doctype (infrequent anyway) */ private Nodes readDocTypeF(ArrayByteList src) { String rootElementName = symbols[src.getInt()]; String publicID = symbols[src.getInt()]; if (DOCTYPE_NULL_ID.equals(publicID)) publicID = null; String systemID = symbols[src.getInt()]; if (DOCTYPE_NULL_ID.equals(systemID)) systemID = null; String internalDTDSubset = symbols[src.getInt()]; if (internalDTDSubset.length() == 0) internalDTDSubset = null; Nodes nodes = factory.makeDocType(rootElementName, publicID, systemID); for (int i=0; i < nodes.size(); i++) { if (nodes.get(i) instanceof DocType) { DocType docType = (DocType) nodes.get(i); if (docType.getInternalDTDSubset().length() == 0) { try { docType.setInternalDTDSubset(internalDTDSubset); } catch (IllegalAccessError e) { ; // ignore; setInternalDTDSubset() is private in xom < 1.1 } } } } return nodes; }
/** Does not pack indexes of doctype (infrequent anyway) */ final void writeDocType(DocType docType) { nodeTokens.add((byte)DOC_TYPE); writeIndex(docType.getRootElementName()); writeIndex(docType.getPublicID() == null ? DOCTYPE_NULL_ID : docType.getPublicID()); writeIndex(docType.getSystemID() == null ? DOCTYPE_NULL_ID : docType.getSystemID()); writeIndex(docType.getInternalDTDSubset() == null ? "" : docType.getInternalDTDSubset()); }
public Nodes makeDocType(String rootElementName, String publicID, String systemID) { flush(); try { serializer.write(new DocType(rootElementName, publicID, systemID)); } catch (IOException e) { throw new RuntimeException(e); } return NONE; }
e.appendChild(docType.getRootElementName()); item.appendChild(e); if (docType.getPublicID() != null) { e = new Element("publicID"); e.appendChild(docType.getPublicID()); item.appendChild(e); if (docType.getSystemID() != null) { e = new Element("systemID"); e.appendChild(docType.getSystemID()); item.appendChild(e); if (docType.getInternalDTDSubset().length() > 0) { e = new Element("internalDTDSubset"); e.appendChild(docType.getInternalDTDSubset()); item.appendChild(e);
static Document newDocument() { final DocType dt = new DocType( "html", "-//W3C//DTD XHTML 1.0 Strict//EN", "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); final Element root = new Element("html", SXHTML.XHTML_URI.toString()); final Document d = new Document(root); d.setDocType(dt); return d; }
e.appendChild(docType.getRootElementName()); item.appendChild(e); if (docType.getPublicID() != null) { e = new Element("publicID"); e.appendChild(docType.getPublicID()); item.appendChild(e); if (docType.getSystemID() != null) { e = new Element("systemID"); e.appendChild(docType.getSystemID()); item.appendChild(e); if (docType.getInternalDTDSubset().length() > 0) { e = new Element("internalDTDSubset"); e.appendChild(docType.getInternalDTDSubset()); item.appendChild(e);
try (final OutputStream output = Files.newOutputStream(file_output)) { final Document doc = new Document(site.document()); doc.setDocType(new DocType( "html", "-//W3C//DTD XHTML 1.0 Strict//EN",