|
|
|
|
|
- Reminder: XML language
- XML functions and threads
- Limit
XMLDocument (Function) In french: XMLDocument Creates a new XML document. This document can be: - an empty document. It can be filled by XMLAddAttribute, XMLAddChild, ...
- a document containing the XML code that will be used by the XML functions of WLanguage. This code can come from a file in XML format or from a web service. The current element automatically corresponds to the root tag (the root is not created if it does not exist). This document can be closed by XMLClose.
Remark: The XMLDocument function does not manipulate a file but an XML code..
XMLSource is string
Res is boolean
Res = XMLDocument("XMLDoc", XMLSource)
IF Res = False THEN
Error("The document was not created.")
ELSE
Info("The document was successfully created. It is ready to be used.")
END
...
Syntax
<Result> = XMLDocument(<XML document> [, <XML code> [, <Option>]])
<Result>: Boolean - True if the XML document is created,
- False otherwise. If an error occurs:
- the current position remains unchanged.
- the ErrorOccurred variable is set to True. To get more details on the error, use ErrorInfo.
<XML document>: Character string Name given to the XML document. This name will be used by all the XML functions. <XML code>: Optional character string XML code that will be analyzed by the XML functions. If this parameter is not specified, a new empty XML document is created.Caution: - If the encoding of the document is not specified in the XML header, the encoding used is "UTF-8".
- To specify a different encoding, the "encoding" attribute must be added to the XML tag.
For example: <?xml version="1.0" encoding="UCS-2"?>
<Option>: Optional constant Type of the created XML document (no option is selected by default):
| | xdHTML | XHTML document. This constant is used to optimize the operating mode of XMLBuildString. The document is processed by using the XHTML mode. | xHTML | HTML document. Warning: This constant is no longer available. In fact, the operation of this constant was not optimized: the document was manipulated using the XML format, then in the event of failure it was then manipulated using the XHTML format. |
Remarks Reminder: XML language XML is a language containing tags and attributes (called "elements" in this help). The structure of the XML code corresponds to a tree structure: information is organized in a treelike way. The following terms are used to describe the different parts of an XML code:
XML functions and threads If your application uses threads, the XML document is shared between all these threads. For more details on threads, see Managing threads. Limit XMLDocument is suitable for loading XML documents whose size of text nodes does not exceed 9 MB. To handle documents with a greater size of nodes, you must use the XMLDocument type.
This page is also available for…
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|