Class

io.scalajs.npm.xml2js

ParserOptions

Related Doc: package xml2js

Permalink

class ParserOptions extends Object

NodeJS/xml2js Parser Options

Annotations
@RawJSType() @ScalaJSDefined()
Linear Supertypes
Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ParserOptions
  2. Object
  3. Any
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. 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)

    Permalink

    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

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. var async: UndefOr[Boolean]

    Permalink

    (default false): Should the callbacks be async? This might be an incompatible change if your code depends on sync execution of callbacks.

    (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.

  6. var attrNameProcessors: UndefOr[Boolean]

    Permalink

    (default: null): Allows the addition of attribute name processing functions.

    (default: null): Allows the addition of attribute name processing functions. Accepts an Array of functions with following signature

  7. var attrkey: UndefOr[String]

    Permalink

    (default: $): Prefix that is used to access the attributes.

    (default: $): Prefix that is used to access the attributes. Version 0.1 default was @.

  8. var charkey: UndefOr[String]

    Permalink

    (default: _): Prefix that is used to access the character content.

    (default: _): Prefix that is used to access the character content. Version 0.1 default was #.

  9. var charsAsChildren: UndefOr[Boolean]

    Permalink

    (default false): Determines whether chars should be considered children if explicitChildren is on.

    (default false): Determines whether chars should be considered children if explicitChildren is on. Added in 0.2.5.

  10. var childkey: UndefOr[String]

    Permalink

    (default $$): Prefix that is used to access child elements if explicitChildren is set to true.

    (default $$): Prefix that is used to access child elements if explicitChildren is set to true. Added in 0.2.5.

  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. var emptyTag: UndefOr[String]

    Permalink

    (default: ""): what will the value of empty nodes be.

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. var explicitArray: UndefOr[Boolean]

    Permalink

    (default: true): Always put child nodes in an array if true; otherwise an array is created only if there is more than one.

  16. var explicitCharkey: UndefOr[Boolean]

    Permalink

    (default: false)

  17. var explicitChildren: UndefOr[Boolean]

    Permalink

    (default false): Put child elements to separate property.

    (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.

  18. var explicitRoot: UndefOr[Boolean]

    Permalink

    (default: true): Set this if you want to get the root node in the resulting object.

  19. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  21. def hasOwnProperty(v: String): Boolean

    Permalink
    Definition Classes
    Object
  22. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  23. var ignoreAttrs: UndefOr[Boolean]

    Permalink

    (default: false): Ignore all XML attributes and only create text nodes.

  24. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean

    Permalink
    Definition Classes
    Object
  26. var mergeAttrs: UndefOr[Boolean]

    Permalink

    (default: false): Merge attributes and child elements as properties of the parent, instead of keying attributes off a child attribute object.

    (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.

  27. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  28. var normalize: UndefOr[Boolean]

    Permalink

    (default: false): Trim whitespaces inside text nodes.

  29. var normalizeTags: UndefOr[Boolean]

    Permalink

    (default: false): Normalize all tag names to lowercase.

  30. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  32. var preserveChildrenOrder: UndefOr[Boolean]

    Permalink

    (default false): Modifies the behavior of explicitChildren so that the value of the "children" property becomes an ordered array.

    (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.

  33. def propertyIsEnumerable(v: String): Boolean

    Permalink
    Definition Classes
    Object
  34. var strict: UndefOr[Boolean]

    Permalink

    (default true): Set sax-js to strict or non-strict parsing mode.

    (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.

  35. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  36. def toLocaleString(): String

    Permalink
    Definition Classes
    Object
  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. var trim: UndefOr[Boolean]

    Permalink

    (default: false): Trim the whitespace at the beginning and end of text nodes.

  39. var validator: UndefOr[Any]

    Permalink

    (default null): You can specify a callable that validates the resulting structure somehow, however you want.

    (default null): You can specify a callable that validates the resulting structure somehow, however you want. See unit tests for an example.

  40. def valueOf(): Any

    Permalink
    Definition Classes
    Object
  41. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. var xmlns: UndefOr[Boolean]

    Permalink

    (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.

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped