Example usage for org.jdom2 DocType getElementName

List of usage examples for org.jdom2 DocType getElementName

Introduction

In this page you can find the example usage for org.jdom2 DocType getElementName.

Prototype

public String getElementName() 

Source Link

Document

This will retrieve the element name being constrained.

Usage

From source file:com.rometools.rome.io.impl.RSS091NetscapeParser.java

License:Open Source License

@Override
public boolean isMyType(final Document document) {

    final Element rssRoot = document.getRootElement();
    final String name = rssRoot.getName();
    final Attribute version = rssRoot.getAttribute("version");
    final DocType docType = document.getDocType();

    return name.equals(ELEMENT_NAME) && version != null && version.getValue().equals(getRSSVersion())
            && docType != null && ELEMENT_NAME.equals(docType.getElementName())
            && PUBLIC_ID.equals(docType.getPublicID()) && SYSTEM_ID.equals(docType.getSystemID());

}

From source file:com.sun.syndication.io.impl.RSS091NetscapeParser.java

License:Open Source License

public boolean isMyType(Document document) {
    boolean ok = false;
    Element rssRoot = document.getRootElement();
    ok = rssRoot.getName().equals("rss");
    if (ok) {//ww w  .j av a  2  s  . co  m
        ok = false;
        Attribute version = rssRoot.getAttribute("version");
        if (version != null) {
            ok = version.getValue().equals(getRSSVersion());
            if (ok) {
                ok = false;
                DocType docType = document.getDocType();

                if (docType != null) {
                    ok = ELEMENT_NAME.equals(docType.getElementName());
                    ok = ok && PUBLIC_ID.equals(docType.getPublicID());
                    ok = ok && SYSTEM_ID.equals(docType.getSystemID());
                }
            }
        }
    }
    return ok;
}