/** * This signifies that the reading of the DTD is complete. */ @Override public void endDTD() { currentDocument.getDocType().setInternalSubset( internalSubset.toString()); inDTD = false; inInternalSubset = false; }
/** * This converts the JDOM <code>Document</code> parameter to a DOM Document, * returning the DOM version. The DOM implementation is the one supplied by * the current DOMAdapter. * * @param document * <code>Document</code> to output. * @return an <code>org.w3c.dom.Document</code> version * @throws JDOMException * if output failed. */ public org.w3c.dom.Document output(Document document) throws JDOMException { return processor.process(adapter.createDocument(document.getDocType()), format, document); }
.append("[Document: "); DocType docType = getDocType(); if (docType != null) { stringForm.append(docType.toString())
private final SAXTarget buildTarget(Document doc) { String publicID = null; String systemID = null; if (doc != null) { DocType dt = doc.getDocType(); if (dt != null) { publicID = dt.getPublicID(); systemID = dt.getSystemID(); } } return new SAXTarget(contentHandler, errorHandler, dtdHandler, entityResolver, lexicalHandler, declHandler, declareNamespaces, reportDtdEvents, publicID, systemID); }
printDocType(out, fstack, document.getDocType());
if (current == null) { document.setRootElement(emt); final DocType dt = document.getDocType(); if (dt != null) { dt.setElementName(emt.getName());
@Override public boolean isMyType(final Document document) { final Element rssRoot = document.getRootElement(); final String name = rssRoot.getName(); final Attribute version = rssRoot.getAttribute("version"); final DocType docType = document.getDocType(); return name.equals(ELEMENT_NAME) && version != null && version.getValue().equals(getRSSVersion()) && docType != null && ELEMENT_NAME.equals(docType.getElementName()) && PUBLIC_ID.equals(docType.getPublicID()) && SYSTEM_ID.equals(docType.getSystemID()); }
@Override public boolean isMyType(final Document document) { final Element rssRoot = document.getRootElement(); final String name = rssRoot.getName(); final Attribute version = rssRoot.getAttribute("version"); final DocType docType = document.getDocType(); return name.equals(ELEMENT_NAME) && version != null && version.getValue().equals(getRSSVersion()) && docType != null && ELEMENT_NAME.equals(docType.getElementName()) && PUBLIC_ID.equals(docType.getPublicID()) && SYSTEM_ID.equals(docType.getSystemID()); }
public boolean isMyType(Document document) { boolean ok = false; Element rssRoot = document.getRootElement(); ok = rssRoot.getName().equals("rss"); if (ok) { ok = false; Attribute version = rssRoot.getAttribute("version"); if (version!=null) { ok = version.getValue().equals(getRSSVersion()); if (ok) { ok = false; DocType docType = document.getDocType(); if (docType!=null) { ok = ELEMENT_NAME.equals(docType.getElementName()); ok = ok && PUBLIC_ID.equals(docType.getPublicID()); ok = ok && SYSTEM_ID.equals(docType.getSystemID()); } } } } return ok; }
public boolean isMyType(Document document) { boolean ok = false; Element rssRoot = document.getRootElement(); ok = rssRoot.getName().equals("rss"); if (ok) { ok = false; Attribute version = rssRoot.getAttribute("version"); if (version!=null) { ok = version.getValue().equals(getRSSVersion()); if (ok) { ok = false; DocType docType = document.getDocType(); if (docType!=null) { ok = ELEMENT_NAME.equals(docType.getElementName()); ok = ok && PUBLIC_ID.equals(docType.getPublicID()); ok = ok && SYSTEM_ID.equals(docType.getSystemID()); } } } } return ok; }
if (element.getDocument().getDocType() != null) String systemId = element.getDocument().getDocType().getSystemID();
/** * Performs the actual merge. * * @param docs The documents to merge. The first doc is assumed to be the original one to apply patches against. * @return The merged result document * @throws AbstractXmlMergeException If an error occurred during the merge */ private Document doMerge(Document[] docs) throws AbstractXmlMergeException { Document originalDoc = docs[0]; Element origRootElement = originalDoc.getRootElement(); for (int i = 1; i < docs.length; i++) { Element comparedRootElement = docs[i].getRootElement(); Document output = new Document(); if (originalDoc.getDocType() != null) { output.setDocType((DocType) originalDoc.getDocType().clone()); } output.setRootElement(new Element("root")); Element outputRootElement = output.getRootElement(); m_rootMergeAction.perform(origRootElement, comparedRootElement, outputRootElement); Element root = (Element) outputRootElement.getChildren().get(0); root.detach(); sortRootChildrenRecursive(root); originalDoc.setRootElement(root); } return originalDoc; }
DocType doctype = sourceDocument.getDocType(); Element root = sourceDocument.getRootElement(); List<Element> elements = new ArrayList<Element>();
DocType doctype = inputDocument.getDocType(); List<Element> elements = getElements(inputDocument); for (Element element : elements) {