8181153: Fix lint warnings in JAXP repo: dep-ann

Reviewed-by: lancea
This commit is contained in:
Joe Wang 2017-06-14 14:12:02 -07:00
parent d801a7d2ff
commit 30f0e4e6ad
58 changed files with 486 additions and 2512 deletions

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -262,6 +261,7 @@ public abstract class ReferenceType extends Type {
* @deprecated use getFirstCommonSuperclass(ReferenceType t) which has * @deprecated use getFirstCommonSuperclass(ReferenceType t) which has
* slightly changed semantics. * slightly changed semantics.
*/ */
@Deprecated
public ReferenceType firstCommonSuperclass(ReferenceType t) { public ReferenceType firstCommonSuperclass(ReferenceType t) {
if (this.equals(Type.NULL)) return t; if (this.equals(Type.NULL)) return t;
if (t.equals(Type.NULL)) return this; if (t.equals(Type.NULL)) return this;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,7 +22,7 @@
*/ */
package com.sun.org.apache.xalan.internal.lib; package com.sun.org.apache.xalan.internal.lib;
import com.sun.org.apache.xml.internal.utils.DOMHelper; import com.sun.org.apache.xml.internal.utils.DOM2Helper;
import com.sun.org.apache.xpath.internal.NodeSet; import com.sun.org.apache.xpath.internal.NodeSet;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -72,8 +72,8 @@ public class ExsltSets extends ExsltBase
for (int i = 0; i < nl1.getLength(); i++) for (int i = 0; i < nl1.getLength(); i++)
{ {
Node testNode = nl1.item(i); Node testNode = nl1.item(i);
if (DOMHelper.isNodeAfter(testNode, endNode) if (DOM2Helper.isNodeAfter(testNode, endNode)
&& !DOMHelper.isNodeTheSame(testNode, endNode)) && !DOM2Helper.isNodeTheSame(testNode, endNode))
leadNodes.addElement(testNode); leadNodes.addElement(testNode);
} }
return leadNodes; return leadNodes;
@ -107,8 +107,8 @@ public class ExsltSets extends ExsltBase
for (int i = 0; i < nl1.getLength(); i++) for (int i = 0; i < nl1.getLength(); i++)
{ {
Node testNode = nl1.item(i); Node testNode = nl1.item(i);
if (DOMHelper.isNodeAfter(startNode, testNode) if (DOM2Helper.isNodeAfter(startNode, testNode)
&& !DOMHelper.isNodeTheSame(startNode, testNode)) && !DOM2Helper.isNodeTheSame(startNode, testNode))
trailNodes.addElement(testNode); trailNodes.addElement(testNode);
} }
return trailNodes; return trailNodes;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1426,24 +1422,4 @@ public class XSLTErrorResources extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1426,24 +1422,4 @@ public class XSLTErrorResources_de extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_es extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_fr extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_it extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_ja extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_ko extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_pt_BR extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -482,7 +478,7 @@ public class XSLTErrorResources_sv extends ListResourceBundle
{"ER0000" , "{0}" }, {"ER0000" , "{0}" },
{ ER_NO_CURLYBRACE, { ER_NO_CURLYBRACE,
"Fel: Uttryck f\u00E5r inte inneh\u00E5lla '{'"}, "Fel: Uttryck kan inte inneh\u00E5lla '{'"},
{ ER_ILLEGAL_ATTRIBUTE , { ER_ILLEGAL_ATTRIBUTE ,
"{0} har ett otill\u00E5tet attribut: {1}"}, "{0} har ett otill\u00E5tet attribut: {1}"},
@ -1426,24 +1422,4 @@ public class XSLTErrorResources_sv extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_zh_CN extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -22,9 +21,6 @@
package com.sun.org.apache.xalan.internal.res; package com.sun.org.apache.xalan.internal.res;
import java.util.ListResourceBundle; import java.util.ListResourceBundle;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
/** /**
* Set up error messages. * Set up error messages.
@ -1425,25 +1421,4 @@ public class XSLTErrorResources_zh_TW extends ListResourceBundle
/** String for use when formatting of the error string failed. */ /** String for use when formatting of the error string failed. */
public static final String FORMAT_FAILED = "FORMAT_FAILED"; public static final String FORMAT_FAILED = "FORMAT_FAILED";
/** General error string. */
public static final String ERROR_STRING = "#error";
/** String to prepend to error messages. */
public static final String ERROR_HEADER = "Error: ";
/** String to prepend to warning messages. */
public static final String WARNING_HEADER = "Warning: ";
/** String to specify the XSLT module. */
public static final String XSL_HEADER = "XSLT ";
/** String to specify the XML parser module. */
public static final String XML_HEADER = "XML ";
/** I don't think this is used any more.
* @deprecated */
public static final String QUERY_HEADER = "PATTERN ";
} }

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -60,6 +59,7 @@ import com.sun.org.apache.xml.internal.dtm.ref.DTMAxisIteratorBase;
* @deprecated This class exists only for backwards compatibility with old * @deprecated This class exists only for backwards compatibility with old
* translets. New code should not reference it. * translets. New code should not reference it.
*/ */
@Deprecated
public final class ForwardPositionIterator extends DTMAxisIteratorBase { public final class ForwardPositionIterator extends DTMAxisIteratorBase {
private DTMAxisIterator _source; private DTMAxisIterator _source;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -115,6 +115,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* Merge the current value's nodeset set by lookupKey() with _nodes. * Merge the current value's nodeset set by lookupKey() with _nodes.
* @deprecated * @deprecated
*/ */
@Deprecated
public void merge(KeyIndex other) { public void merge(KeyIndex other) {
if (other == null) return; if (other == null) return;
@ -136,6 +137,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* key() function. * key() function.
* @deprecated * @deprecated
*/ */
@Deprecated
public void lookupId(Object value) { public void lookupId(Object value) {
// Clear _nodes array // Clear _nodes array
_nodes = null; _nodes = null;
@ -205,6 +207,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public void lookupKey(Object value) { public void lookupKey(Object value) {
IntegerArray nodes = _index.get(value); IntegerArray nodes = _index.get(value);
_nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null; _nodes = (nodes != null) ? (IntegerArray) nodes.clone() : null;
@ -217,6 +220,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public int next() { public int next() {
if (_nodes == null) return DTMAxisIterator.END; if (_nodes == null) return DTMAxisIterator.END;
@ -313,6 +317,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public DTMAxisIterator reset() { public DTMAxisIterator reset() {
_position = 0; _position = 0;
return this; return this;
@ -324,6 +329,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public int getLast() { public int getLast() {
return (_nodes == null) ? 0 : _nodes.cardinality(); return (_nodes == null) ? 0 : _nodes.cardinality();
} }
@ -334,6 +340,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public int getPosition() { public int getPosition() {
return _position; return _position;
} }
@ -344,6 +351,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public void setMark() { public void setMark() {
_markedPosition = _position; _markedPosition = _position;
} }
@ -354,6 +362,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public void gotoMark() { public void gotoMark() {
_position = _markedPosition; _position = _markedPosition;
} }
@ -365,6 +374,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public DTMAxisIterator setStartNode(int start) { public DTMAxisIterator setStartNode(int start) {
if (start == DTMAxisIterator.END) { if (start == DTMAxisIterator.END) {
_nodes = null; _nodes = null;
@ -382,6 +392,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public int getStartNode() { public int getStartNode() {
return 0; return 0;
} }
@ -392,6 +403,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public boolean isReverse() { public boolean isReverse() {
return(false); return(false);
} }
@ -402,6 +414,7 @@ public class KeyIndex extends DTMAxisIteratorBase {
* <b>deprecated.</b></em></p> * <b>deprecated.</b></em></p>
* @deprecated * @deprecated
*/ */
@Deprecated
public DTMAxisIterator cloneIterator() { public DTMAxisIterator cloneIterator() {
KeyIndex other = new KeyIndex(0); KeyIndex other = new KeyIndex(0);
other._index = _index; other._index = _index;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -49,6 +48,7 @@ public abstract class NodeSortRecord {
* @deprecated This field continues to exist for binary compatibility. * @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it. * New code should not refer to it.
*/ */
@Deprecated
private static final Collator DEFAULT_COLLATOR = Collator.getInstance(); private static final Collator DEFAULT_COLLATOR = Collator.getInstance();
/** /**
@ -56,6 +56,7 @@ public abstract class NodeSortRecord {
* @deprecated This field continues to exist for binary compatibility. * @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it. * New code should not refer to it.
*/ */
@Deprecated
protected Collator _collator = DEFAULT_COLLATOR; protected Collator _collator = DEFAULT_COLLATOR;
protected Collator[] _collators; protected Collator[] _collators;
@ -64,6 +65,7 @@ public abstract class NodeSortRecord {
* @deprecated This field continues to exist for binary compatibility. * @deprecated This field continues to exist for binary compatibility.
* New code should not refer to it. * New code should not refer to it.
*/ */
@Deprecated
protected Locale _locale; protected Locale _locale;
protected CollatorFactory _collatorFactory; protected CollatorFactory _collatorFactory;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -55,6 +54,7 @@ public class NodeSortRecordFactory {
* @deprecated This constructor is no longer used in generated code. It * @deprecated This constructor is no longer used in generated code. It
* exists only for backwards compatibility. * exists only for backwards compatibility.
*/ */
@Deprecated
public NodeSortRecordFactory(DOM dom, String className, Translet translet, public NodeSortRecordFactory(DOM dom, String className, Translet translet,
String order[], String type[]) String order[], String type[])
throws TransletException throws TransletException

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -100,6 +100,7 @@ public final class BasisLibrary {
* @deprecated This method exists only for backwards compatibility with old * @deprecated This method exists only for backwards compatibility with old
* translets. New code should not reference it. * translets. New code should not reference it.
*/ */
@Deprecated
public static int positionF(DTMAxisIterator iterator) { public static int positionF(DTMAxisIterator iterator) {
return iterator.isReverse() return iterator.isReverse()
? iterator.getLast() - iterator.getPosition() + 1 ? iterator.getLast() - iterator.getPosition() + 1

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -516,6 +515,7 @@ public class AttrImpl
* @deprecated Previous working draft of DOM Level 2. New method * @deprecated Previous working draft of DOM Level 2. New method
* is <tt>getOwnerElement()</tt>. * is <tt>getOwnerElement()</tt>.
*/ */
@Deprecated
public Element getElement() { public Element getElement() {
// if we have an owner, ownerNode is our ownerElement, otherwise it's // if we have an owner, ownerNode is our ownerElement, otherwise it's
// our ownerDocument and we don't have an ownerElement // our ownerDocument and we don't have an ownerElement

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -832,6 +832,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public void setEncoding(String value) { public void setEncoding(String value) {
setXmlEncoding(value); setXmlEncoding(value);
} }
@ -849,6 +850,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public String getEncoding() { public String getEncoding() {
return getXmlEncoding(); return getXmlEncoding();
} }
@ -890,6 +892,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public void setVersion(String value) { public void setVersion(String value) {
setXmlVersion(value); setXmlVersion(value);
} }
@ -908,6 +911,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public String getVersion() { public String getVersion() {
return getXmlVersion(); return getXmlVersion();
} }
@ -932,6 +936,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public void setStandalone(boolean value) { public void setStandalone(boolean value) {
setXmlStandalone(value); setXmlStandalone(value);
} }
@ -950,6 +955,7 @@ public class CoreDocumentImpl
* compatibility with older applications. New applications * compatibility with older applications. New applications
* should never call this method. * should never call this method.
*/ */
@Deprecated
public boolean getStandalone() { public boolean getStandalone() {
return getXmlStandalone(); return getXmlStandalone();
} }

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -369,6 +369,7 @@ public class DeferredDocumentImpl
* Creates an element node with a URI in the table and type information. * Creates an element node with a URI in the table and type information.
* @deprecated * @deprecated
*/ */
@Deprecated
public int createDeferredElement(String elementURI, String elementName, public int createDeferredElement(String elementURI, String elementName,
Object type) { Object type) {
@ -389,6 +390,7 @@ public class DeferredDocumentImpl
* Creates an element node in the table. * Creates an element node in the table.
* @deprecated * @deprecated
*/ */
@Deprecated
public int createDeferredElement(String elementName) { public int createDeferredElement(String elementName) {
return createDeferredElement(null, elementName); return createDeferredElement(null, elementName);
} }
@ -474,6 +476,7 @@ public class DeferredDocumentImpl
* Sets an attribute on an element node. * Sets an attribute on an element node.
* @deprecated * @deprecated
*/ */
@Deprecated
public int setDeferredAttribute(int elementNodeIndex, public int setDeferredAttribute(int elementNodeIndex,
String attrName, String attrURI, String attrName, String attrURI,
String attrValue, boolean specified) { String attrValue, boolean specified) {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -763,6 +763,7 @@ public abstract class NodeImpl
* @since DOM Level 3 * @since DOM Level 3
* @deprecated * @deprecated
*/ */
@Deprecated
public short compareTreePosition(Node other) { public short compareTreePosition(Node other) {
// Questions of clarification for this method - to be answered by the // Questions of clarification for this method - to be answered by the
// DOM WG. Current assumptions listed - LM // DOM WG. Current assumptions listed - LM

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -116,6 +115,7 @@ public interface ItemPSVI {
* *
* @deprecated Use getSchemaValue().getNormalizedValue() instead * @deprecated Use getSchemaValue().getNormalizedValue() instead
*/ */
@Deprecated
public String getSchemaNormalizedValue(); public String getSchemaNormalizedValue();
/** /**
@ -127,6 +127,7 @@ public interface ItemPSVI {
* *
* @deprecated Use getSchemaValue().getActualValue() instead * @deprecated Use getSchemaValue().getActualValue() instead
*/ */
@Deprecated
public Object getActualNormalizedValue() public Object getActualNormalizedValue()
throws XSException; throws XSException;
@ -146,6 +147,7 @@ public interface ItemPSVI {
* *
* @deprecated Use getSchemaValue().getActualValueType() instead * @deprecated Use getSchemaValue().getActualValueType() instead
*/ */
@Deprecated
public short getActualNormalizedValueType() public short getActualNormalizedValueType()
throws XSException; throws XSException;
@ -182,6 +184,7 @@ public interface ItemPSVI {
* *
* @deprecated Use getSchemaValue().getListValueTypes() instead * @deprecated Use getSchemaValue().getListValueTypes() instead
*/ */
@Deprecated
public ShortList getItemValueTypes() public ShortList getItemValueTypes()
throws XSException; throws XSException;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -55,6 +54,7 @@ public interface XSAttributeDeclaration extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/ */
@Deprecated
public String getConstraintValue(); public String getConstraintValue();
/** /**
@ -67,6 +67,7 @@ public interface XSAttributeDeclaration extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getActualValue() instead * @deprecated Use getValueConstraintValue().getActualValue() instead
*/ */
@Deprecated
public Object getActualVC() public Object getActualVC()
throws XSException; throws XSException;
@ -86,6 +87,7 @@ public interface XSAttributeDeclaration extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getActualValueType() instead * @deprecated Use getValueConstraintValue().getActualValueType() instead
*/ */
@Deprecated
public short getActualVCType() public short getActualVCType()
throws XSException; throws XSException;
@ -104,6 +106,7 @@ public interface XSAttributeDeclaration extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getListValueTypes() instead * @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/ */
@Deprecated
public ShortList getItemValueTypes() public ShortList getItemValueTypes()
throws XSException; throws XSException;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -48,6 +47,7 @@ public interface XSAttributeUse extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/ */
@Deprecated
public String getConstraintValue(); public String getConstraintValue();
/** /**
@ -60,6 +60,7 @@ public interface XSAttributeUse extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getActualValue() instead * @deprecated Use getValueConstraintValue().getActualValue() instead
*/ */
@Deprecated
public Object getActualVC() public Object getActualVC()
throws XSException; throws XSException;
@ -79,6 +80,7 @@ public interface XSAttributeUse extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getActualValueType() instead * @deprecated Use getValueConstraintValue().getActualValueType() instead
*/ */
@Deprecated
public short getActualVCType() public short getActualVCType()
throws XSException; throws XSException;
@ -97,6 +99,7 @@ public interface XSAttributeUse extends XSObject {
* *
* @deprecated Use getValueConstraintValue().getListValueTypes() instead * @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/ */
@Deprecated
public ShortList getItemValueTypes() public ShortList getItemValueTypes()
throws XSException; throws XSException;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -56,6 +55,7 @@ public interface XSElementDeclaration extends XSTerm {
* *
* @deprecated Use getValueConstraintValue().getNormalizedValue() instead * @deprecated Use getValueConstraintValue().getNormalizedValue() instead
*/ */
@Deprecated
public String getConstraintValue(); public String getConstraintValue();
/** /**
@ -68,6 +68,7 @@ public interface XSElementDeclaration extends XSTerm {
* *
* @deprecated Use getValueConstraintValue().getActualValue() instead * @deprecated Use getValueConstraintValue().getActualValue() instead
*/ */
@Deprecated
public Object getActualVC() public Object getActualVC()
throws XSException; throws XSException;
@ -87,6 +88,7 @@ public interface XSElementDeclaration extends XSTerm {
* *
* @deprecated Use getValueConstraintValue().getActualValueType() instead * @deprecated Use getValueConstraintValue().getActualValueType() instead
*/ */
@Deprecated
public short getActualVCType() public short getActualVCType()
throws XSException; throws XSException;
@ -105,6 +107,7 @@ public interface XSElementDeclaration extends XSTerm {
* *
* @deprecated Use getValueConstraintValue().getListValueTypes() instead * @deprecated Use getValueConstraintValue().getListValueTypes() instead
*/ */
@Deprecated
public ShortList getItemValueTypes() public ShortList getItemValueTypes()
throws XSException; throws XSException;

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -45,6 +44,7 @@ import org.xml.sax.XMLReader;
* coroutine protocol was not being used and was complicating design. * coroutine protocol was not being used and was complicating design.
* See {@link IncrementalSAXSource}. * See {@link IncrementalSAXSource}.
* */ * */
@Deprecated
public interface CoroutineParser { public interface CoroutineParser {
/** @return the coroutine ID number for this CoroutineParser object. /** @return the coroutine ID number for this CoroutineParser object.

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -128,6 +128,7 @@ import org.xml.sax.ext.LexicalHandler;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public abstract class BaseMarkupSerializer public abstract class BaseMarkupSerializer
implements ContentHandler, DocumentHandler, LexicalHandler, implements ContentHandler, DocumentHandler, LexicalHandler,
DTDHandler, DeclHandler, DOMSerializer, Serializer DTDHandler, DeclHandler, DOMSerializer, Serializer

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,6 +41,7 @@ import org.w3c.dom.DocumentFragment;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public interface DOMSerializer public interface DOMSerializer
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -76,6 +75,7 @@ import org.w3c.dom.ls.LSSerializerFilter;
* @deprecated As of JDK 9, Xerces 2.9.0, replaced by * @deprecated As of JDK 9, Xerces 2.9.0, replaced by
* {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl} * {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}
*/ */
@Deprecated
public class DOMSerializerImpl implements LSSerializer, DOMConfiguration { public class DOMSerializerImpl implements LSSerializer, DOMConfiguration {
// TODO: When DOM Level 3 goes to REC replace method calls using // TODO: When DOM Level 3 goes to REC replace method calls using

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -36,6 +36,7 @@ import java.util.Map;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class ElementState public class ElementState
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -37,6 +36,7 @@ import java.nio.charset.CharsetEncoder;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class EncodingInfo { public class EncodingInfo {
// name of encoding as registered with IANA; // name of encoding as registered with IANA;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,6 +42,7 @@ import java.util.concurrent.ConcurrentHashMap;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
class Encodings class Encodings
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -92,6 +92,7 @@ import org.xml.sax.SAXException;
* @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a> * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
* @see Serializer * @see Serializer
*/ */
@Deprecated
public class HTMLSerializer public class HTMLSerializer
extends BaseMarkupSerializer extends BaseMarkupSerializer
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -51,6 +51,7 @@ import java.util.Map;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public final class HTMLdtd public final class HTMLdtd
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -39,6 +38,7 @@ import java.io.IOException;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class IndentPrinter public class IndentPrinter
extends Printer extends Printer
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -32,6 +31,7 @@ package com.sun.org.apache.xml.internal.serialize;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public final class LineSeparator public final class LineSeparator
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -32,6 +31,7 @@ package com.sun.org.apache.xml.internal.serialize;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public final class Method public final class Method
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -65,6 +64,7 @@ import org.w3c.dom.Node;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class OutputFormat public class OutputFormat
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -47,6 +46,7 @@ import java.io.IOException;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class Printer public class Printer
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -67,6 +66,7 @@ import org.xml.sax.DocumentHandler;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public interface Serializer public interface Serializer
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017 Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -42,6 +42,7 @@ import java.util.StringTokenizer;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public abstract class SerializerFactory public abstract class SerializerFactory
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -41,6 +40,7 @@ import com.sun.org.apache.xerces.internal.dom.DOMMessageFormatter;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
final class SerializerFactoryImpl final class SerializerFactoryImpl
extends SerializerFactory extends SerializerFactory
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -65,6 +64,7 @@ import org.xml.sax.SAXException;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class TextSerializer public class TextSerializer
extends BaseMarkupSerializer extends BaseMarkupSerializer
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -39,6 +38,7 @@ import java.io.Writer;
* @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a> * @author <a href="mailto:arkin@intalio.com">Assaf Arkin</a>
* @see Serializer * @see Serializer
*/ */
@Deprecated
public class XHTMLSerializer public class XHTMLSerializer
extends HTMLSerializer extends HTMLSerializer
{ {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -84,6 +83,7 @@ import org.xml.sax.SAXException;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class XML11Serializer public class XML11Serializer
extends XMLSerializer { extends XMLSerializer {

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -95,6 +94,7 @@ import org.xml.sax.helpers.AttributesImpl;
* {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced * {@link com.sun.org.apache.xml.internal.serialize.DOMSerializerImpl} is replaced
* by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}. * by {@link com.sun.org.apache.xml.internal.serializer.dom3.LSSerializerImpl}.
*/ */
@Deprecated
public class XMLSerializer public class XMLSerializer
extends BaseMarkupSerializer { extends BaseMarkupSerializer {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -17,13 +17,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.sun.org.apache.xml.internal.serializer; package com.sun.org.apache.xml.internal.serializer;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xml.internal.utils.AttList;
import java.io.File; import com.sun.org.apache.xml.internal.utils.DOM2Helper;
import javax.xml.transform.Result;
import com.sun.org.apache.xml.internal.serializer.utils.AttList;
import com.sun.org.apache.xml.internal.serializer.utils.DOM2Helper;
import org.w3c.dom.Comment; import org.w3c.dom.Comment;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.EntityReference; import org.w3c.dom.EntityReference;
@ -31,7 +30,6 @@ import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.w3c.dom.ProcessingInstruction; import org.w3c.dom.ProcessingInstruction;
import org.w3c.dom.Text; import org.w3c.dom.Text;
import org.xml.sax.ContentHandler; import org.xml.sax.ContentHandler;
import org.xml.sax.Locator; import org.xml.sax.Locator;
import org.xml.sax.ext.LexicalHandler; import org.xml.sax.ext.LexicalHandler;
@ -58,12 +56,6 @@ public final class TreeWalker
*/ */
final private SerializationHandler m_Serializer; final private SerializationHandler m_Serializer;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
/** DomHelper for this TreeWalker */
final protected DOM2Helper m_dh;
/** Locator object for this TreeWalker */ /** Locator object for this TreeWalker */
final private LocatorImpl m_locator = new LocatorImpl(); final private LocatorImpl m_locator = new LocatorImpl();
@ -99,8 +91,6 @@ public final class TreeWalker
if (systemId != null) { if (systemId != null) {
m_locator.setSystemId(systemId); m_locator.setSystemId(systemId);
} }
m_dh = new DOM2Helper();
} }
/** /**
@ -209,7 +199,7 @@ public final class TreeWalker
this.m_contentHandler.endDocument(); this.m_contentHandler.endDocument();
} }
/** Flag indicating whether following text to be processed is raw text */ // Flag indicating whether following text to be processed is raw text
boolean nextIsRaw = false; boolean nextIsRaw = false;
/** /**
@ -313,7 +303,6 @@ public final class TreeWalker
final int colon = attrName.indexOf(':'); final int colon = attrName.indexOf(':');
final String prefix; final String prefix;
// System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
{ {
// Use "" instead of null, as Xerces likes "" for the // Use "" instead of null, as Xerces likes "" for the
@ -335,13 +324,13 @@ public final class TreeWalker
} }
} }
String ns = m_dh.getNamespaceOfNode(node); String ns = DOM2Helper.getNamespaceOfNode(node);
if(null == ns) if(null == ns)
ns = ""; ns = "";
this.m_contentHandler.startElement(ns, this.m_contentHandler.startElement(ns,
m_dh.getLocalNameOfNode(node), DOM2Helper.getLocalNameOfNode(node),
node.getNodeName(), node.getNodeName(),
new AttList(atts, m_dh)); new AttList(atts));
break; break;
case Node.PROCESSING_INSTRUCTION_NODE : case Node.PROCESSING_INSTRUCTION_NODE :
{ {
@ -389,9 +378,9 @@ public final class TreeWalker
{ {
nextIsRaw = false; nextIsRaw = false;
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); m_contentHandler.processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
dispatachChars(node); dispatachChars(node);
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); m_contentHandler.processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
} }
else else
{ {
@ -436,11 +425,11 @@ public final class TreeWalker
break; break;
case Node.ELEMENT_NODE : case Node.ELEMENT_NODE :
String ns = m_dh.getNamespaceOfNode(node); String ns = DOM2Helper.getNamespaceOfNode(node);
if(null == ns) if(null == ns)
ns = ""; ns = "";
this.m_contentHandler.endElement(ns, this.m_contentHandler.endElement(ns,
m_dh.getLocalNameOfNode(node), DOM2Helper.getLocalNameOfNode(node),
node.getNodeName()); node.getNodeName());
if (m_Serializer == null) { if (m_Serializer == null) {

View file

@ -1,264 +0,0 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xml.internal.serializer.utils;
import org.w3c.dom.Attr;
import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Node;
import org.xml.sax.Attributes;
/**
* Wraps a DOM attribute list in a SAX Attributes.
*
* This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
* It exists to cut the serializers dependancy on that package.
* A minor changes from that package are:
* DOMHelper reference changed to DOM2Helper, class is not "public"
*
* This class is not a public API, it is only public because it is
* used in com.sun.org.apache.xml.internal.serializer.
*
* @xsl.usage internal
*/
public final class AttList implements Attributes
{
/** List of attribute nodes */
NamedNodeMap m_attrs;
/** Index of last attribute node */
int m_lastIndex;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
/** Local reference to DOMHelper */
DOM2Helper m_dh;
// /**
// * Constructor AttList
// *
// *
// * @param attrs List of attributes this will contain
// */
// public AttList(NamedNodeMap attrs)
// {
//
// m_attrs = attrs;
// m_lastIndex = m_attrs.getLength() - 1;
// m_dh = new DOM2Helper();
// }
/**
* Constructor AttList
*
*
* @param attrs List of attributes this will contain
* @param dh DOMHelper
*/
public AttList(NamedNodeMap attrs, DOM2Helper dh)
{
m_attrs = attrs;
m_lastIndex = m_attrs.getLength() - 1;
m_dh = dh;
}
/**
* Get the number of attribute nodes in the list
*
*
* @return number of attribute nodes
*/
public int getLength()
{
return m_attrs.getLength();
}
/**
* Look up an attribute's Namespace URI by index.
*
* @param index The attribute index (zero-based).
* @return The Namespace URI, or the empty string if none
* is available, or null if the index is out of
* range.
*/
public String getURI(int index)
{
String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index)));
if(null == ns)
ns = "";
return ns;
}
/**
* Look up an attribute's local name by index.
*
* @param index The attribute index (zero-based).
* @return The local name, or the empty string if Namespace
* processing is not being performed, or null
* if the index is out of range.
*/
public String getLocalName(int index)
{
return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index)));
}
/**
* Look up an attribute's qualified name by index.
*
*
* @param i The attribute index (zero-based).
*
* @return The attribute's qualified name
*/
public String getQName(int i)
{
return ((Attr) m_attrs.item(i)).getName();
}
/**
* Get the attribute's node type by index
*
*
* @param i The attribute index (zero-based)
*
* @return the attribute's node type
*/
public String getType(int i)
{
return "CDATA"; // for the moment
}
/**
* Get the attribute's node value by index
*
*
* @param i The attribute index (zero-based)
*
* @return the attribute's node value
*/
public String getValue(int i)
{
return ((Attr) m_attrs.item(i)).getValue();
}
/**
* Get the attribute's node type by name
*
*
* @param name Attribute name
*
* @return the attribute's node type
*/
public String getType(String name)
{
return "CDATA"; // for the moment
}
/**
* Look up an attribute's type by Namespace name.
*
* @param uri The Namespace URI, or the empty String if the
* name has no Namespace URI.
* @param localName The local name of the attribute.
* @return The attribute type as a string, or null if the
* attribute is not in the list or if Namespace
* processing is not being performed.
*/
public String getType(String uri, String localName)
{
return "CDATA"; // for the moment
}
/**
* Look up an attribute's value by name.
*
*
* @param name The attribute node's name
*
* @return The attribute node's value
*/
public String getValue(String name)
{
Attr attr = ((Attr) m_attrs.getNamedItem(name));
return (null != attr)
? attr.getValue() : null;
}
/**
* Look up an attribute's value by Namespace name.
*
* @param uri The Namespace URI, or the empty String if the
* name has no Namespace URI.
* @param localName The local name of the attribute.
* @return The attribute value as a string, or null if the
* attribute is not in the list.
*/
public String getValue(String uri, String localName)
{
Node a=m_attrs.getNamedItemNS(uri,localName);
return (a==null) ? null : a.getNodeValue();
}
/**
* Look up the index of an attribute by Namespace name.
*
* @param uri The Namespace URI, or the empty string if
* the name has no Namespace URI.
* @param localPart The attribute's local name.
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
public int getIndex(String uri, String localPart)
{
for(int i=m_attrs.getLength()-1;i>=0;--i)
{
Node a=m_attrs.item(i);
String u=a.getNamespaceURI();
if( (u==null ? uri==null : u.equals(uri))
&&
a.getLocalName().equals(localPart) )
return i;
}
return -1;
}
/**
* Look up the index of an attribute by raw XML 1.0 name.
*
* @param qName The qualified (prefixed) name.
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
public int getIndex(String qName)
{
for(int i=m_attrs.getLength()-1;i>=0;--i)
{
Node a=m_attrs.item(i);
if(a.getNodeName().equals(qName) )
return i;
}
return -1;
}
}

View file

@ -1,135 +0,0 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xml.internal.serializer.utils;
import java.io.IOException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.w3c.dom.Attr;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
/**
* This class provides a DOM level 2 "helper", which provides services currently
* not provided be the DOM standard.
*
* This class is a copy of the one in com.sun.org.apache.xml.internal.utils.
* It exists to cut the serializers dependancy on that package.
*
* The differences from the original class are:
* it doesn't extend DOMHelper, not depricated,
* dropped method isNodeAfter(Node node1, Node node2)
* dropped method parse(InputSource)
* dropped method supportSAX()
* dropped method setDocument(doc)
* dropped method checkNode(Node)
* dropped method getDocument()
* dropped method getElementByID(String id, Document doc)
* dropped method getParentOfNode(Node node)
* dropped field Document m_doc;
* made class non-public
*
* This class is not a public API, it is only public because it is
* used in com.sun.org.apache.xml.internal.serializer.
*
* @xsl.usage internal
*/
public final class DOM2Helper
{
/**
* Construct an instance.
*/
public DOM2Helper(){}
/**
* Returns the local name of the given node, as defined by the
* XML Namespaces specification. This is prepared to handle documents
* built using DOM Level 1 methods by falling back upon explicitly
* parsing the node name.
*
* @param n Node to be examined
*
* @return String containing the local name, or null if the node
* was not assigned a Namespace.
*/
public String getLocalNameOfNode(Node n)
{
String name = n.getLocalName();
return (null == name) ? getLocalNameOfNodeFallback(n) : name;
}
/**
* Returns the local name of the given node. If the node's name begins
* with a namespace prefix, this is the part after the colon; otherwise
* it's the full node name.
*
* This method is copied from com.sun.org.apache.xml.internal.utils.DOMHelper
*
* @param n the node to be examined.
*
* @return String containing the Local Name
*/
private String getLocalNameOfNodeFallback(Node n)
{
String qname = n.getNodeName();
int index = qname.indexOf(':');
return (index < 0) ? qname : qname.substring(index + 1);
}
/**
* Returns the Namespace Name (Namespace URI) for the given node.
* In a Level 2 DOM, you can ask the node itself. Note, however, that
* doing so conflicts with our decision in getLocalNameOfNode not
* to trust the that the DOM was indeed created using the Level 2
* methods. If Level 1 methods were used, these two functions will
* disagree with each other.
* <p>
* TODO: Reconcile with getLocalNameOfNode.
*
* @param n Node to be examined
*
* @return String containing the Namespace URI bound to this DOM node
* at the time the Node was created.
*/
public String getNamespaceOfNode(Node n)
{
return n.getNamespaceURI();
}
/** Field m_useDOM2getNamespaceURI is a compile-time flag which
* gates some of the parser options used to build a DOM -- but
* that code is commented out at this time and nobody else
* references it, so I've commented this out as well. */
//private boolean m_useDOM2getNamespaceURI = false;
}

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -40,26 +39,9 @@ public class AttList implements Attributes
/** Index of last attribute node */ /** Index of last attribute node */
int m_lastIndex; int m_lastIndex;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON! // JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper(); // DOM2Helper m_dh = new DOM2Helper();
/** Local reference to DOMHelper */
DOMHelper m_dh;
// /**
// * Constructor AttList
// *
// *
// * @param attrs List of attributes this will contain
// */
// public AttList(NamedNodeMap attrs)
// {
//
// m_attrs = attrs;
// m_lastIndex = m_attrs.getLength() - 1;
// m_dh = new DOM2Helper();
// }
/** /**
* Constructor AttList * Constructor AttList
* *
@ -67,12 +49,10 @@ public class AttList implements Attributes
* @param attrs List of attributes this will contain * @param attrs List of attributes this will contain
* @param dh DOMHelper * @param dh DOMHelper
*/ */
public AttList(NamedNodeMap attrs, DOMHelper dh) public AttList(NamedNodeMap attrs)
{ {
m_attrs = attrs; m_attrs = attrs;
m_lastIndex = m_attrs.getLength() - 1; m_lastIndex = m_attrs.getLength() - 1;
m_dh = dh;
} }
/** /**
@ -96,7 +76,7 @@ public class AttList implements Attributes
*/ */
public String getURI(int index) public String getURI(int index)
{ {
String ns = m_dh.getNamespaceOfNode(((Attr) m_attrs.item(index))); String ns = DOM2Helper.getNamespaceOfNode(((Attr) m_attrs.item(index)));
if(null == ns) if(null == ns)
ns = ""; ns = "";
return ns; return ns;
@ -112,7 +92,7 @@ public class AttList implements Attributes
*/ */
public String getLocalName(int index) public String getLocalName(int index)
{ {
return m_dh.getLocalNameOfNode(((Attr) m_attrs.item(index))); return DOM2Helper.getLocalNameOfNode(((Attr) m_attrs.item(index)));
} }
/** /**

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -18,298 +17,327 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.sun.org.apache.xml.internal.utils; package com.sun.org.apache.xml.internal.utils;
import java.io.IOException; import com.sun.org.apache.xml.internal.dtm.ref.DTMNodeProxy;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
import javax.xml.transform.TransformerException;
import org.w3c.dom.Attr; import org.w3c.dom.Attr;
import org.w3c.dom.Document; import org.w3c.dom.NamedNodeMap;
import org.w3c.dom.Element;
import org.w3c.dom.Node; import org.w3c.dom.Node;
import org.xml.sax.InputSource;
/** /**
* @deprecated Since the introduction of the DTM, this class will be removed. * This class provides a DOM level 2 "helper", which provides several services.
* This class provides a DOM level 2 "helper", which provides services currently *
* not provided be the DOM standard. * The original class extended DOMHelper that was deprecated and then removed.
*/ */
public class DOM2Helper extends DOMHelper public final class DOM2Helper {
{
/** /**
* Construct an instance. * Construct an instance.
*/ */
public DOM2Helper(){} private DOM2Helper() {
/**
* Check node to see if it was created by a DOM implementation
* that this helper is intended to support. This is currently
* disabled, and assumes all nodes are acceptable rather than checking
* that they implement com.sun.org.apache.xerces.internal.dom.NodeImpl.
*
* @param node The node to be tested.
*
* @throws TransformerException if the node is not one which this
* DOM2Helper can support. If we return without throwing the exception,
* the node is compatable.
* @xsl.usage internal
*/
public void checkNode(Node node) throws TransformerException
{
// if(!(node instanceof com.sun.org.apache.xerces.internal.dom.NodeImpl))
// throw new TransformerException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_XERCES_CANNOT_HANDLE_NODES, new Object[]{((Object)node).getClass()})); //"DOM2Helper can not handle nodes of type"
//+((Object)node).getClass());
} }
/** /**
* Returns true if the DOM implementation handled by this helper * Returns the local name of the given node, as defined by the XML
* supports the SAX ContentHandler interface. * Namespaces specification. This is prepared to handle documents built
* * using DOM Level 1 methods by falling back upon explicitly parsing the
* @return true (since Xerces does). * node name.
*/
public boolean supportsSAX()
{
return true;
}
/** Field m_doc: Document Node for the document this helper is currently
* accessing or building
* @see #setDocument
* @see #getDocument
* */
private Document m_doc;
/**
* Specify which document this helper is currently operating on.
*
* @param doc The DOM Document node for this document.
* @see #getDocument
*/
public void setDocument(Document doc)
{
m_doc = doc;
}
/**
* Query which document this helper is currently operating on.
*
* @return The DOM Document node for this document.
* @see #setDocument
*/
public Document getDocument()
{
return m_doc;
}
/**
* Parse an XML document.
*
* <p>Right now the Xerces DOMParser class is used. This needs
* fixing, either via jaxp, or via some other, standard method.</p>
*
* <p>The application can use this method to instruct the SAX parser
* to begin parsing an XML document from any valid input
* source (a character stream, a byte stream, or a URI).</p>
*
* <p>Applications may not invoke this method while a parse is in
* progress (they should create a new Parser instead for each
* additional XML document). Once a parse is complete, an
* application may reuse the same Parser object, possibly with a
* different input source.</p>
*
* @param source The input source for the top-level of the
* XML document.
*
* @throws TransformerException if any checked exception is thrown.
* @xsl.usage internal
*/
public void parse(InputSource source) throws TransformerException
{
try
{
// I guess I should use JAXP factory here... when it's legal.
// com.sun.org.apache.xerces.internal.parsers.DOMParser parser
// = new com.sun.org.apache.xerces.internal.parsers.DOMParser();
DocumentBuilderFactory builderFactory =
DocumentBuilderFactory.newInstance();
builderFactory.setNamespaceAware(true);
builderFactory.setValidating(true);
DocumentBuilder parser = builderFactory.newDocumentBuilder();
/*
// domParser.setFeature("http://apache.org/xml/features/dom/create-entity-ref-nodes", getShouldExpandEntityRefs()? false : true);
if(m_useDOM2getNamespaceURI)
{
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", true);
parser.setFeature("http://xml.org/sax/features/namespaces", true);
}
else
{
parser.setFeature("http://apache.org/xml/features/dom/defer-node-expansion", false);
}
parser.setFeature("http://apache.org/xml/features/allow-java-encodings", true);
*/
parser.setErrorHandler(
new com.sun.org.apache.xml.internal.utils.DefaultErrorHandler());
// if(null != m_entityResolver)
// {
// System.out.println("Setting the entity resolver.");
// parser.setEntityResolver(m_entityResolver);
// }
setDocument(parser.parse(source));
}
catch (org.xml.sax.SAXException se)
{
throw new TransformerException(se);
}
catch (ParserConfigurationException pce)
{
throw new TransformerException(pce);
}
catch (IOException ioe)
{
throw new TransformerException(ioe);
}
// setDocument(((com.sun.org.apache.xerces.internal.parsers.DOMParser)parser).getDocument());
}
/**
* Given an XML ID, return the element. This requires assistance from the
* DOM and parser, and is meaningful only in the context of a DTD
* or schema which declares attributes as being of type ID. This
* information may or may not be available in all parsers, may or
* may not be available for specific documents, and may or may not
* be available when validation is not turned on.
*
* @param id The ID to search for, as a String.
* @param doc The document to search within, as a DOM Document node.
* @return DOM Element node with an attribute of type ID whose value
* uniquely matches the requested id string, or null if there isn't
* such an element or if the DOM can't answer the question for other
* reasons.
*/
public Element getElementByID(String id, Document doc)
{
return doc.getElementById(id);
}
/**
* Figure out whether node2 should be considered as being later
* in the document than node1, in Document Order as defined
* by the XPath model. This may not agree with the ordering defined
* by other XML applications.
* <p>
* There are some cases where ordering isn't defined, and neither are
* the results of this function -- though we'll generally return true.
* <p>
* TODO: Make sure this does the right thing with attribute nodes!!!
*
* @param node1 DOM Node to perform position comparison on.
* @param node2 DOM Node to perform position comparison on .
*
* @return false if node2 comes before node1, otherwise return true.
* You can think of this as
* <code>(node1.documentOrderPosition &lt;= node2.documentOrderPosition)</code>.
*/
public static boolean isNodeAfter(Node node1, Node node2)
{
// Assume first that the nodes are DTM nodes, since discovering node
// order is massivly faster for the DTM.
if(node1 instanceof DOMOrder && node2 instanceof DOMOrder)
{
int index1 = ((DOMOrder) node1).getUid();
int index2 = ((DOMOrder) node2).getUid();
return index1 <= index2;
}
else
{
// isNodeAfter will return true if node is after countedNode
// in document order. The base isNodeAfter is sloooow (relatively).
return DOMHelper.isNodeAfter(node1, node2);
}
}
/**
* Get the XPath-model parent of a node. This version takes advantage
* of the DOM Level 2 Attr.ownerElement() method; the base version we
* would otherwise inherit is prepared to fall back on exhaustively
* walking the document to find an Attr's parent.
*
* @param node Node to be examined
*
* @return the DOM parent of the input node, if there is one, or the
* ownerElement if the input node is an Attr, or null if the node is
* a Document, a DocumentFragment, or an orphan.
*/
public static Node getParentOfNode(Node node)
{
Node parent=node.getParentNode();
if(parent==null && (Node.ATTRIBUTE_NODE == node.getNodeType()) )
parent=((Attr) node).getOwnerElement();
return parent;
}
/**
* Returns the local name of the given node, as defined by the
* XML Namespaces specification. This is prepared to handle documents
* built using DOM Level 1 methods by falling back upon explicitly
* parsing the node name.
* *
* @param n Node to be examined * @param n Node to be examined
* *
* @return String containing the local name, or null if the node * @return String containing the local name, or null if the node was not
* was not assigned a Namespace. * assigned a Namespace.
*/ */
public String getLocalNameOfNode(Node n) public static String getLocalNameOfNode(Node n) {
{
String name = n.getLocalName(); String name = n.getLocalName();
return (null == name) ? super.getLocalNameOfNode(n) : name; return (null == name) ? getLocalNameOfNodeFallback(n) : name;
} }
/** /**
* Returns the Namespace Name (Namespace URI) for the given node. * Returns the local name of the given node. If the node's name begins with
* In a Level 2 DOM, you can ask the node itself. Note, however, that * a namespace prefix, this is the part after the colon; otherwise it's the
* doing so conflicts with our decision in getLocalNameOfNode not * full node name.
* to trust the that the DOM was indeed created using the Level 2 *
* methods. If Level 1 methods were used, these two functions will * This method is copied from
* disagree with each other. * com.sun.org.apache.xml.internal.utils.DOMHelper
*
* @param n the node to be examined.
*
* @return String containing the Local Name
*/
private static String getLocalNameOfNodeFallback(Node n) {
String qname = n.getNodeName();
int index = qname.indexOf(':');
return (index < 0) ? qname : qname.substring(index + 1);
}
/**
* Returns the Namespace Name (Namespace URI) for the given node. In a Level
* 2 DOM, you can ask the node itself. Note, however, that doing so
* conflicts with our decision in getLocalNameOfNode not to trust the that
* the DOM was indeed created using the Level 2 methods. If Level 1 methods
* were used, these two functions will disagree with each other.
* <p> * <p>
* TODO: Reconcile with getLocalNameOfNode. * TODO: Reconcile with getLocalNameOfNode.
* *
* @param n Node to be examined * @param n Node to be examined
* *
* @return String containing the Namespace URI bound to this DOM node * @return String containing the Namespace URI bound to this DOM node at the
* at the time the Node was created. * time the Node was created.
*/ */
public String getNamespaceOfNode(Node n) public static String getNamespaceOfNode(Node n) {
{
return n.getNamespaceURI(); return n.getNamespaceURI();
} }
/** Field m_useDOM2getNamespaceURI is a compile-time flag which /**
* gates some of the parser options used to build a DOM -- but * Figure out whether node2 should be considered as being later in the
* that code is commented out at this time and nobody else * document than node1, in Document Order as defined by the XPath model.
* references it, so I've commented this out as well. */ * This may not agree with the ordering defined by other XML applications.
//private boolean m_useDOM2getNamespaceURI = false; * <p>
* There are some cases where ordering isn't defined, and neither are the
* results of this function -- though we'll generally return true.
*
* @param node1 DOM Node to perform position comparison on.
* @param node2 DOM Node to perform position comparison on .
*
* @return false if node2 comes before node1, otherwise return true. You can
* think of this as
* {@code (node1.documentOrderPosition &lt;= node2.documentOrderPosition)}.
*/
public static boolean isNodeAfter(Node node1, Node node2) {
if (node1 == node2 || isNodeTheSame(node1, node2)) {
return true;
}
// Default return value, if there is no defined ordering
boolean isNodeAfter = true;
Node parent1 = getParentOfNode(node1);
Node parent2 = getParentOfNode(node2);
// Optimize for most common case
if (parent1 == parent2 || isNodeTheSame(parent1, parent2)) // then we know they are siblings
{
if (null != parent1) {
isNodeAfter = isNodeAfterSibling(parent1, node1, node2);
}
} else {
// General strategy: Figure out the lengths of the two
// ancestor chains, reconcile the lengths, and look for
// the lowest common ancestor. If that ancestor is one of
// the nodes being compared, it comes before the other.
// Otherwise perform a sibling compare.
//
// NOTE: If no common ancestor is found, ordering is undefined
// and we return the default value of isNodeAfter.
// Count parents in each ancestor chain
int nParents1 = 2, nParents2 = 2; // include node & parent obtained above
while (parent1 != null) {
nParents1++;
parent1 = getParentOfNode(parent1);
}
while (parent2 != null) {
nParents2++;
parent2 = getParentOfNode(parent2);
}
// Initially assume scan for common ancestor starts with
// the input nodes.
Node startNode1 = node1, startNode2 = node2;
// If one ancestor chain is longer, adjust its start point
// so we're comparing at the same depths
if (nParents1 < nParents2) {
// Adjust startNode2 to depth of startNode1
int adjust = nParents2 - nParents1;
for (int i = 0; i < adjust; i++) {
startNode2 = getParentOfNode(startNode2);
}
} else if (nParents1 > nParents2) {
// adjust startNode1 to depth of startNode2
int adjust = nParents1 - nParents2;
for (int i = 0; i < adjust; i++) {
startNode1 = getParentOfNode(startNode1);
}
}
Node prevChild1 = null, prevChild2 = null; // so we can "back up"
// Loop up the ancestor chain looking for common parent
while (null != startNode1) {
if (startNode1 == startNode2 || isNodeTheSame(startNode1, startNode2)) // common parent?
{
if (null == prevChild1) // first time in loop?
{
// Edge condition: one is the ancestor of the other.
isNodeAfter = (nParents1 < nParents2) ? true : false;
break; // from while loop
} else {
// Compare ancestors below lowest-common as siblings
isNodeAfter = isNodeAfterSibling(startNode1, prevChild1,
prevChild2);
break; // from while loop
}
} // end if(startNode1 == startNode2)
// Move up one level and try again
prevChild1 = startNode1;
startNode1 = getParentOfNode(startNode1);
prevChild2 = startNode2;
startNode2 = getParentOfNode(startNode2);
} // end while(parents exist to examine)
} // end big else (not immediate siblings)
return isNodeAfter;
} // end isNodeAfter(Node node1, Node node2)
/**
* Use DTMNodeProxy to determine whether two nodes are the same.
*
* @param node1 The first DOM node to compare.
* @param node2 The second DOM node to compare.
* @return true if the two nodes are the same.
*/
public static boolean isNodeTheSame(Node node1, Node node2) {
if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy) {
return ((DTMNodeProxy) node1).equals((DTMNodeProxy) node2);
} else {
return (node1 == node2);
}
}
/**
* Get the XPath-model parent of a node. This version takes advantage of the
* DOM Level 2 Attr.ownerElement() method; the base version we would
* otherwise inherit is prepared to fall back on exhaustively walking the
* document to find an Attr's parent.
*
* @param node Node to be examined
*
* @return the DOM parent of the input node, if there is one, or the
* ownerElement if the input node is an Attr, or null if the node is a
* Document, a DocumentFragment, or an orphan.
*/
public static Node getParentOfNode(Node node) {
Node parent = node.getParentNode();
if (parent == null && (Node.ATTRIBUTE_NODE == node.getNodeType())) {
parent = ((Attr) node).getOwnerElement();
}
return parent;
}
/**
* Figure out if child2 is after child1 in document order.
* <p>
* Warning: Some aspects of "document order" are not well defined. For
* example, the order of attributes is considered meaningless in XML, and
* the order reported by our model will be consistent for a given invocation
* but may not match that of either the source file or the serialized
* output.
*
* @param parent Must be the parent of both child1 and child2.
* @param child1 Must be the child of parent and not equal to child2.
* @param child2 Must be the child of parent and not equal to child1.
* @return true if child 2 is after child1 in document order.
*/
private static boolean isNodeAfterSibling(Node parent, Node child1,
Node child2) {
boolean isNodeAfterSibling = false;
short child1type = child1.getNodeType();
short child2type = child2.getNodeType();
if ((Node.ATTRIBUTE_NODE != child1type)
&& (Node.ATTRIBUTE_NODE == child2type)) {
// always sort attributes before non-attributes.
isNodeAfterSibling = false;
} else if ((Node.ATTRIBUTE_NODE == child1type)
&& (Node.ATTRIBUTE_NODE != child2type)) {
// always sort attributes before non-attributes.
isNodeAfterSibling = true;
} else if (Node.ATTRIBUTE_NODE == child1type) {
NamedNodeMap children = parent.getAttributes();
int nNodes = children.getLength();
boolean found1 = false, found2 = false;
// Count from the start until we find one or the other.
for (int i = 0; i < nNodes; i++) {
Node child = children.item(i);
if (child1 == child || isNodeTheSame(child1, child)) {
if (found2) {
isNodeAfterSibling = false;
break;
}
found1 = true;
} else if (child2 == child || isNodeTheSame(child2, child)) {
if (found1) {
isNodeAfterSibling = true;
break;
}
found2 = true;
}
}
} else {
// TODO: Check performance of alternate solution:
// There are two choices here: Count from the start of
// the document until we find one or the other, or count
// from one until we find or fail to find the other.
// Either can wind up scanning all the siblings in the worst
// case, which on a wide document can be a lot of work but
// is more typically is a short list.
// Scanning from the start involves two tests per iteration,
// but it isn't clear that scanning from the middle doesn't
// yield more iterations on average.
// We should run some testcases.
Node child = parent.getFirstChild();
boolean found1 = false, found2 = false;
while (null != child) {
// Node child = children.item(i);
if (child1 == child || isNodeTheSame(child1, child)) {
if (found2) {
isNodeAfterSibling = false;
break;
}
found1 = true;
} else if (child2 == child || isNodeTheSame(child2, child)) {
if (found1) {
isNodeAfterSibling = true;
break;
}
found2 = true;
}
child = child.getNextSibling();
}
}
return isNodeAfterSibling;
} // end isNodeAfterSibling(Node parent, Node child1, Node child2)
} }

View file

@ -1,42 +0,0 @@
/*
* reserved comment block
* DO NOT REMOVE OR ALTER!
*/
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.sun.org.apache.xml.internal.utils;
/**
* @deprecated Since the introduction of the DTM, this class will be removed.
* Nodes that implement this index can return a document order index.
* Eventually, this will be replaced by DOM 3 methods.
* (compareDocumentOrder and/or compareTreePosition.)
*/
public interface DOMOrder
{
/**
* Get the UID (document order index).
*
* @return integer whose relative value corresponds to document order
* -- that is, if node1.getUid()<node2.getUid(), node1 comes before
* node2, and if they're equal node1 and node2 are the same node. No
* promises are made beyond that.
*/
public int getUid();
}

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -17,11 +17,11 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package com.sun.org.apache.xml.internal.utils; package com.sun.org.apache.xml.internal.utils;
import com.sun.org.apache.xalan.internal.utils.SecuritySupport; import com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler;
import java.io.File; import javax.xml.transform.Result;
import org.w3c.dom.Comment; import org.w3c.dom.Comment;
import org.w3c.dom.Element; import org.w3c.dom.Element;
import org.w3c.dom.EntityReference; import org.w3c.dom.EntityReference;
@ -47,12 +47,6 @@ public class TreeWalker
/** Local reference to a ContentHandler */ /** Local reference to a ContentHandler */
private ContentHandler m_contentHandler = null; private ContentHandler m_contentHandler = null;
// ARGHH!! JAXP Uses Xerces without setting the namespace processing to ON!
// DOM2Helper m_dh = new DOM2Helper();
/** DomHelper for this TreeWalker */
protected DOMHelper m_dh;
/** Locator object for this TreeWalker */ /** Locator object for this TreeWalker */
private LocatorImpl m_locator = new LocatorImpl(); private LocatorImpl m_locator = new LocatorImpl();
@ -82,26 +76,15 @@ public class TreeWalker
* @param systemId System identifier for the document. * @param systemId System identifier for the document.
* contentHandler operation (toXMLString, digest, ...) * contentHandler operation (toXMLString, digest, ...)
*/ */
public TreeWalker(ContentHandler contentHandler, DOMHelper dh, String systemId) public TreeWalker(ContentHandler contentHandler, String systemId)
{ {
this.m_contentHandler = contentHandler; this.m_contentHandler = contentHandler;
if (m_contentHandler != null) {
m_contentHandler.setDocumentLocator(m_locator); m_contentHandler.setDocumentLocator(m_locator);
}
if (systemId != null) { if (systemId != null) {
m_locator.setSystemId(systemId); m_locator.setSystemId(systemId);
} }
m_dh = dh;
}
/**
* Constructor.
* @param contentHandler The implementation of the
* contentHandler operation (toXMLString, digest, ...)
*/
public TreeWalker(ContentHandler contentHandler, DOMHelper dh)
{
this.m_contentHandler = contentHandler;
m_contentHandler.setDocumentLocator(m_locator);
m_dh = dh;
} }
/** /**
@ -111,11 +94,7 @@ public class TreeWalker
*/ */
public TreeWalker(ContentHandler contentHandler) public TreeWalker(ContentHandler contentHandler)
{ {
this.m_contentHandler = contentHandler; this(contentHandler, null);
if (m_contentHandler != null) {
m_contentHandler.setDocumentLocator(m_locator);
}
m_dh = new DOM2Helper();
} }
/** /**
@ -239,7 +218,7 @@ public class TreeWalker
this.m_contentHandler.endDocument(); this.m_contentHandler.endDocument();
} }
/** Flag indicating whether following text to be processed is raw text */ // Flag indicating whether following text to be processed is raw text
boolean nextIsRaw = false; boolean nextIsRaw = false;
/** /**
@ -248,9 +227,9 @@ public class TreeWalker
private final void dispatachChars(Node node) private final void dispatachChars(Node node)
throws org.xml.sax.SAXException throws org.xml.sax.SAXException
{ {
if(m_contentHandler instanceof com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler) if(m_contentHandler instanceof CharacterNodeHandler)
{ {
((com.sun.org.apache.xml.internal.dtm.ref.dom2dtm.DOM2DTM.CharacterNodeHandler)m_contentHandler).characters(node); ((CharacterNodeHandler)m_contentHandler).characters(node);
} }
else else
{ {
@ -313,17 +292,14 @@ public class TreeWalker
case Node.ELEMENT_NODE : case Node.ELEMENT_NODE :
NamedNodeMap atts = ((Element) node).getAttributes(); NamedNodeMap atts = ((Element) node).getAttributes();
int nAttrs = atts.getLength(); int nAttrs = atts.getLength();
// System.out.println("TreeWalker#startNode: "+node.getNodeName());
for (int i = 0; i < nAttrs; i++) for (int i = 0; i < nAttrs; i++)
{ {
Node attr = atts.item(i); Node attr = atts.item(i);
String attrName = attr.getNodeName(); String attrName = attr.getNodeName();
// System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
if (attrName.equals("xmlns") || attrName.startsWith("xmlns:")) if (attrName.equals("xmlns") || attrName.startsWith("xmlns:"))
{ {
// System.out.println("TreeWalker#startNode: attr["+i+"] = "+attrName+", "+attr.getNodeValue());
int index; int index;
// Use "" instead of null, as Xerces likes "" for the // Use "" instead of null, as Xerces likes "" for the
// name of the default namespace. Fix attributed // name of the default namespace. Fix attributed
@ -337,15 +313,13 @@ public class TreeWalker
} }
// System.out.println("m_dh.getNamespaceOfNode(node): "+m_dh.getNamespaceOfNode(node)); String ns = DOM2Helper.getNamespaceOfNode(node);
// System.out.println("m_dh.getLocalNameOfNode(node): "+m_dh.getLocalNameOfNode(node));
String ns = m_dh.getNamespaceOfNode(node);
if(null == ns) if(null == ns)
ns = ""; ns = "";
this.m_contentHandler.startElement(ns, this.m_contentHandler.startElement(ns,
m_dh.getLocalNameOfNode(node), DOM2Helper.getLocalNameOfNode(node),
node.getNodeName(), node.getNodeName(),
new AttList(atts, m_dh)); new AttList(atts));
break; break;
case Node.PROCESSING_INSTRUCTION_NODE : case Node.PROCESSING_INSTRUCTION_NODE :
{ {
@ -393,9 +367,9 @@ public class TreeWalker
{ {
nextIsRaw = false; nextIsRaw = false;
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_DISABLE_OUTPUT_ESCAPING, ""); m_contentHandler.processingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, "");
dispatachChars(node); dispatachChars(node);
m_contentHandler.processingInstruction(javax.xml.transform.Result.PI_ENABLE_OUTPUT_ESCAPING, ""); m_contentHandler.processingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, "");
} }
else else
{ {
@ -440,11 +414,11 @@ public class TreeWalker
break; break;
case Node.ELEMENT_NODE : case Node.ELEMENT_NODE :
String ns = m_dh.getNamespaceOfNode(node); String ns = DOM2Helper.getNamespaceOfNode(node);
if(null == ns) if(null == ns)
ns = ""; ns = "";
this.m_contentHandler.endElement(ns, this.m_contentHandler.endElement(ns,
m_dh.getLocalNameOfNode(node), DOM2Helper.getLocalNameOfNode(node),
node.getNodeName()); node.getNodeName());
NamedNodeMap atts = ((Element) node).getAttributes(); NamedNodeMap atts = ((Element) node).getAttributes();

View file

@ -1,6 +1,5 @@
/* /*
* reserved comment block * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT REMOVE OR ALTER!
*/ */
/* /*
* Licensed to the Apache Software Foundation (ASF) under one or more * Licensed to the Apache Software Foundation (ASF) under one or more
@ -28,6 +27,7 @@ import com.sun.org.apache.xpath.internal.objects.XObject;
* The 'quo' operation expression executer. (no longer supported by XPath). * The 'quo' operation expression executer. (no longer supported by XPath).
* @deprecated * @deprecated
*/ */
@Deprecated
public class Quo extends Operation public class Quo extends Operation
{ {
static final long serialVersionUID = 693765299196169905L; static final long serialVersionUID = 693765299196169905L;

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -66,6 +66,7 @@ package org.xml.sax;
* @see org.xml.sax.DocumentHandler * @see org.xml.sax.DocumentHandler
* @see org.xml.sax.ErrorHandler * @see org.xml.sax.ErrorHandler
*/ */
@Deprecated(since="1.5")
public class HandlerBase public class HandlerBase
implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler implements EntityResolver, DTDHandler, DocumentHandler, ErrorHandler
{ {

View file

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2000, 2005, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* *
* This code is free software; you can redistribute it and/or modify it * This code is free software; you can redistribute it and/or modify it
@ -87,6 +87,7 @@ import java.util.Vector;
* @see org.xml.sax.AttributeList * @see org.xml.sax.AttributeList
* @see org.xml.sax.DocumentHandler#startElement * @see org.xml.sax.DocumentHandler#startElement
*/ */
@Deprecated(since="1.5")
public class AttributeListImpl implements AttributeList public class AttributeListImpl implements AttributeList
{ {