ILSParserFilter.StartElement(IElement) Method

Definition

The parser will call this method after each Element start tag has been scanned, but before the remainder of the Element is processed.

[Android.Runtime.Register("startElement", "(Lorg/w3c/dom/Element;)S", "GetStartElement_Lorg_w3c_dom_Element_Handler:Org.W3c.Dom.LS.ILSParserFilterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
public short StartElement (Org.W3c.Dom.IElement? elementArg);
[<Android.Runtime.Register("startElement", "(Lorg/w3c/dom/Element;)S", "GetStartElement_Lorg_w3c_dom_Element_Handler:Org.W3c.Dom.LS.ILSParserFilterInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
abstract member StartElement : Org.W3c.Dom.IElement -> int16

Parameters

elementArg
IElement

The newly encountered element. At the time this method is called, the element is incomplete - it will have its attributes, but no children.

Returns

<ul> <li> FILTER_ACCEPT if the Element should be included in the DOM document being built. </li> <li> FILTER_REJECT if the Element and all of its children should be rejected. </li> <li> FILTER_SKIP if the Element should be skipped. All of its children are inserted in place of the skipped Element node. </li> <li> FILTER_INTERRUPT if the filter wants to stop the processing of the document. Interrupting the processing of the document does no longer guarantee that the resulting DOM tree is XML well-formed. The Element is rejected. </li> </ul> Returning any other values will result in unspecified behavior.

Attributes

Remarks

The parser will call this method after each Element start tag has been scanned, but before the remainder of the Element is processed. The intent is to allow the element, including any children, to be efficiently skipped. Note that only element nodes are passed to the startElement function. <br>The element node passed to startElement for filtering will include all of the Element's attributes, but none of the children nodes. The Element may not yet be in place in the document being constructed (it may not have a parent node.) <br>A startElement filter function may access or change the attributes for the Element. Changing Namespace declarations will have no effect on namespace resolution by the parser. <br>For efficiency, the Element node passed to the filter may not be the same one as is actually placed in the tree if the node is accepted. And the actual node (node object identity) may be reused during the process of reading in and filtering a document.

Java documentation for org.w3c.dom.ls.LSParserFilter.startElement(org.w3c.dom.Element).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to