Example #1
0
 /**
  * Assumes XmlNode#external_subset() has returned nil. (i.e. there is not already an external
  * subset).
  */
 public IRubyObject createExternalSubset(
     ThreadContext context, IRubyObject name, IRubyObject external_id, IRubyObject system_id) {
   XmlDtd dtd =
       XmlDtd.newEmpty(context.getRuntime(), this.getDocument(), name, external_id, system_id);
   setExternalSubset(dtd);
   return dtd;
 }
Example #2
0
  public IRubyObject getExternalSubset(ThreadContext context) {
    IRubyObject dtd = (IRubyObject) node.getUserData(DTD_EXTERNAL_SUBSET);

    if (dtd == null) {
      dtd = XmlDtd.newFromExternalSubset(context.getRuntime(), getDocument());
      setExternalSubset(dtd);
    }

    return dtd;
  }
Example #3
0
  public IRubyObject getInternalSubset(ThreadContext context) {
    IRubyObject dtd = (IRubyObject) node.getUserData(DTD_INTERNAL_SUBSET);

    if (dtd == null) {
      if (getDocument().getDoctype() == null) dtd = context.getRuntime().getNil();
      else dtd = XmlDtd.newFromInternalSubset(context.getRuntime(), getDocument());

      setInternalSubset(dtd);
    }

    return dtd;
  }