/** * 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; }
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; }
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; }