Options
All
  • Public
  • Public/Protected
  • All
Menu

js2xmlparser

Index

Functions

Private getHandler

  • getHandler(value: any, options: Options): function | undefined
  • Gets the type handler associated with a value.

    Parameters

    Returns function | undefined

Private isArray

  • isArray(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 isObject

  • isObject(val: any): boolean
  • Parameters

    • val: any

    Returns boolean

Private isSet

  • isSet(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 using the specified options.

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

    Parameters

    • root: string
    • object: any
    • Optional options: IOptions

    Returns string

Private parseArrayOrSet

  • parseArrayOrSet(key: string, arrayOrSet: any, parentElement: XmlElement<any>, options: Options): void
  • Parses an array or Set into XML and adds it to the parent element.

    Parameters

    • key: string
    • arrayOrSet: any
    • parentElement: XmlElement<any>
    • options: Options

    Returns void

Private parseAttribute

  • parseAttribute(name: string, value: string, parentElement: XmlElement<any>, options: Options): void
  • Parses an attribute into XML and adds it to the parent element.

    Parameters

    • name: string
    • value: string
    • parentElement: XmlElement<any>
    • options: Options

    Returns void

Private parseObjectOrMap

  • parseObjectOrMap(objectOrMap: any, parentElement: XmlElement<any>, options: Options): void
  • Parses an Object or Map into XML and adds it to the parent element.

    Parameters

    • objectOrMap: any
    • parentElement: XmlElement<any>
    • options: Options

    Returns void

Private parseObjectOrMapEntry

  • parseObjectOrMapEntry(key: string, value: any, parentElement: XmlElement<any>, options: Options): void
  • Parses an object or Map entry into XML and adds it to the parent element.

    Parameters

    • key: string
    • value: any
    • parentElement: XmlElement<any>
    • options: Options

    Returns void

Private parseString

  • parseString(str: string, parentElement: XmlAttribute<any> | XmlElement<any>, options: Options): void
  • Parses a string into XML and adds it to the parent element or attribute.

    Parameters

    • str: string
    • parentElement: XmlAttribute<any> | XmlElement<any>
    • options: Options

    Returns void

parseToExistingElement

  • parseToExistingElement(element: XmlElement<any>, object: any, options?: IOptions): void
  • Converts the specified object to XML and adds the XML representation to the specified XmlDocument object using the specified options.

    This function does not add a root element. In addition, it does not add an XML declaration or DTD, and the associated options in IOptions are ignored. If desired, these must be added manually.

    Parameters

    • element: XmlElement<any>
    • object: any
    • Optional options: IOptions

    Returns void

Private parseValue

  • parseValue(key: string, value: any, parentElement: XmlElement<any>, options: Options): void
  • Parses an arbitrary JavaScript value into XML and adds it to the parent element.

    Parameters

    • key: string
    • value: any
    • parentElement: XmlElement<any>
    • options: Options

    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