Package org.w3c.dom

Examples of org.w3c.dom.DocumentType


     */
    public void doctypeDecl(String rootElement, String publicId, String systemId)
        throws SAXException {
       
        DocumentImpl docimpl = (DocumentImpl)fDocument;
        DocumentType doctype = docimpl.createDocumentType(rootElement, publicId, systemId);
        fCurrentNode.appendChild(doctype);

    } // doctypeDecl(String,String,String)
View Full Code Here


        {
          throw new IllegalArgumentException(arg0);
        }
      });
      xmldoc = db.parse(file);
      DocumentType outDoctype = xmldoc.getDoctype();
      if (!"message".equals(outDoctype.getName())) { throw new IllegalArgumentException("Wrong DOCTYPE - Have to be message!"); }
      if (!"smssvr_out.dtd".equals(outDoctype.getSystemId())) { throw new IllegalArgumentException("Wrong SystemId in DOCTYPE - Have to be smssvr_out.dtd!"); }
    }
    catch (Exception e)
    {
      throw new IllegalArgumentException(e);
    }
View Full Code Here

   * @return
   */
  private Document createHTMLDocument(Document cruxPageDocument)
    {
      Document htmlDocument;
    DocumentType doctype = cruxPageDocument.getDoctype();
   
    if (doctype != null || Boolean.parseBoolean(ConfigurationFactory.getConfigurations().enableGenerateHTMLDoctype()))
    {
      String name     = doctype != null ? doctype.getName() : "HTML";
      String publicId = doctype != null ? doctype.getPublicId() : null;
      String systemId = doctype != null ? doctype.getSystemId() : null;
     
      DocumentType newDoctype =  documentBuilder.getDOMImplementation().createDocumentType(name, publicId, systemId);
      htmlDocument = documentBuilder.getDOMImplementation().createDocument(XHTML_NAMESPACE, "html", newDoctype);
    }
    else
    {
      htmlDocument = documentBuilder.newDocument();
View Full Code Here

   * @param out
   * @throws IOException
   */
  private void write(Document htmlDocument, Writer out) throws IOException
  {
    DocumentType doctype = htmlDocument.getDoctype();
   
    if (doctype != null)
    {
      out.write("<!DOCTYPE " + doctype.getName() + ">\n");
    }
      HTMLUtils.write(htmlDocument.getDocumentElement(), out, indentOutput);
  }
View Full Code Here

            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            DOMImplementation domImpl = documentBuilder.getDOMImplementation();
            DocumentType docType = domImpl.createDocumentType(name, publicIdentifier, systemIdentifier);
            Document document = domImpl.createDocument(null, name, docType);
            return document;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
View Full Code Here

            DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
            documentBuilderFactory.setNamespaceAware(true);
            DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
            DOMImplementation domImpl = documentBuilder.getDOMImplementation();
            DocumentType docType = domImpl.createDocumentType(name, null, systemIdentifier);
            document = domImpl.createDocument(null, name, docType);
            return document;
        } catch (Exception e) {
            throw XMLPlatformException.xmlPlatformCouldNotCreateDocument(e);
        }
View Full Code Here

    else
      doc = m_root.getOwnerDocument();

    if (null != doc)
    {
      DocumentType dtd = doc.getDoctype();

      if (null != dtd)
      {
        return dtd.getSystemId();
      }
    }

    return null;
  }
View Full Code Here

    else
      doc = m_root.getOwnerDocument();

    if (null != doc)
    {
      DocumentType dtd = doc.getDoctype();

      if (null != dtd)
      {
        return dtd.getPublicId();
      }
    }

    return null;
  }
View Full Code Here

    Document doc = (m_root.getNodeType() == Node.DOCUMENT_NODE)
        ? (Document) m_root : m_root.getOwnerDocument();

    if (null != doc)
    {
      DocumentType doctype = doc.getDoctype();
 
      if (null != doctype)
      {
        NamedNodeMap entities = doctype.getEntities();
        if(null == entities)
          return url;
        Entity entity = (Entity) entities.getNamedItem(name);
        if(null == entity)
          return url;
View Full Code Here

    public String getUnparsedEntityURI(String name)
    {
        // Special handling for DOM input
        if (_document != null) {
            String uri = "";
            DocumentType doctype = _document.getDoctype();
            if (doctype != null) {
                NamedNodeMap entities = doctype.getEntities();
               
                if (entities == null) {
                    return uri;
                }
               
View Full Code Here

TOP

Related Classes of org.w3c.dom.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.