Opens an XML file and allows you to configure the XML parser to validate the file against a schema or Document Type Definition (DTD).

National Instruments recommends that you use the Close VI to close all the references after using the XML parser classes.

The VI contains information about errors that the XML parser encounters while parsing the document.


icon

Inputs/Outputs

  • ci32.png validate on load (Auto)

    validate on load specifies the validation scheme that the XML parser uses. The default is Auto, which turns on validation only if the parser detects an internal or external DTD subset.

    You also can select Always, which turns on validation, or Never, which turns off validation.

  • cbool.png preserve whitespace (True)

    preserve whitespace specifies whether a validating parser includes ignorable whitespaces as Text Nodes. The default is TRUE.

    If you select FALSE, the parser discards ignorable whitespaces and does not add Text Nodes to the DOM tree. If you select FALSE, you must provide a valid DTD definition for the Preserve Whitespace option to correctly discard ignorable whitespaces. If the XML document is invalid or has no schema, the Preserve Whitespace option is ignored.

  • cstr.png XML string

    XML string is the XML string that includes the data you want to parse.

    Note The XML string must include an XML prolog with a valid encoding value. If the encoding value is incorrect or missing, this function might fail to parse the XML string.
  • cbool.png process namespaces (False)

    process namespaces disables namespace processing for the XML parser when set to FALSE, the default. When set to TRUE, the XML parser enforces the constraints and rules that the NameSpace specification contains.

  • cbool.png process schema (False)

    process schema disables schema processing for the XML parser when set to FALSE, the default. If you set the control to TRUE, you must set process namespaces to TRUE.

  • cbool.png load external DTD (True)

    load external DTD specifies whether the XML parser can load external DTDs. The default is TRUE.

    LabVIEW loads the schema specified in the metadata of the XML file. If you set validate on load to Always or Auto, the parser ignores this input and always loads the DTD.

    In the XML file, specify the external schema you want to use in one of the following metadata attributes:

    • xsi:schemaLocation—Use this attribute if you define the targetNamespace attribute in the metadata of the XML file.
    • xsi:noNamespaceSchemaLocation—Use this attribute if you do not define the targetNamespace attribute in the metadata of the XML file.

    Refer to TestConfiguration.xml in the examples\File IO\XML\Parse XML\support directory for an example of specifying a schema in an XML file.

  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • cbool.png schema full checking (False)

    schema full checking specifies whether the XML parser runs full or partial schema constraint checking. The default is FALSE, which configures the XML parser to run partial constraint checking.

  • igenclassrn.png DOM document out

    DOM document out returns a reference to the new XML parser session.

  • istr.png parse errors

    parse errors contains information on errors the XML parser found when it parsed the document, including problems the parser encountered when validating the document against the schema.

  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.