Package org.w3c.dom

Examples of org.w3c.dom.DocumentType


      // Verify J2EE-1.4
      String nsURI = element.getOwnerDocument().getDocumentElement().getNamespaceURI();
      boolean isValid = "http://java.sun.com/xml/ns/j2ee".equals(nsURI);

      // Verify JBoss-4.0
      DocumentType doctype = element.getOwnerDocument().getDoctype();
      if (isValid == false && doctype != null)
      {
         String publicId = doctype.getPublicId();
         isValid |= "-//JBoss//DTD JBOSS 4.0//EN".equals(publicId);
         isValid |= "-//JBoss//DTD JBOSS 4.2//EN".equals(publicId);
         isValid |= "-//JBoss//DTD Web Application 2.4//EN".equals(publicId);
         isValid |= "-//JBoss//DTD Application Client 4.0//EN".equals(publicId);
         isValid |= "-//JBoss//DTD Application Client 4.2//EN".equals(publicId);
      }

      if (isValid == false)
      {
         String dtstr = (doctype != null ? "[public=" + doctype.getPublicId() + ",system=" + doctype.getSystemId() + "]" : null);
         log.debug("Skip <service-ref> for: nsURI=" + nsURI + ",doctype=" + dtstr);
      }
      return isValid;
   }
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

                // forbid it for the sake of being compliant to the DOM spec
                if (!cloningDoc) {
                    String msg = DOMMessageFormatter.formatMessage(DOMMessageFormatter.DOM_DOMAIN, "NOT_SUPPORTED_ERR", null);
                    throw new DOMException(DOMException.NOT_SUPPORTED_ERR, msg);
                }
                DocumentType srcdoctype = (DocumentType)source;
                DocumentTypeImpl newdoctype = (DocumentTypeImpl)
                    createDocumentType(srcdoctype.getNodeName(),
                                       srcdoctype.getPublicId(),
                                       srcdoctype.getSystemId());
                // Values are on NamedNodeMaps
                NamedNodeMap smap = srcdoctype.getEntities();
                NamedNodeMap tmap = newdoctype.getEntities();
                if(smap != null) {
                    for(int i = 0; i < smap.getLength(); i++) {
                        tmap.setNamedItem(importNode(smap.item(i), true, true,
                                                     reversedIdentifiers));
                    }
                }
                smap = srcdoctype.getNotations();
                tmap = newdoctype.getNotations();
                if (smap != null) {
                    for(int i = 0; i < smap.getLength(); i++) {
                        tmap.setNamedItem(importNode(smap.item(i), true, true,
                                                     reversedIdentifiers));
View Full Code Here

  else{
      try{
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder= builderFactory.newDocumentBuilder();
    DOMImplementation domImpl = builder.getDOMImplementation();
    DocumentType docType =domImpl.createDocumentType("office:document","-//OpenOffice.org//DTD OfficeDocument 1.0//EN",null);
    org.w3c.dom.Document newDoc = domImpl.createDocument("http://openoffice.org/2000/office","office:document",null);
   
   
    Element rootElement=newDoc.getDocumentElement();
    rootElement.setAttribute("xmlns:office","http://openoffice.org/2000/office");
View Full Code Here

   
        try {
            DocumentBuilder builder = factory.newDocumentBuilder();
            DOMImplementation domImpl = builder.getDOMImplementation();

            DocumentType docType = domImpl.createDocumentType(TAG_MANIFEST_ROOT,
                                        "-//OpenOffice.org//DTD Manifest 1.0//EN",
                                        "Manifest.dtd");
      manifestDoc = domImpl.createDocument("manifest", TAG_MANIFEST_ROOT, docType);
        } catch (ParserConfigurationException ex) {
            throw new OfficeDocumentException(ex);
View Full Code Here

  else{
      try{
    DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
    DocumentBuilder builder= builderFactory.newDocumentBuilder();
    DOMImplementation domImpl = builder.getDOMImplementation();
    DocumentType docType =domImpl.createDocumentType("office:document","-//OpenOffice.org//DTD OfficeDocument 1.0//EN",null);
    org.w3c.dom.Document newDoc = domImpl.createDocument("http://openoffice.org/2000/office","office:document",null);
   
   
    Element rootElement=newDoc.getDocumentElement();
    rootElement.setAttribute("xmlns:office","http://openoffice.org/2000/office");
View Full Code Here

   
        try {
            DocumentBuilder builder = factory.newDocumentBuilder();
            DOMImplementation domImpl = builder.getDOMImplementation();

            DocumentType docType = domImpl.createDocumentType(TAG_MANIFEST_ROOT,
                                        "-//OpenOffice.org//DTD Manifest 1.0//EN",
                                        "Manifest.dtd");
      manifestDoc = domImpl.createDocument("manifest", TAG_MANIFEST_ROOT, docType);
        } catch (ParserConfigurationException ex) {
            throw new OfficeDocumentException(ex);
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.