NLdoc.Conversion.Reader.Docx.XML (NLdoc.Conversion.Reader.Docx v1.5.5)
View SourceNLdoc.Conversion.Docx.XML implements functions for reading and parsing XML files.
Summary
Functions
Parses the given XML data into a Saxy.XML.element tuple.
Parses the given XML data into a Saxy.XML.element tuple.
Reads an XML file at the given path and parses it into a Saxy.XML.element tuple.
The file is assumed to be UTF-8 encoded and the BOM (Byte Order Mark) at the beginning of the file is trimmed.
Reads an XML file at the given path and parses it into a Saxy.XML.element tuple.
The file is assumed to be UTF-8 encoded and the BOM (Byte Order Mark) at the beginning of the file is trimmed.
Functions
@spec parse(data :: String.t()) :: {:ok, Saxy.XML.element()} | {:error, Saxy.ParseError.t()}
Parses the given XML data into a Saxy.XML.element tuple.
This function returns {:ok, element} on success or {:error, error} with a Saxy.ParseError if Saxy fails to parse the XML.
@spec parse!(data :: String.t()) :: Saxy.XML.element()
Parses the given XML data into a Saxy.XML.element tuple.
This function raises a Saxy.ParseError if Saxy fails to parse the XML.
@spec read(filename :: String.t()) :: {:ok, Saxy.XML.element()} | {:error, Saxy.ParseError.t()}
Reads an XML file at the given path and parses it into a Saxy.XML.element tuple.
The file is assumed to be UTF-8 encoded and the BOM (Byte Order Mark) at the beginning of the file is trimmed.
This function returns {:ok, element} on success or {:error, error} with a File.Error or a Saxy.ParseError
if the file cannot be read or if Saxy fails to parse the XML.
@spec read!(filename :: String.t()) :: Saxy.XML.element()
Reads an XML file at the given path and parses it into a Saxy.XML.element tuple.
The file is assumed to be UTF-8 encoded and the BOM (Byte Order Mark) at the beginning of the file is trimmed.
This function raises an error if the file cannot be read or if Saxy fails to parse the XML.