class ParserOptions extends Object
NodeJS/xml2js Parser Options
- Annotations
- @RawJSType() @ScalaJSDefined()
- Alphabetic
- By Inheritance
- ParserOptions
- Object
- Any
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
ParserOptions(attrkey: UndefOr[String] = js.undefined, charkey: UndefOr[String] = js.undefined, explicitCharkey: UndefOr[Boolean] = js.undefined, trim: UndefOr[Boolean] = js.undefined, normalizeTags: UndefOr[Boolean] = js.undefined, normalize: UndefOr[Boolean] = js.undefined, explicitRoot: UndefOr[Boolean] = js.undefined, emptyTag: UndefOr[String] = js.undefined, explicitArray: UndefOr[Boolean] = js.undefined, ignoreAttrs: UndefOr[Boolean] = js.undefined, mergeAttrs: UndefOr[Boolean] = js.undefined, validator: UndefOr[Any] = js.undefined, xmlns: UndefOr[Boolean] = js.undefined, explicitChildren: UndefOr[Boolean] = js.undefined, childkey: UndefOr[String] = js.undefined, preserveChildrenOrder: UndefOr[Boolean] = js.undefined, charsAsChildren: UndefOr[Boolean] = js.undefined, async: UndefOr[Boolean] = js.undefined, strict: UndefOr[Boolean] = js.undefined, attrNameProcessors: UndefOr[Boolean] = js.undefined)
- attrkey
(default: $): Prefix that is used to access the attributes. Version 0.1 default was @.
- charkey
(default: _): Prefix that is used to access the character content. Version 0.1 default was #.
- explicitCharkey
(default: false)
- trim
(default: false): Trim the whitespace at the beginning and end of text nodes.
- normalizeTags
(default: false): Normalize all tag names to lowercase.
- normalize
(default: false): Trim whitespaces inside text nodes.
- explicitRoot
(default: true): Set this if you want to get the root node in the resulting object.
- emptyTag
(default: ""): what will the value of empty nodes be.
- explicitArray
(default: true): Always put child nodes in an array if true; otherwise an array is created only if there is more than one.
- ignoreAttrs
(default: false): Ignore all XML attributes and only create text nodes.
- mergeAttrs
(default: false): Merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object. This option is ignored if ignoreAttrs is false.
- validator
(default null): You can specify a callable that validates the resulting structure somehow, however you want. See unit tests for an example.
- xmlns
(default false): Give each element a field usually called '$ns' (the first character is the same as attrkey) that contains its local name and namespace URI.
- explicitChildren
(default false): Put child elements to separate property. Doesn't work with mergeAttrs = true. If element has no children then "children" won't be created. Added in 0.2.5.
- childkey
(default $$): Prefix that is used to access child elements if explicitChildren is set to true. Added in 0.2.5.
- preserveChildrenOrder
(default false): Modifies the behavior of explicitChildren so that the value of the "children" property becomes an ordered array. When this is true, every node will also get a #name field whose value will correspond to the XML nodeName, so that you may iterate the "children" array and still be able to determine node names. The named (and potentially unordered) properties are also retained in this configuration at the same level as the ordered "children" array. Added in 0.4.9.
- charsAsChildren
(default false): Determines whether chars should be considered children if explicitChildren is on. Added in 0.2.5.
- async
(default false): Should the callbacks be async? This might be an incompatible change if your code depends on sync execution of callbacks. Future versions of xml2js might change this default, so the recommendation is to not depend on sync execution anyway. Added in 0.2.6.
- strict
(default true): Set sax-js to strict or non-strict parsing mode. Defaults to true which is highly recommended, since parsing HTML which is not well-formed XML might yield just about anything. Added in 0.2.7.
- attrNameProcessors
(default: null): Allows the addition of attribute name processing functions. Accepts an Array of functions with following signature
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
- var async: UndefOr[Boolean]
- var attrNameProcessors: UndefOr[Boolean]
- var attrkey: UndefOr[String]
- var charkey: UndefOr[String]
- var charsAsChildren: UndefOr[Boolean]
- var childkey: UndefOr[String]
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- var emptyTag: UndefOr[String]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- var explicitArray: UndefOr[Boolean]
- var explicitCharkey: UndefOr[Boolean]
- var explicitChildren: UndefOr[Boolean]
- var explicitRoot: UndefOr[Boolean]
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hasOwnProperty(v: String): Boolean
- Definition Classes
- Object
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- var ignoreAttrs: UndefOr[Boolean]
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
def
isPrototypeOf(v: Object): Boolean
- Definition Classes
- Object
- var mergeAttrs: UndefOr[Boolean]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- var normalize: UndefOr[Boolean]
- var normalizeTags: UndefOr[Boolean]
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- var preserveChildrenOrder: UndefOr[Boolean]
-
def
propertyIsEnumerable(v: String): Boolean
- Definition Classes
- Object
- var strict: UndefOr[Boolean]
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toLocaleString(): String
- Definition Classes
- Object
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- var trim: UndefOr[Boolean]
- var validator: UndefOr[Any]
-
def
valueOf(): Any
- Definition Classes
- Object
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
- var xmlns: UndefOr[Boolean]