null if unavailable
* @param systemIdentifier the system id of the doctype or null if unavailable
- * @param html4SpecificAdditionalErrorChecks true if HTML 4-specific checks were enabled, false otherwise
* @throws SAXException if things go wrong
*/
+ public void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier) throws SAXException;
+
+ @Deprecated
public void documentMode(DocumentMode mode, String publicIdentifier, String systemIdentifier, boolean html4SpecificAdditionalErrorChecks) throws SAXException;
}
diff --git a/src/nu/validator/htmlparser/dom/DOMTreeBuilder.java b/src/nu/validator/htmlparser/dom/DOMTreeBuilder.java
index 2b8eff23..6ccf75a4 100644
--- a/src/nu/validator/htmlparser/dom/DOMTreeBuilder.java
+++ b/src/nu/validator/htmlparser/dom/DOMTreeBuilder.java
@@ -248,8 +248,15 @@ protected DOMTreeBuilder(DOMImplementation implementation) {
/**
*
* @see nu.validator.htmlparser.impl.TreeBuilder#documentMode(nu.validator.htmlparser.common.DocumentMode,
- * java.lang.String, java.lang.String, boolean)
+ * java.lang.String, java.lang.String)
*/
+ protected void documentMode(DocumentMode mode, String publicIdentifier,
+ String systemIdentifier)
+ throws SAXException {
+ document.setUserData("nu.validator.document-mode", mode, null);
+ }
+
+ @Deprecated
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)
throws SAXException {
diff --git a/src/nu/validator/htmlparser/dom/HtmlDocumentBuilder.java b/src/nu/validator/htmlparser/dom/HtmlDocumentBuilder.java
index f4a307c9..f2619c05 100644
--- a/src/nu/validator/htmlparser/dom/HtmlDocumentBuilder.java
+++ b/src/nu/validator/htmlparser/dom/HtmlDocumentBuilder.java
@@ -462,6 +462,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
+ @Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
@@ -473,6 +474,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
+ @Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
@@ -526,6 +528,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
@@ -548,6 +551,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
diff --git a/src/nu/validator/htmlparser/impl/Tokenizer.java b/src/nu/validator/htmlparser/impl/Tokenizer.java
index 45073f85..6bf71e86 100755
--- a/src/nu/validator/htmlparser/impl/Tokenizer.java
+++ b/src/nu/validator/htmlparser/impl/Tokenizer.java
@@ -748,6 +748,7 @@ public void setNamePolicy(XmlViolationPolicy namePolicy) {
* @param html4ModeCompatibleWithXhtml1Schemata
* the html4ModeCompatibleWithXhtml1Schemata to set
*/
+ @Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
diff --git a/src/nu/validator/htmlparser/impl/TreeBuilder.java b/src/nu/validator/htmlparser/impl/TreeBuilder.java
index 02cc6409..13d9ecb3 100644
--- a/src/nu/validator/htmlparser/impl/TreeBuilder.java
+++ b/src/nu/validator/htmlparser/impl/TreeBuilder.java
@@ -6027,6 +6027,7 @@ public void setIsSrcdocDocument(boolean isSrcdocDocument) {
* @param doctypeExpectation
* the doctypeExpectation to set
*/
+ @Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
}
diff --git a/src/nu/validator/htmlparser/io/Driver.java b/src/nu/validator/htmlparser/io/Driver.java
index d685e69d..e4d6931b 100644
--- a/src/nu/validator/htmlparser/io/Driver.java
+++ b/src/nu/validator/htmlparser/io/Driver.java
@@ -558,6 +558,7 @@ public void setTransitionHandler(TransitionHandler transitionHandler) {
* @param html4ModeCompatibleWithXhtml1Schemata
* @see nu.validator.htmlparser.impl.Tokenizer#setHtml4ModeCompatibleWithXhtml1Schemata(boolean)
*/
+ @Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
tokenizer.setHtml4ModeCompatibleWithXhtml1Schemata(html4ModeCompatibleWithXhtml1Schemata);
diff --git a/src/nu/validator/htmlparser/sax/HtmlParser.java b/src/nu/validator/htmlparser/sax/HtmlParser.java
index 714053e7..8eddd601 100644
--- a/src/nu/validator/htmlparser/sax/HtmlParser.java
+++ b/src/nu/validator/htmlparser/sax/HtmlParser.java
@@ -817,6 +817,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
+ @Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
@@ -828,6 +829,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
+ @Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
@@ -881,6 +883,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
@@ -903,6 +906,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
diff --git a/src/nu/validator/htmlparser/xom/HtmlBuilder.java b/src/nu/validator/htmlparser/xom/HtmlBuilder.java
index 845ea15c..7c0d0834 100644
--- a/src/nu/validator/htmlparser/xom/HtmlBuilder.java
+++ b/src/nu/validator/htmlparser/xom/HtmlBuilder.java
@@ -499,6 +499,7 @@ public void setScriptingEnabled(boolean scriptingEnabled) {
*
* @return the doctypeExpectation
*/
+ @Deprecated
public DoctypeExpectation getDoctypeExpectation() {
return doctypeExpectation;
}
@@ -510,6 +511,7 @@ public DoctypeExpectation getDoctypeExpectation() {
* the doctypeExpectation to set
* @see nu.validator.htmlparser.impl.TreeBuilder#setDoctypeExpectation(nu.validator.htmlparser.common.DoctypeExpectation)
*/
+ @Deprecated
public void setDoctypeExpectation(DoctypeExpectation doctypeExpectation) {
this.doctypeExpectation = doctypeExpectation;
if (treeBuilder != null) {
@@ -563,6 +565,7 @@ public void setStreamabilityViolationPolicy(
* the name in the value.
* @param html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public void setHtml4ModeCompatibleWithXhtml1Schemata(
boolean html4ModeCompatibleWithXhtml1Schemata) {
this.html4ModeCompatibleWithXhtml1Schemata = html4ModeCompatibleWithXhtml1Schemata;
@@ -585,6 +588,7 @@ public Locator getDocumentLocator() {
*
* @return the html4ModeCompatibleWithXhtml1Schemata
*/
+ @Deprecated
public boolean isHtml4ModeCompatibleWithXhtml1Schemata() {
return html4ModeCompatibleWithXhtml1Schemata;
}
diff --git a/src/nu/validator/htmlparser/xom/XOMTreeBuilder.java b/src/nu/validator/htmlparser/xom/XOMTreeBuilder.java
index 623f3192..e10cb863 100644
--- a/src/nu/validator/htmlparser/xom/XOMTreeBuilder.java
+++ b/src/nu/validator/htmlparser/xom/XOMTreeBuilder.java
@@ -254,9 +254,19 @@ protected void start(boolean fragment) throws SAXException {
/**
* @see nu.validator.htmlparser.impl.TreeBuilder#documentMode(nu.validator.htmlparser.common.DocumentMode,
- * java.lang.String, java.lang.String, boolean)
+ * java.lang.String, java.lang.String)
*/
+ protected void documentMode(DocumentMode mode, String publicIdentifier,
+ String systemIdentifier)
+ throws SAXException {
+ if (document instanceof Mode) {
+ Mode modal = (Mode) document;
+ modal.setMode(mode);
+ }
+ }
+
@Override
+ @Deprecated
protected void documentMode(DocumentMode mode, String publicIdentifier,
String systemIdentifier, boolean html4SpecificAdditionalErrorChecks)
throws SAXException {