Packages

c

io.scalajs.npm.xml2js

ParserOptions

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)

    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
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. var async: UndefOr[Boolean]
  6. var attrNameProcessors: UndefOr[Boolean]
  7. var attrkey: UndefOr[String]
  8. var charkey: UndefOr[String]
  9. var charsAsChildren: UndefOr[Boolean]
  10. var childkey: UndefOr[String]
  11. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. var emptyTag: UndefOr[String]
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. var explicitArray: UndefOr[Boolean]
  16. var explicitCharkey: UndefOr[Boolean]
  17. var explicitChildren: UndefOr[Boolean]
  18. var explicitRoot: UndefOr[Boolean]
  19. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  21. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  22. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  23. var ignoreAttrs: UndefOr[Boolean]
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  26. var mergeAttrs: UndefOr[Boolean]
  27. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  28. var normalize: UndefOr[Boolean]
  29. var normalizeTags: UndefOr[Boolean]
  30. final def notify(): Unit
    Definition Classes
    AnyRef
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  32. var preserveChildrenOrder: UndefOr[Boolean]
  33. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  34. var strict: UndefOr[Boolean]
  35. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  36. def toLocaleString(): String
    Definition Classes
    Object
  37. def toString(): String
    Definition Classes
    AnyRef → Any
  38. var trim: UndefOr[Boolean]
  39. var validator: UndefOr[Any]
  40. def valueOf(): Any
    Definition Classes
    Object
  41. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. var xmlns: UndefOr[Boolean]

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped