Skip to Content.
Sympa Menu

xom-interest - [XOM-interest] DocType.equals()?

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Kevin Herrboldt <kevin AT puppethead.com>
  • To: xom-interest AT lists.ibiblio.org
  • Subject: [XOM-interest] DocType.equals()?
  • Date: Thu, 3 Jul 2003 16:15:06 -0500

I'm wondering if nu.xom.DocType should have an equals() method that checks the Public ID and/or the System ID.

Let's say I'm writing an app to process XHTML. Assuming I successfully get a Document I'd like to be able to compare the DocType of each document against well-known Public IDs.

I was thinking I'd create a DocType object for each XHTML variant (strict, transistional, frameset) and then I could do something like:

DocType XHTML_STRICT = new DocType("html", "-//W3C//DTD XHTML 1.0 Strict//EN", ...);
DocType XHTML_TRANS = new DocType("html", "-//W3C//DTD XHTML 1.0 Transitional//EN", ...);

if (XHTML_STRICT.equals(myDocument.getDocType()) {
// special strict actions here....
} else if (XHTML_TRANS.equals(myDocument.getDocType()) {
// special transistional actions here...
}

etc.

I'd imagine DocTypes would be equal if they both had public ids that were identical, or neither had a public id and the system ids matched. Or something like that.





Archive powered by MHonArc 2.6.24.

Top of Page