Class XmlDtd

java.lang.Object
org.libxmq.imp.xml.XmlNode
org.libxmq.imp.xml.XmlDtd
All Implemented Interfaces:
XMQDtd, XMQNode

public class XmlDtd extends XmlNode implements XMQDtd
A document type definition, ie the <!DOCTYPE name ...> declaration with its internal subset. The declarations of the internal subset are the children of this node.
  • Constructor Details

    • XmlDtd

      public XmlDtd(String name, String external_id, String system_id)
      Create a dtd.
      Parameters:
      name - The doctype name, eg html.
      external_id - The public id or null.
      system_id - The system id or null.
  • Method Details

    • type

      public XMQNodeType type()
      Description copied from class: XmlNode
      Returns the type of this node.
      Specified by:
      type in interface XMQNode
      Specified by:
      type in class XmlNode
      Returns:
      The node type.
    • externalId

      public String externalId()
      Returns the public id.
      Specified by:
      externalId in interface XMQDtd
      Returns:
      The external id or null.
    • systemId

      public String systemId()
      Returns the system id.
      Specified by:
      systemId in interface XMQDtd
      Returns:
      The system id or null.
    • addEntity

      public XmlEntityDecl addEntity(XMQEntityDecl e)
      Add an entity declaration, like libxml2 xmlAddDocEntity. A redeclared entity is ignored, the first declaration wins.
      Specified by:
      addEntity in interface XMQDtd
      Parameters:
      e - The declaration.
      Returns:
      The declaration, or null if it was already declared.
    • addDecl

      public void addDecl(XmlDtdDecl d)
      Add an element, attribute list or notation declaration.
      Parameters:
      d - The declaration.
    • addNotation

      public void addNotation(XmlDtdDecl d)
      Add a notation declaration. Like in libxml2, notations are not children of the dtd, they are kept in a separate table and are printed before the other declarations.
      Parameters:
      d - The notation declaration.
    • notations

      public List<XmlDtdDecl> notations()
      Returns the notation declarations.
      Returns:
      The live list of notations.
    • getEntity

      public XmlEntityDecl getEntity(String name)
      Find a general entity declaration.
      Specified by:
      getEntity in interface XMQDtd
      Parameters:
      name - The entity name.
      Returns:
      The declaration or null.
    • getParameterEntity

      public XmlEntityDecl getParameterEntity(String name)
      Find a parameter entity declaration.
      Specified by:
      getParameterEntity in interface XMQDtd
      Parameters:
      name - The entity name.
      Returns:
      The declaration or null.
    • hasDeclarations

      public boolean hasDeclarations()
      Returns true if the dtd has any declarations, ie an internal subset.
      Specified by:
      hasDeclarations in interface XMQDtd
      Returns:
      True if there are declarations.