diff -Nru boilerpipe-1.2.0/pom.xml boilerpipe-1.2.0-gil/pom.xml
--- boilerpipe-1.2.0/pom.xml 2013-10-11 11:54:23.418310128 +0200
+++ boilerpipe-1.2.0-gil/pom.xml 2013-10-11 11:51:51.334701196 +0200
@@ -32,4 +32,13 @@
- * Note:
- * The
- * This component recognizes the following features:
- *
- * This component recognizes the following properties:
- * getElement method requires that the HTML elements
- * are added to the list in alphabetical order. If new elements are
- * added, then they must be inserted in alphabetical order.
- */
- static {
- //
- //
- //
- //
- //
- //
- //
- //
-
- // initialize array of element information
- ELEMENTS_ARRAY['A'-'A'] = new Element[] {
- // A - - (%inline;)* -(A)
- new Element(A, "A", Element.INLINE, BODY, new short[] {A}),
- // ABBR - - (%inline;)*
- new Element(ABBR, "ABBR", Element.INLINE, BODY, null),
- // ACRONYM - - (%inline;)*
- new Element(ACRONYM, "ACRONYM", Element.INLINE, BODY, null),
- // ADDRESS - - (%inline;)*
- new Element(ADDRESS, "ADDRESS", Element.BLOCK, BODY, null),
- // APPLET
- new Element(APPLET, "APPLET", 0, BODY, null),
- // AREA - O EMPTY
- new Element(AREA, "AREA", Element.EMPTY, MAP, null),
- };
- ELEMENTS_ARRAY['B'-'A'] = new Element[] {
- // B - - (%inline;)*
- new Element(B, "B", Element.INLINE, BODY, null),
- // BASE - O EMPTY
- new Element(BASE, "BASE", Element.EMPTY, HEAD, null),
- // BASEFONT
- new Element(BASEFONT, "BASEFONT", 0, HEAD, null),
- // BDO - - (%inline;)*
- new Element(BDO, "BDO", Element.INLINE, BODY, null),
- // BGSOUND
- new Element(BGSOUND, "BGSOUND", Element.EMPTY, HEAD, null),
- // BIG - - (%inline;)*
- new Element(BIG, "BIG", Element.INLINE, BODY, null),
- // BLINK
- new Element(BLINK, "BLINK", Element.INLINE, BODY, null),
- // BLOCKQUOTE - - (%block;|SCRIPT)+
- new Element(BLOCKQUOTE, "BLOCKQUOTE", Element.BLOCK, BODY, new short[]{P}),
- // BODY O O (%block;|SCRIPT)+ +(INS|DEL)
- new Element(BODY, "BODY", Element.CONTAINER, HTML, new short[]{HEAD}),
- // BR - O EMPTY
- new Element(BR, "BR", Element.EMPTY, BODY, null),
- // BUTTON - - (%flow;)* -(A|%formctrl;|FORM|FIELDSET)
- new Element(BUTTON, "BUTTON", 0, BODY, null),
- };
- ELEMENTS_ARRAY['C'-'A'] = new Element[] {
- // CAPTION - - (%inline;)*
- new Element(CAPTION, "CAPTION", Element.INLINE, TABLE, null),
- // CENTER,
- new Element(CENTER, "CENTER", 0, BODY, null),
- // CITE - - (%inline;)*
- new Element(CITE, "CITE", Element.INLINE, BODY, null),
- // CODE - - (%inline;)*
- new Element(CODE, "CODE", Element.INLINE, BODY, null),
- // COL - O EMPTY
- new Element(COL, "COL", Element.EMPTY, TABLE, null),
- // COLGROUP - O (COL)*
- new Element(COLGROUP, "COLGROUP", 0, TABLE, new short[]{COL,COLGROUP}),
- // COMMENT
- new Element(COMMENT, "COMMENT", Element.SPECIAL, HTML, null),
- };
- ELEMENTS_ARRAY['D'-'A'] = new Element[] {
- // DEL - - (%flow;)*
- new Element(DEL, "DEL", 0, BODY, null),
- // DFN - - (%inline;)*
- new Element(DFN, "DFN", Element.INLINE, BODY, null),
- // DIR
- new Element(DIR, "DIR", 0, BODY, null),
- // DIV - - (%flow;)*
- new Element(DIV, "DIV", Element.BLOCK, BODY, new short[]{P}),
- // DD - O (%flow;)*
- new Element(DD, "DD", 0, DL, new short[]{DT,DD}),
- // DL - - (DT|DD)+
- new Element(DL, "DL", Element.BLOCK, BODY, null),
- // DT - O (%inline;)*
- new Element(DT, "DT", 0, DL, new short[]{DT,DD}),
- };
- ELEMENTS_ARRAY['E'-'A'] = new Element[] {
- // EM - - (%inline;)*
- new Element(EM, "EM", Element.INLINE, BODY, null),
- // EMBED
- new Element(EMBED, "EMBED", 0, BODY, null),
- };
- ELEMENTS_ARRAY['F'-'A'] = new Element[] {
- // FIELDSET - - (#PCDATA,LEGEND,(%flow;)*)
- new Element(FIELDSET, "FIELDSET", 0, BODY, null),
- // FONT
- new Element(FONT, "FONT", Element.CONTAINER, BODY, null),
- // FORM - - (%block;|SCRIPT)+ -(FORM)
- new Element(FORM, "FORM", Element.CONTAINER, new short[]{BODY,TD,DIV}, new short[]{BUTTON,P}),
- // FRAME - O EMPTY
- new Element(FRAME, "FRAME", Element.EMPTY, FRAMESET, null),
- // FRAMESET - - ((FRAMESET|FRAME)+ & NOFRAMES?)
- new Element(FRAMESET, "FRAMESET", 0, HTML, null),
- };
- ELEMENTS_ARRAY['H'-'A'] = new Element[] {
- // (H1|H2|H3|H4|H5|H6) - - (%inline;)*
- new Element(H1, "H1", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- new Element(H2, "H2", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- new Element(H3, "H3", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- new Element(H4, "H4", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- new Element(H5, "H5", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- new Element(H6, "H6", Element.BLOCK, new short[]{BODY,A}, new short[]{H1,H2,H3,H4,H5,H6,P}),
- // HEAD O O (%head.content;) +(%head.misc;)
- new Element(HEAD, "HEAD", 0, HTML, null),
- // HR - O EMPTY
- new Element(HR, "HR", Element.EMPTY, BODY, new short[]{P}),
- // HTML O O (%html.content;)
- new Element(HTML, "HTML", 0, null, null),
- };
- ELEMENTS_ARRAY['I'-'A'] = new Element[] {
- // I - - (%inline;)*
- new Element(I, "I", Element.INLINE, BODY, null),
- // IFRAME
- new Element(IFRAME, "IFRAME", Element.BLOCK, BODY, null),
- // ILAYER
- new Element(ILAYER, "ILAYER", Element.BLOCK, BODY, null),
- // IMG - O EMPTY
- new Element(IMG, "IMG", Element.EMPTY, BODY, null),
- // INPUT - O EMPTY
- new Element(INPUT, "INPUT", Element.EMPTY, BODY, null),
- // INS - - (%flow;)*
- new Element(INS, "INS", 0, BODY, null),
- // ISINDEX
- new Element(ISINDEX, "ISINDEX", 0, HEAD, null),
- };
- ELEMENTS_ARRAY['K'-'A'] = new Element[] {
- // KBD - - (%inline;)*
- new Element(KBD, "KBD", Element.INLINE, BODY, null),
- // KEYGEN
- new Element(KEYGEN, "KEYGEN", 0, BODY, null),
- };
- ELEMENTS_ARRAY['L'-'A'] = new Element[] {
- // LABEL - - (%inline;)* -(LABEL)
- new Element(LABEL, "LABEL", 0, BODY, null),
- // LAYER
- new Element(LAYER, "LAYER", Element.BLOCK, BODY, null),
- // LEGEND - - (%inline;)*
- new Element(LEGEND, "LEGEND", Element.INLINE, FIELDSET, null),
- // LI - O (%flow;)*
- new Element(LI, "LI", 0, new short[]{BODY,UL,OL}, new short[]{LI}),
- // LINK - O EMPTY
- new Element(LINK, "LINK", Element.EMPTY, HEAD, null),
- // LISTING
- new Element(LISTING, "LISTING", 0, BODY, null),
- };
- ELEMENTS_ARRAY['M'-'A'] = new Element[] {
- // MAP - - ((%block;) | AREA)+
- new Element(MAP, "MAP", Element.INLINE, BODY, null),
- // MARQUEE
- new Element(MARQUEE, "MARQUEE", 0, BODY, null),
- // MENU
- new Element(MENU, "MENU", 0, BODY, null),
- // META - O EMPTY
- new Element(META, "META", Element.EMPTY, HEAD, new short[]{STYLE,TITLE}),
- // MULTICOL
- new Element(MULTICOL, "MULTICOL", 0, BODY, null),
- };
- ELEMENTS_ARRAY['N'-'A'] = new Element[] {
- // NEXTID
- new Element(NEXTID, "NEXTID", Element.EMPTY, BODY, null),
- // NOBR
- new Element(NOBR, "NOBR", Element.INLINE, BODY, null),
- // NOEMBED
- new Element(NOEMBED, "NOEMBED", 0, BODY, null),
- // NOFRAMES - - (BODY) -(NOFRAMES)
- new Element(NOFRAMES, "NOFRAMES", 0, FRAMESET, null),
- // NOLAYER
- new Element(NOLAYER, "NOLAYER", 0, BODY, null),
- // NOSCRIPT - - (%block;)+
- new Element(NOSCRIPT, "NOSCRIPT", 0, new short[]{BODY}, null),
- };
- ELEMENTS_ARRAY['O'-'A'] = new Element[] {
- // OBJECT - - (PARAM | %flow;)*
- new Element(OBJECT, "OBJECT", 0, BODY, null),
- // OL - - (LI)+
- new Element(OL, "OL", Element.BLOCK, BODY, null),
- // OPTGROUP - - (OPTION)+
- new Element(OPTGROUP, "OPTGROUP", 0, SELECT, new short[]{OPTION}),
- // OPTION - O (#PCDATA)
- new Element(OPTION, "OPTION", 0, SELECT, new short[]{OPTION}),
- };
- ELEMENTS_ARRAY['P'-'A'] = new Element[] {
- // P - O (%inline;)*
- new Element(P, "P", Element.CONTAINER, BODY, new short[]{P}),
- // PARAM - O EMPTY
- new Element(PARAM, "PARAM", Element.EMPTY, new short[]{OBJECT,APPLET}, null),
- // PLAINTEXT
- new Element(PLAINTEXT, "PLAINTEXT", Element.SPECIAL, BODY, null),
- // PRE - - (%inline;)* -(%pre.exclusion;)
- new Element(PRE, "PRE", 0, BODY, null),
- };
- ELEMENTS_ARRAY['Q'-'A'] = new Element[] {
- // Q - - (%inline;)*
- new Element(Q, "Q", Element.INLINE, BODY, null),
- };
- ELEMENTS_ARRAY['R'-'A'] = new Element[] {
- // RB
- new Element(RB, "RB", Element.INLINE, RUBY, new short[]{RB}),
- // RBC
- new Element(RBC, "RBC", 0, RUBY, null),
- // RP
- new Element(RP, "RP", Element.INLINE, RUBY, new short[]{RB}),
- // RT
- new Element(RT, "RT", Element.INLINE, RUBY, new short[]{RB,RP}),
- // RTC
- new Element(RTC, "RTC", 0, RUBY, new short[]{RBC}),
- // RUBY
- new Element(RUBY, "RUBY", 0, BODY, new short[]{RUBY}),
- };
- ELEMENTS_ARRAY['S'-'A'] = new Element[] {
- // S
- new Element(S, "S", 0, BODY, null),
- // SAMP - - (%inline;)*
- new Element(SAMP, "SAMP", Element.INLINE, BODY, null),
- // SCRIPT - - %Script;
- new Element(SCRIPT, "SCRIPT", Element.SPECIAL, new short[]{HEAD,BODY}, null),
- // SELECT - - (OPTGROUP|OPTION)+
- new Element(SELECT, "SELECT", Element.CONTAINER, BODY, new short[]{SELECT}),
- // SMALL - - (%inline;)*
- new Element(SMALL, "SMALL", Element.INLINE, BODY, null),
- // SOUND
- new Element(SOUND, "SOUND", Element.EMPTY, HEAD, null),
- // SPACER
- new Element(SPACER, "SPACER", Element.EMPTY, BODY, null),
- // SPAN - - (%inline;)*
- new Element(SPAN, "SPAN", Element.CONTAINER, BODY, null),
- // STRIKE
- new Element(STRIKE, "STRIKE", Element.INLINE, BODY, null),
- // STRONG - - (%inline;)*
- new Element(STRONG, "STRONG", Element.INLINE, BODY, null),
- // STYLE - - %StyleSheet;
- new Element(STYLE, "STYLE", Element.SPECIAL, new short[]{HEAD,BODY}, new short[]{STYLE,TITLE,META}),
- // SUB - - (%inline;)*
- new Element(SUB, "SUB", Element.INLINE, BODY, null),
- // SUP - - (%inline;)*
- new Element(SUP, "SUP", Element.INLINE, BODY, null),
- };
- ELEMENTS_ARRAY['T'-'A'] = new Element[] {
- // TABLE - - (CAPTION?, (COL*|COLGROUP*), THEAD?, TFOOT?, TBODY+)
- new Element(TABLE, "TABLE", Element.BLOCK|Element.CONTAINER, BODY, null),
- // TBODY O O (TR)+
- new Element(TBODY, "TBODY", 0, TABLE, new short[]{THEAD,TD,TH,TR,COLGROUP}),
- // TD - O (%flow;)*
- new Element(TD, "TD", Element.CONTAINER, TR, TABLE, new short[]{TD,TH}),
- // TEXTAREA - - (#PCDATA)
- new Element(TEXTAREA, "TEXTAREA", Element.SPECIAL, BODY, null),
- // TFOOT - O (TR)+
- new Element(TFOOT, "TFOOT", 0, TABLE, new short[]{THEAD,TBODY,TD,TH,TR}),
- // TH - O (%flow;)*
- new Element(TH, "TH", Element.CONTAINER, TR, TABLE, new short[]{TD,TH}),
- // THEAD - O (TR)+
- new Element(THEAD, "THEAD", 0, TABLE, new short[]{COLGROUP}),
- // TITLE - - (#PCDATA) -(%head.misc;)
- new Element(TITLE, "TITLE", Element.SPECIAL, new short[]{HEAD,BODY}, null),
- // TR - O (TH|TD)+
- new Element(TR, "TR", Element.BLOCK, new short[]{TBODY, THEAD, TFOOT}, TABLE, new short[]{TD,TH,TR,COLGROUP}),
- // TT - - (%inline;)*
- new Element(TT, "TT", Element.INLINE, BODY, null),
- };
- ELEMENTS_ARRAY['U'-'A'] = new Element[] {
- // U,
- new Element(U, "U", Element.INLINE, BODY, null),
- // UL - - (LI)+
- new Element(UL, "UL", Element.BLOCK, BODY, null),
- };
- ELEMENTS_ARRAY['V'-'A'] = new Element[] {
- // VAR - - (%inline;)*
- new Element(VAR, "VAR", Element.INLINE, BODY, null),
- };
- ELEMENTS_ARRAY['W'-'A'] = new Element[] {
- // WBR
- new Element(WBR, "WBR", Element.EMPTY, BODY, null),
- };
- ELEMENTS_ARRAY['X'-'A'] = new Element[] {
- // XML
- new Element(XML, "XML", 0, BODY, null),
- // XMP
- new Element(XMP, "XMP", Element.SPECIAL, BODY, null),
- };
-
- // keep contiguous list of elements for lookups by code
- for (int i = 0; i < ELEMENTS_ARRAY.length; i++) {
- Element[] elements = ELEMENTS_ARRAY[i];
- if (elements != null) {
- for (int j = 0; j < elements.length; j++) {
- Element element = elements[j];
- ELEMENTS.addElement(element);
- }
- }
- }
- ELEMENTS.addElement(NO_SUCH_ELEMENT);
-
- // initialize cross references to parent elements
- for (int i = 0; i < ELEMENTS.size; i++) {
- Element element = ELEMENTS.data[i];
- if (element.parentCodes != null) {
- element.parent = new Element[element.parentCodes.length];
- for (int j = 0; j < element.parentCodes.length; j++) {
- element.parent[j] = ELEMENTS.data[element.parentCodes[j]];
- }
- element.parentCodes = null;
- }
- }
-
- } // true if element belongs to the {@link #parent}
- */
- public boolean isParent(final Element element) {
- if (parent == null)
- return false;
- else {
- for (int i=0; i
- *
- *
- *
- *
- * @see HTMLElements
- *
- * @author Andy Clark
- * @author Marc Guillemot
- *
- * @version $Id: HTMLTagBalancer.java,v 1.20 2005/02/14 04:06:22 andyc Exp $
- */
-public class HTMLTagBalancer
- implements XMLDocumentFilter, HTMLComponent {
-
- //
- // Constants
- //
-
- // features
-
- /** Namespaces. */
- protected static final String NAMESPACES = "http://xml.org/sax/features/namespaces";
-
- /** Include infoset augmentations. */
- protected static final String AUGMENTATIONS = "http://cyberneko.org/html/features/augmentations";
-
- /** Report errors. */
- protected static final String REPORT_ERRORS = "http://cyberneko.org/html/features/report-errors";
-
- /** Document fragment balancing only (deprecated). */
- protected static final String DOCUMENT_FRAGMENT_DEPRECATED = "http://cyberneko.org/html/features/document-fragment";
-
- /** Document fragment balancing only. */
- protected static final String DOCUMENT_FRAGMENT = "http://cyberneko.org/html/features/balance-tags/document-fragment";
-
- /** Ignore outside content. */
- protected static final String IGNORE_OUTSIDE_CONTENT = "http://cyberneko.org/html/features/balance-tags/ignore-outside-content";
-
- /** Recognized features. */
- private static final String[] RECOGNIZED_FEATURES = {
- NAMESPACES,
- AUGMENTATIONS,
- REPORT_ERRORS,
- DOCUMENT_FRAGMENT_DEPRECATED,
- DOCUMENT_FRAGMENT,
- IGNORE_OUTSIDE_CONTENT,
- };
-
- /** Recognized features defaults. */
- private static final Boolean[] RECOGNIZED_FEATURES_DEFAULTS = {
- null,
- null,
- null,
- null,
- Boolean.FALSE,
- Boolean.FALSE,
- };
-
- // properties
-
- /** Modify HTML element names: { "upper", "lower", "default" }. */
- protected static final String NAMES_ELEMS = "http://cyberneko.org/html/properties/names/elems";
-
- /** Modify HTML attribute names: { "upper", "lower", "default" }. */
- protected static final String NAMES_ATTRS = "http://cyberneko.org/html/properties/names/attrs";
-
- /** Error reporter. */
- protected static final String ERROR_REPORTER = "http://cyberneko.org/html/properties/error-reporter";
-
- /**
- * EXPERIMENTAL: may change in next release
- * Name of the property holding the stack of elements in which context a document fragment should be parsed.
- **/
- public static final String FRAGMENT_CONTEXT_STACK = "http://cyberneko.org/html/properties/balance-tags/fragment-context-stack";
-
- /** Recognized properties. */
- private static final String[] RECOGNIZED_PROPERTIES = {
- NAMES_ELEMS,
- NAMES_ATTRS,
- ERROR_REPORTER,
- FRAGMENT_CONTEXT_STACK,
- };
-
- /** Recognized properties defaults. */
- private static final Object[] RECOGNIZED_PROPERTIES_DEFAULTS = {
- null,
- null,
- null,
- null,
- };
-
- // modify HTML names
-
- /** Don't modify HTML names. */
- protected static final short NAMES_NO_CHANGE = 0;
-
- /** Match HTML element names. */
- protected static final short NAMES_MATCH = 0;
-
- /** Uppercase HTML names. */
- protected static final short NAMES_UPPERCASE = 1;
-
- /** Lowercase HTML names. */
- protected static final short NAMES_LOWERCASE = 2;
-
- // static vars
-
- /** Synthesized event info item. */
- protected static final HTMLEventInfo SYNTHESIZED_ITEM =
- new HTMLEventInfo.SynthesizedItem();
-
- //
- // Data
- //
-
- // features
-
- /** Namespaces. */
- protected boolean fNamespaces;
-
- /** Include infoset augmentations. */
- protected boolean fAugmentations;
-
- /** Report errors. */
- protected boolean fReportErrors;
-
- /** Document fragment balancing only. */
- protected boolean fDocumentFragment;
-
- /** Ignore outside content. */
- protected boolean fIgnoreOutsideContent;
-
- // properties
-
- /** Modify HTML element names. */
- protected short fNamesElems;
-
- /** Modify HTML attribute names. */
- protected short fNamesAttrs;
-
- /** Error reporter. */
- protected HTMLErrorReporter fErrorReporter;
-
- // connections
-
- /** The document source. */
- protected XMLDocumentSource fDocumentSource;
-
- /** The document handler. */
- protected XMLDocumentHandler fDocumentHandler;
-
- // state
-
- /** The element stack. */
- protected final InfoStack fElementStack = new InfoStack();
-
- /** The inline stack. */
- protected final InfoStack fInlineStack = new InfoStack();
-
- /** True if seen anything. Important for xml declaration. */
- protected boolean fSeenAnything;
-
- /** True if root element has been seen. */
- protected boolean fSeenDoctype;
-
- /** True if root element has been seen. */
- protected boolean fSeenRootElement;
-
- /**
- * True if seen the end of the document element. In other words,
- * this variable is set to false until the end </HTML>
- * tag is seen (or synthesized). This is used to ensure that
- * extraneous events after the end of the document element do not
- * make the document stream ill-formed.
- */
- protected boolean fSeenRootElementEnd;
-
- /** True if seen <head< element. */
- protected boolean fSeenHeadElement;
-
- /** True if seen <body< element. */
- protected boolean fSeenBodyElement;
-
- /** True if a form is in the stack (allow to discard opening of nested forms) */
- protected boolean fOpenedForm;
-
- // temp vars
-
- /** A qualified name. */
- private final QName fQName = new QName();
-
- /** Empty attributes. */
- private final XMLAttributes fEmptyAttrs = new XMLAttributesImpl();
-
- /** Augmentations. */
- private final HTMLAugmentations fInfosetAugs = new HTMLAugmentations();
-
- protected HTMLTagBalancingListener tagBalancingListener;
- private LostText lostText_ = new LostText();
-
- private boolean forcedStartElement_ = false;
- private boolean forcedEndElement_ = false;
-
- /**
- * Stack of elements determining the context in which a document fragment should be parsed
- */
- private QName[] fragmentContextStack_ = null;
- private int fragmentContextStackSize_ = 0; // not 0 only when a fragment is parsed and fragmentContextStack_ is set
-
- private List/*ElementEntry*/ endElementsBuffer_ = new ArrayList();
-
- //
- // HTMLComponent methods
- //
-
- /** Returns the default state for a feature. */
- public Boolean getFeatureDefault(String featureId) {
- int length = RECOGNIZED_FEATURES != null ? RECOGNIZED_FEATURES.length : 0;
- for (int i = 0; i < length; i++) {
- if (RECOGNIZED_FEATURES[i].equals(featureId)) {
- return RECOGNIZED_FEATURES_DEFAULTS[i];
- }
- }
- return null;
- } // getFeatureDefault(String):Boolean
-
- /** Returns the default state for a property. */
- public Object getPropertyDefault(String propertyId) {
- int length = RECOGNIZED_PROPERTIES != null ? RECOGNIZED_PROPERTIES.length : 0;
- for (int i = 0; i < length; i++) {
- if (RECOGNIZED_PROPERTIES[i].equals(propertyId)) {
- return RECOGNIZED_PROPERTIES_DEFAULTS[i];
- }
- }
- return null;
- } // getPropertyDefault(String):Object
-
- //
- // XMLComponent methods
- //
-
- /** Returns recognized features. */
- public String[] getRecognizedFeatures() {
- return RECOGNIZED_FEATURES;
- } // getRecognizedFeatures():String[]
-
- /** Returns recognized properties. */
- public String[] getRecognizedProperties() {
- return RECOGNIZED_PROPERTIES;
- } // getRecognizedProperties():String[]
-
- /** Resets the component. */
- public void reset(XMLComponentManager manager)
- throws XMLConfigurationException {
-
- // get features
- fNamespaces = manager.getFeature(NAMESPACES);
- fAugmentations = manager.getFeature(AUGMENTATIONS);
- fReportErrors = manager.getFeature(REPORT_ERRORS);
- fDocumentFragment = manager.getFeature(DOCUMENT_FRAGMENT) ||
- manager.getFeature(DOCUMENT_FRAGMENT_DEPRECATED);
- fIgnoreOutsideContent = manager.getFeature(IGNORE_OUTSIDE_CONTENT);
-
- // get properties
- fNamesElems = getNamesValue(String.valueOf(manager.getProperty(NAMES_ELEMS)));
- fNamesAttrs = getNamesValue(String.valueOf(manager.getProperty(NAMES_ATTRS)));
- fErrorReporter = (HTMLErrorReporter)manager.getProperty(ERROR_REPORTER);
-
- fragmentContextStack_ = (QName[]) manager.getProperty(FRAGMENT_CONTEXT_STACK);
-
- } // reset(XMLComponentManager)
-
- /** Sets a feature. */
- public void setFeature(String featureId, boolean state)
- throws XMLConfigurationException {
-
- if (featureId.equals(AUGMENTATIONS)) {
- fAugmentations = state;
- return;
- }
- if (featureId.equals(REPORT_ERRORS)) {
- fReportErrors = state;
- return;
- }
- if (featureId.equals(IGNORE_OUTSIDE_CONTENT)) {
- fIgnoreOutsideContent = state;
- return;
- }
-
- } // setFeature(String,boolean)
-
- /** Sets a property. */
- public void setProperty(String propertyId, Object value)
- throws XMLConfigurationException {
-
- if (propertyId.equals(NAMES_ELEMS)) {
- fNamesElems = getNamesValue(String.valueOf(value));
- return;
- }
-
- if (propertyId.equals(NAMES_ATTRS)) {
- fNamesAttrs = getNamesValue(String.valueOf(value));
- return;
- }
-
- } // setProperty(String,Object)
-
- //
- // XMLDocumentSource methods
- //
-
- /** Sets the document handler. */
- public void setDocumentHandler(XMLDocumentHandler handler) {
- fDocumentHandler = handler;
- } // setDocumentHandler(XMLDocumentHandler)
-
- // @since Xerces 2.1.0
-
- /** Returns the document handler. */
- public XMLDocumentHandler getDocumentHandler() {
- return fDocumentHandler;
- } // getDocumentHandler():XMLDocumentHandler
-
- //
- // XMLDocumentHandler methods
- //
-
- // since Xerces-J 2.2.0
-
- /** Start document. */
- public void startDocument(XMLLocator locator, String encoding,
- NamespaceContext nscontext, Augmentations augs)
- throws XNIException {
-
- // reset state
- fElementStack.top = 0;
- if (fragmentContextStack_ != null) {
- fragmentContextStackSize_ = fragmentContextStack_.length;
- for (int i=0; i