Package org.dom4j

Examples of org.dom4j.DocumentType


            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
            }
            else if ("systemId".equals(localName)) {
                result.add(new DefaultAttribute("systemId", doctype.getSystemID()));
            }
            else if ("elementName".equals(localName)) {
                result.add(new DefaultAttribute("elementName", doctype.getElementName()));
            }
        }
    }
View Full Code Here


   * Get the structure as an XML Document.
   * @return XML Document.
   */
  public Document getDocument() {
    Document tmp = DocumentHelper.createDocument();
    DocumentType type = new DOMDocumentType();
    type.setElementName(DOCUMENT_ROOT);
    type.setSystemID(DOCUMENT_DTD);
   
    tmp.setDocType(type);
    Element questestinterop = tmp.addElement(DOCUMENT_ROOT);
    this.assessment.addToElement(questestinterop);
    return tmp;
View Full Code Here

        }

        List items = null;

        if (doc != null && xml) {
            DocumentType docType = doc.getDocType();

            if (docType != null && "svn".equalsIgnoreCase(docType.getName())) {
                items = new ArrayList();

                addNodes(items, doc.selectNodes("//dir/@name"), true);
                addNodes(items, doc.selectNodes("//file/@name"), false);
            }
View Full Code Here

            }
            else {
                result.add(new DefaultAttribute(localName, pi.getValue(localName)));
            }
        } else if (node instanceof DocumentType) {
            DocumentType doctype = (DocumentType)node;
            if ("publicId".equals(localName)) {
                result.add(new DefaultAttribute("publicId", doctype.getPublicID()));
            }
            else if ("systemId".equals(localName)) {
                result.add(new DefaultAttribute("systemId", doctype.getSystemID()));
            }
            else if ("elementName".equals(localName)) {
                result.add(new DefaultAttribute("elementName", doctype.getElementName()));
            }
        }
    }
View Full Code Here

        return chain;
    }

    private void handleDocType(Document document, WidgetChain chain) {
        DocumentType docType = document.getDocType();
        if (docType != null) {
            String docTypeRawXml = document.getDocType().asXML();
            try {
                chain.addWidget(registry.textWidget(Dom.stripAnnotation(docTypeRawXml), lexicalScopes.peek()));
            } catch (ExpressionCompileException e) {
View Full Code Here

        }

        List items = null;

        if (doc != null && xml) {
            DocumentType docType = doc.getDocType();

            if (docType != null && "svn".equalsIgnoreCase(docType.getName())) {
                items = new ArrayList();

                addNodes(items, doc.selectNodes("//dir/@name"), true);
                addNodes(items, doc.selectNodes("//file/@name"), false);
            }
View Full Code Here

    }

    public void endDTD() throws SAXException {
        insideDTDSection = false;

        DocumentType docType = getDocument().getDocType();

        if (docType != null) {
            if (internalDTDDeclarations != null) {
                docType.setInternalDeclarations(internalDTDDeclarations);
            }

            if (externalDTDDeclarations != null) {
                docType.setExternalDeclarations(externalDTDDeclarations);
            }
        }

        internalDTDDeclarations = null;
        externalDTDDeclarations = null;
View Full Code Here

    protected void documentLocator(Document document) throws SAXException {
        LocatorImpl locator = new LocatorImpl();

        String publicID = null;
        String systemID = null;
        DocumentType docType = document.getDocType();

        if (docType != null) {
            publicID = docType.getPublicID();
            systemID = docType.getSystemID();
        }

        if (publicID != null) {
            locator.setPublicId(publicID);
        }
View Full Code Here

        contentHandler.setDocumentLocator(locator);
    }

    protected void entityResolver(Document document) throws SAXException {
        if (entityResolver != null) {
            DocumentType docType = document.getDocType();

            if (docType != null) {
                String publicID = docType.getPublicID();
                String systemID = docType.getSystemID();

                if ((publicID != null) || (systemID != null)) {
                    try {
                        entityResolver.resolveEntity(publicID, systemID);
                    } catch (IOException e) {
View Full Code Here

     *            <code>Visitor</code> is the visitor.
     */
    public void accept(Visitor visitor) {
        visitor.visit(this);

        DocumentType docType = getDocType();

        if (docType != null) {
            visitor.visit(docType);
        }

View Full Code Here

TOP

Related Classes of org.dom4j.DocumentType

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.