Options
All
  • Public
  • Public/Protected
  • All
Menu

js2xmlparser

Index

Functions

Private isArray

  • isArray(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isBoolean

  • isBoolean(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isFunction

  • isFunction(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isMap

  • isMap(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isNull

  • isNull(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isNumber

  • isNumber(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isObject

  • isObject(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isPrimitive

  • isPrimitive(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isSet

  • isSet(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isString

  • isString(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isStringArray

  • isStringArray(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isUndefined

  • isUndefined(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

parse

  • parse(root: string, object: any, options?: IOptions): string
  • Returns a XML string representation of the specified object.

    Parameters

    • root: string

      The name of the root XML element. When the object is converted to XML, it will be a child of this root element.

    • object: any

      The object to convert to XML.

    • Optional options: IOptions

      Options for parsing the object and formatting the resulting XML.

    Returns string

    An XML string representation of the specified object.

Private parseArrayOrSet

  • parseArrayOrSet(key: string, arrayOrSet: any, parentElement: XmlElement, options: Options): void
  • Parses an array or Set into XML.

    Parameters

    • key: string

      The key associated with the array or set to parse into XML.

    • arrayOrSet: any

      The array or set to parse into XML.

    • parentElement: XmlElement

      The XML element that will contain the function.

    • options: Options

      Options for parsing the array or set into XML.

    Returns void

Private parseAttribute

  • parseAttribute(name: string, value: string, parentElement: XmlElement, options: Options): void
  • Parses an attribute into XML.

    Parameters

    • name: string

      The name of the attribute.

    • value: string

      The value of the attribute.

    • parentElement: XmlElement

      The XML element that will contain the string.

    • options: Options

      Options for parsing the attribute into XML.

    Returns void

Private parseObjectOrMap

  • parseObjectOrMap(objectOrMap: any, parentElement: XmlElement, options: Options): void
  • Parses an Object or Map into XML.

    Parameters

    • objectOrMap: any

      The object or map to parse into XML.

    • parentElement: XmlElement

      The XML element that will contain the object.

    • options: Options

      Options for parsing the object into XML.

    Returns void

Private parseObjectOrMapEntry

  • parseObjectOrMapEntry(key: string, value: any, parentElement: XmlElement, options: Options): void
  • Parses an object or Map entry into XML.

    Parameters

    • key: string

      The key associated with the object or Map entry.

    • value: any

      The object or map entry.

    • parentElement: XmlElement

      The XML element that will contain the object or map entry.

    • options: Options

      Options for parsing the object or map entry into XML.

    Returns void

Private parseString

  • parseString(str: string, parentElement: XmlAttribute | XmlElement, options: Options): void
  • Parses a string into XML.

    Parameters

    • str: string

      The string to parse into XML.

    • parentElement: XmlAttribute | XmlElement

      The XML element or attribute that will contain the string.

    • options: Options

      Options for parsing the string into XML.

    Returns void

Private parseToDocument

  • parseToDocument(root: string, value: any, options: Options): XmlDocument
  • Returns a XML document corresponding to the specified value.

    Parameters

    • root: string

      The name of the root XML element. When the value is converted to XML, it will be a child of this root element.

    • value: any

      The value to convert to XML.

    • options: Options

      Options for parsing the value into XML.

    Returns XmlDocument

    An XML document corresponding to the specified value.

Private parseValue

  • parseValue(key: string, value: any, parentElement: XmlElement, options: Options): void
  • Parses an arbitrary JavaScript value into XML.

    Parameters

    • key: string

      The key associated with the value to parse into XML.

    • value: any

      The value to parse into XML.

    • parentElement: XmlElement

      The XML element that will contain the value.

    • options: Options

      Options for parsing the value into XML.

    Returns void

Private stringify

  • stringify(value: any): string
  • Returns a string representation of the specified value, as given by the value's toString() method (if it has one) or the global String() function (if it does not).

    Parameters

    • value: any

      The value to convert to a string.

    Returns string

    A string representation of the specified value.

Generated using TypeDoc