Package org.jdom

Examples of org.jdom.DocType


     *
     * @throws Exception If an unexpected error occurs
     */
    public void testValueOfDocType22() throws Exception
    {
        DocType docType = new DocType("web-app",
                WebXmlVersion.V2_2.getPublicId(), WebXmlVersion.V2_2.getSystemId());
        assertEquals(WebXmlVersion.V2_2, WebXmlVersion.valueOf(docType));
    }
View Full Code Here


     *
     * @throws Exception If an unexpected error occurs
     */
    public void testValueOfDocType23() throws Exception
    {
        DocType docType = new DocType("web-app",
                WebXmlVersion.V2_3.getPublicId(), WebXmlVersion.V2_3.getSystemId());
        assertEquals(WebXmlVersion.V2_3, WebXmlVersion.valueOf(docType));
    }
View Full Code Here

                else if ("data".equals(localName))
                    attr = new Attribute("data", pi.getData());
                else
                    attr = new Attribute(localName, pi.getValue(localName));
            } else if (node instanceof DocType) {
                DocType doctype = (DocType)node;
                if ("publicId".equals(localName))
                    attr = new Attribute("publicId", doctype.getPublicID());
                else if ("systemId".equals(localName))
                    attr = new Attribute("systemId", doctype.getSystemID());
                else if ("elementName".equals(localName))
                    attr = new Attribute("elementName", doctype.getElementName());
            }
            // With 2.1 semantics it  makes more sense to just return a null and let the core
            // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
            else {
                return null;
View Full Code Here

    private static final class DocTypeOp implements NodeOperator {
        public List operate(Object node)
        {
            if (node instanceof Document) {
                DocType doctype = ((Document)node).getDocType();
                return doctype == null ? Collections.EMPTY_LIST : Collections.singletonList(doctype);
            } else
                // With 2.1 semantics it  makes more sense to just return a null and let the core
                // throw an InvalidReferenceException and the template writer can use ?exists etcetera. (JR)
                return null;
View Full Code Here

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

    html.addContent(new Element("head", XhtmlParser.XHTML_NS));
    Element body = new Element("body", XhtmlParser.XHTML_NS);
    body.addContent(content);
    html.addContent(body);
    Document doc = new Document();
    doc.setDocType(new DocType("html",XhtmlTestCase.publicId,XhtmlTestCase.systemId));
    doc.addContent(html);
    return doc;
  }
View Full Code Here

        super(type,version);
    }

    protected Document createDocument(Element root) {
        Document doc = new Document(root);
        DocType docType = new DocType(RSS091NetscapeParser.ELEMENT_NAME,
                                      RSS091NetscapeParser.PUBLIC_ID,
                                      RSS091NetscapeParser.SYSTEM_ID);
        doc.setDocType(docType);
        return doc;
    }
View Full Code Here

          rootElement.addContent(lastIndex, newConverters);
        }
        if (!newValidators.isEmpty()) {
          rootElement.addContent(newValidators);
        }
        document.setDocType(new DocType("faces-config",
            "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
            "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));

        writer =
            getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);
View Full Code Here

      }
      if (!newValidators.isEmpty()) {
        rootElement.addContent(newValidators);
      }
      if (is11()) {
        document.setDocType(new DocType("faces-config",
            "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
           "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));
      }
      writer =
          getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);
View Full Code Here

      }
      if (!newValidators.isEmpty()) {
        rootElement.addContent(newValidators);
      }
      if (is11()) {
        document.setDocType(new DocType("faces-config",
            "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN",
           "http://java.sun.com/dtd/web-facesconfig_1_1.dtd"));
      }
      writer =
          getEnv().getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File(targetFacesConfigFile), null);
View Full Code Here

TOP

Related Classes of org.jdom.DocType

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.