Examples of DocType


Examples of nu.xom.DocType

      throws ParsingException, IOException {
       
        String data = "<!DOCTYPE root [ <!ELEMENT root EMPTY> ]><test/>";  
        Builder builder = new Builder();
        Document doc = builder.build(data, "http://www.example.com");
        DocType doctype = doc.getDocType();
        assertEquals("root", doctype.getRootElementName());
        String internalSubset =   doctype.getInternalDTDSubset();
        assertEquals("  <!ELEMENT root EMPTY>\n", internalSubset);
        assertTrue(doctype.toXML().indexOf("[") > 0);
        assertTrue(doctype.toXML().indexOf("]") > 0);
        assertTrue(doctype.toXML().indexOf("<!ELEMENT root EMPTY>") > 0);
       
    }
View Full Code Here

Examples of nu.xom.DocType

   
    public void testConstructor1Arg() {

        String name = "MyName";
        DocType doctype = new DocType(name);
        assertEquals(name, doctype.getRootElementName());
        assertEquals("", doctype.getInternalDTDSubset());
        assertNull(doctype.getSystemID());
        assertNull(doctype.getPublicID());

        // legal to have a colon here
        name = "try:MyName";
        doctype = new DocType(name);
        assertEquals("", doctype.getInternalDTDSubset());
        assertEquals(name, doctype.getRootElementName());
        assertNull(doctype.getSystemID());
        assertNull(doctype.getPublicID());

        // illegal name
        try {
            name = "try MyName";
            doctype = new DocType(name);
            fail("allowed root element name to contain spaces");
        }
        catch (IllegalNameException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

Examples of nu.xom.DocType

   
    public void testNullRootElementName() {
       
        try {
            new DocType((String) null);
            fail("Allowed null root element name");
        }
        catch (IllegalNameException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

Examples of nu.xom.DocType

   
    public void testRootElementNameBeginsWithDigit() {
       
        try {
            new DocType("1Data");
            fail("Allowed non-namestart character in root element name");
        }
        catch (IllegalNameException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

Examples of nu.xom.DocType

   
    public void testRootElementNameBeginsWithColon() {
       
        try {
            new DocType(":Data");
            fail("Allowed colon to begin root element name");
        }
        catch (IllegalNameException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

Examples of nu.xom.DocType

    }

   
    public void testSetRootElementName() {
       
        DocType doctype = new DocType("root");
        doctype.setRootElementName("newname");
        assertEquals("newname", doctype.getRootElementName());
        doctype.setRootElementName("new:name");
        assertEquals("new:name", doctype.getRootElementName());
        try {
            doctype.setRootElementName(":Data");
            fail("Allowed colon to begin root element name");
        }
        catch (IllegalNameException success) {
            assertNotNull(success.getMessage());
        }
View Full Code Here

Examples of nu.xom.DocType

    }

   
    public void testAllowEmptyInternalDTDSubset() {
       
        DocType doctype = new DocType("root");
        doctype.setInternalDTDSubset("");
        assertEquals("", doctype.getInternalDTDSubset());
       
    }
View Full Code Here

Examples of org.apache.beehive.netui.util.config.bean.DocType

        return requestInterceptorsConfig;
    }

    private static final JspTagConfig parseJspTagConfig(Document document) {
        DocType docType = null;
        IdJavascript idJavascript = null;
        String treeImageLocation = null;

        String tmp = null;
        Element elem = DomUtils.getChildElementByName(document.getDocumentElement(), "jsp-tag-config");
View Full Code Here

Examples of org.apache.cocoon.components.serializers.util.DocType

     * Report the start of DTD declarations, if any.
     */
    public void startDTD(String name, String public_id, String system_id)
    throws SAXException {
        this.processing_dtd = true;
        this.doctype = new DocType(name, public_id, system_id);
    }
View Full Code Here

Examples of org.apache.ecs.Doctype

                    break;
                }
            case 2:
                {
                    data.getPage()
                        .setDoctype(new Doctype()
                                    .setIdentifier((String) doctypeProperty.get(0))
                                    .setUri((String) doctypeProperty.get(1)));
                    break;
                }
            default:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.