Options
All
  • Public
  • Public/Protected
  • All
Menu

xmlcreate

Index

Functions

Private allSameLineNodes

  • allSameLineNodes(nodes: XmlNode[]): boolean

Private appendId

  • appendId(type: string, value: string, str: string, options: IStringOptions): string
  • Appends the XML string representation of a public or system identifier to an existing string.

    Parameters

    • type: string

      "SYSTEM", "PUBLIC", or ""

    • value: string

      The value of the identifier.

    • str: string

      The string to which the string representation should be appended.

    • options: IStringOptions

      Formatting options for the string representation.

    Returns string

    The updated string.

document

  • Creates a new XML document.

    Parameters

    • root: string

      The name of the root element of the document.

    Returns XmlDocument

    The new XML document.

Private escapeAmpersands

  • escapeAmpersands(str: string): string
  • Replaces ampersands (&) with the appropriate XML character reference.

    Parameters

    • str: string

      The string to escape.

    Returns string

    A copy of the specified string with ampersands escaped.

Private escapeDoubleQuotes

  • escapeDoubleQuotes(str: string): string
  • Replaces double quotes (") with the appropriate XML character reference.

    Parameters

    • str: string

      The string to escape.

    Returns string

    A copy of the specified string with double quotes escaped.

Private escapeLeftAngleBrackets

  • escapeLeftAngleBrackets(str: string): string
  • Replaces left angle brackets (<) with the appropriate XML character reference.

    Parameters

    • str: string

      The string to escape.

    Returns string

    A copy of the specified string with left angle brackets escaped.

Private escapeSingleQuotes

  • escapeSingleQuotes(str: string): string
  • Replaces single quotes (") with the appropriate XML character reference.

    Parameters

    • str: string

      The string to escape.

    Returns string

    A copy of the specified string with single quotes escaped.

Private getCodePoint

  • getCodePoint(str: string, index: number): number
  • Retrieve the Unicode code point at the specified index in the specified string.

    Parameters

    • str: string

      The string from which to retrieve the Unicode code point.

    • index: number

      The specified index.

    Returns number

    The Unicode code point at the specified position.

Private isInteger

  • isInteger(value: number): boolean
  • Determines whether a number is an integer.

    Parameters

    • value: number

      The number to check.

    Returns boolean

    Whether or not the number is an integer.

Private isType

  • isType(val: any, ...types: string[]): boolean
  • Returns true if the specified value are of any of the specified types, as determined by the Object.prototype.toString.call function.

    Parameters

    • val: any

      The specified value.

    • Rest ...types: string[]

      The specified types.

    Returns boolean

    Whether or not the specified value are of any of the specified types.

Private onSameLine

Private validateChar

  • validateChar(str: string): boolean
  • Verifies that the specified string only contains characters permitted by the XML specification.

    Parameters

    • str: string

      The string to validate.

    Returns boolean

    Whether the specified string only contains characters permitted by the XML specification.

Private validateDeclarationOptions

  • Validates an XML declaration options object and replaces undefined values with their appropriate defaults.

    Parameters

    Returns IDeclarationOptions

    The updated XML declaration options object.

Private validateName

  • validateName(str: string): boolean
  • Verifies that the specified string only contains characters permitted by the XML specification for names.

    Parameters

    • str: string

      The string to validate.

    Returns boolean

    Whether the specified string only contains characters permitted by the XML specification for names.

Private validateSingleChar

  • validateSingleChar(str: string): boolean
  • Verifies that the specified string only contains a single character, and that this character is permitted by the XML specification.

    Parameters

    • str: string

      The string to validate.

    Returns boolean

    Whether the specified string only contains a single character, and that this character is permitted by the XML specification.

Private validateStringOptions

  • Validates a string options object and replaces undefined values with their appropriate defaults.

    Parameters

    Returns IStringOptions

    The updated string options object.

Object literals

Private declarationOptionsDefaults

declarationOptionsDefaults: object

encoding

encoding: undefined = undefined

standalone

standalone: undefined = undefined

version

version: string = "1.0"

Private stringOptionsDefaults

stringOptionsDefaults: object

doubleQuotes

doubleQuotes: boolean = false

indent

indent: string = " "

newline

newline: string = ""

pretty

pretty: boolean = true

Generated using TypeDoc