Table of contents
TOC
Collapse the table of content
Expand the table of content

Xml.Document

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns the contents of an XML document as a hierarchical table (list of records).

Xml.Document(contents as any, optional options as nullable record, optional encoding as nullable number) as table  

Arguments

ArgumentDescription
contentsThe contents may be directly passed to the function as text, or it may be the binary value returned by a function like File.Contents or Web.Contents.
optionsXml document options.
encodingEncoding value.

Remarks

  • The output of the function has a tabular shape. Each row in the table corresponds to a node at the current level of depth. Descending into the XML tree is done through accessing the “Value” property of a given row.

The precise shape of the output table is as follows:

Value.Type(Xml.Document("<a></a>")) =  
  
type {[  
  
    Name = text,  
  
    Namespace = text,  
  
    Value = any,  
  
    Attributes = {[  
  
        Name = text,  
  
        Namespace = text,  
  
        Value = text  
  
    ]}  
  
]}  

Example

Xml.Document("<a></a>")  
  
    equals  { [  
  
    Name = "a",  
  
    Namespace = "",  
  
    Value = {},  
  
    Attributes = {}  
  
] }  
© 2018 Microsoft