Package org.dom4j.dtd

Examples of org.dom4j.dtd.ElementDecl


   * @throws SAXException The application may raise an exception.
   */
  public void elementDecl(String name, String model) throws SAXException {
    if (internalDTDsubset) {
      if (includeInternalDTDDeclarations) {
        addDTDDeclaration(new ElementDecl(name, model));
      }
    } else {
      if (includeExternalDTDDeclarations) {
        addExternalDTDDeclaration(new ElementDecl(name, model));
      }
    }
  }
View Full Code Here


     *                The application may raise an exception.
     */
    public void elementDecl(String name, String model) throws SAXException {
        if (internalDTDsubset) {
            if (includeInternalDTDDeclarations) {
                addDTDDeclaration(new ElementDecl(name, model));
            }
        } else {
            if (includeExternalDTDDeclarations) {
                addExternalDTDDeclaration(new ElementDecl(name, model));
            }
        }
    }
View Full Code Here

        List declarations = docType.getInternalDeclarations();
        assertTrue("DOCTYPE has declarations", (declarations != null)
                && !declarations.isEmpty());

        ElementDecl decl = (ElementDecl) declarations.get(0);

        assertEquals("name is correct", "greeting", decl.getName());
        assertEquals("model is correct", "(#PCDATA)", decl.getModel());

        String expected = "<!ELEMENT " + decl.getName() + " " + decl.getModel()
                + ">";
        assertEquals("toString() is correct", expected, decl.toString());
    }
View Full Code Here

     * @return DOCUMENT ME!
     */
    protected List getInternalDeclarations() {
        List decls = new ArrayList();

        decls.add(new ElementDecl("greeting", "(#PCDATA)"));

        decls.add(new AttributeDecl("greeting", "foo", "ID", "#IMPLIED", null));

        decls.add(new InternalEntityDecl("%boolean", "( true | false )"));

View Full Code Here

     * @return DOCUMENT ME!
     */
    protected List getExternalDeclarations() {
        List decls = new ArrayList();

        decls.add(new ElementDecl("another-greeting", "(#PCDATA)"));

        return decls;
    }
View Full Code Here

/*     */   public void elementDecl(String name, String model)
/*     */     throws SAXException
/*     */   {
/* 458 */     if (this.internalDTDsubset) {
/* 459 */       if (this.includeInternalDTDDeclarations) {
/* 460 */         addDTDDeclaration(new ElementDecl(name, model));
/*     */       }
/*     */     }
/* 463 */     else if (this.includeExternalDTDDeclarations)
/* 464 */       addExternalDTDDeclaration(new ElementDecl(name, model));
/*     */   }
View Full Code Here

TOP

Related Classes of org.dom4j.dtd.ElementDecl

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.