Difference between revisions of "Extensions.Xml.XmlLoadFromFile"

From emotive
Jump to navigation Jump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:OTX '''XmlLoadFromFile'''}}[[Category:Xml]]
 
{{DISPLAYTITLE:OTX '''XmlLoadFromFile'''}}[[Category:Xml]]
 
== Classification ==
 
== Classification ==
{{ClassificationActivity | XmlLoadFromFile|Returns updating....| [[Term]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Terms|Xml related Terms]] | [[Extensions.Xml.XmlFormatException|XmlFormatException]] | - |}}
+
{{ClassificationActivity | XmlLoadFromFile|Returns a '''XmlDocument''' from a path.| [[Term]] | [[Extensions.Xml|OTX Xml extension]] |[[Extensions.Xml#Terms|Xml related Terms]] | [[Core.DataTypes.ComplexDataType.InvalidReferenceException|InvalidReferenceException]]<br/>[[Extensions.Xml.XmlFormatException|XmlFormatException]] | - |}}
  
 
== OTL Syntax ==
 
== OTL Syntax ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
XmlDocumentTerm = Xml.XmlLoadFromFile(ByteFieldTerm, EncodingTerm);
+
XmlDocumentTerm Xml.XmlLoadFromFile(StringTerm path, EncodingTerm fallbackEncoding);
 
</syntaxhighlight>
 
</syntaxhighlight>
  
 
== Description ==
 
== Description ==
The '''XmlLoadFromFile''' term returns an '''XmlDocument''' from a ByteField.
+
The '''XmlLoadFromFile''' term returns a '''XmlDocument''' from a path.
  
{{TermReturnValue|[[Extensions.Xml.XmlDocument|XmlDocument]]| The '''XmlDocument''' from a ByteField.}}
+
{{TermReturnValue|[[Extensions.Xml.XmlDocument|XmlDocument]]| The '''XmlDocument''' from a path.}}
  
 
== Properties ==
 
== Properties ==
 
{| {{TableHeader}}
 
{| {{TableHeader}}
 
{{TableRowPropertiesHeader}}
 
{{TableRowPropertiesHeader}}
{{TableRowPropertie1| ByteField|[[Core.DataTypes.ComplexDataType.ByteField|ByteField]] | [[Term]] | - |[1..1]| The ByteField that encapsulates the '''XML''' data.}}
+
{{TableRowPropertie1| FallbackEncoding|[[Extensions.StringUtil.Encoding|Encoding]] | [[Term]] | @Encoding:UTF-8 |[0..1]| Optional encoding value of the ByteField, if no encoding is described in the '''XML''' prolog or byte order mark (BOM). If the encoding is defined in the prolog this value should be ignored. If an invalid encoding (BIN, OCT, HEX) is specified, a [[Extensions.Xml.XmlFormatException|'''XmlFormatException''']] shall be thrown.}}
{{TableRowPropertie2| FallbackEncoding|[[Extensions.StringUtil.Encoding|Encoding]] | [[Term]] | @Encoding:UTF-8 |[0..1]| Optional encoding value of the ByteField, if no encoding is described in the XML prolog or byte order mark (BOM). If the encoding is defined in the prolog this value should be ignored. If an invalid encoding (BIN, OCT, HEX) is specified, a [[Extensions.Xml.XmlFormatException|'''XmlFormatException''']] shall be thrown}}
+
{{TableRowPropertie2| Path|[[Core.DataTypes.SimpleDataType.String|String]] | [[Term]] | - |[1..1]| The URI path to the file. The path parameter is permitted to specify relative or absolute path information.}}
 
|}
 
|}
  
 
== OTL Examples ==
 
== OTL Examples ==
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
ByteField ByteField1;
+
/// Local Declarations
Xml.XmlElement XmlElement1;
+
 
 
Xml.XmlDocument XmlDocument1;
 
Xml.XmlDocument XmlDocument1;
+
 
 
/// Flow
 
/// Flow
  
XmlElement1 = Xml.CreateXmlElement("root", NULL, {"attr":"val"});
+
XmlDocument1 = Xml.XmlLoadFromFile("XmlStorage/XmlLoadFromFile_TC01.xml", @Encoding:UTF-8);
XmlDocument1 = Xml.CreateXmlDocument(XmlElement1, "1.0", @Encoding:UTF-8, false);
 
ByteField1 = Xml.XmlToByteField(XmlDocument1);
 
XmlDocument1 = Xml.XmlFromByteField(ByteField1, @Encoding:UTF-8);
 
 
</syntaxhighlight>
 
</syntaxhighlight>
  

Latest revision as of 06:35, 8 November 2018

Classification

Name XmlLoadFromFile
Short Description Returns a XmlDocument from a path.
Class Term
Extension OTX Xml extension
Group Xml related Terms
Exceptions InvalidReferenceException
XmlFormatException
Checker Rules -
Standard Compliant Yes

OTL Syntax

XmlDocumentTerm Xml.XmlLoadFromFile(StringTerm path, EncodingTerm fallbackEncoding);

Description

The XmlLoadFromFile term returns a XmlDocument from a path.

Return Value

The Term returns the value, see table below.

Icons Note.png In OTX, Terms are categorized according to its return data type!
Data Type Description
XmlDocument The XmlDocument from a path.

Properties

Name Data Type Class Default Cardinality Description
FallbackEncoding Encoding Term @Encoding:UTF-8 [0..1] Optional encoding value of the ByteField, if no encoding is described in the XML prolog or byte order mark (BOM). If the encoding is defined in the prolog this value should be ignored. If an invalid encoding (BIN, OCT, HEX) is specified, a XmlFormatException shall be thrown.
Path String Term - [1..1] The URI path to the file. The path parameter is permitted to specify relative or absolute path information.

OTL Examples

/// Local Declarations

Xml.XmlDocument XmlDocument1;

/// Flow

XmlDocument1 = Xml.XmlLoadFromFile("XmlStorage/XmlLoadFromFile_TC01.xml", @Encoding:UTF-8);

See also

CopyXmlElement
CreateXmlDocument
CreateXmlElement
GetXmlElementAttributes
GetXmlElementChildElements
GetXmlElementName
GetXmlElementsByXPath
GetXmlElementText
GetXmlRootElement
XmlFromByteField
XmlToByteField