diff --git a/product_docs/docs/epas/17/epas_rel_notes/epas17_2_rel_notes.mdx b/product_docs/docs/epas/17/epas_rel_notes/epas17_2_rel_notes.mdx index fa8e3ce50bf..dd23db89dcf 100644 --- a/product_docs/docs/epas/17/epas_rel_notes/epas17_2_rel_notes.mdx +++ b/product_docs/docs/epas/17/epas_rel_notes/epas17_2_rel_notes.mdx @@ -19,7 +19,7 @@ The `pgAgent` and `adminpack` packages are end of life from EPAS 17 and later. |----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------| | Upstream merge | Merged with community PostgreSQL 17.2. See the [PostgreSQL 17 Release Notes](https://www.postgresql.org/docs/17/release-17-2.html) for more information. | | | Feature | Added support for the Oracle-compatible `BFILE` native datatype and the `DBMS_LOB` package APIs. See the [DBMS_LOB](../reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/) for more information. | | -| Feature | Added support for the Oracle-compatible `DBMS_XMLDOM` package to provide interface for HTML and XML documents. See the [DBMS_XMLDOM](../reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom) for more information. | | +| Feature | Added support for the Oracle-compatible `DBMS_XMLDOM` package to provide interface for HTML and XML documents. See the [DBMS_XMLDOM](../reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom) for more information. | | | Feature | Added support for the Oracle-compatible `DBMS_ASSERT` package to validate input properties and sanitize user input, thereby reducing the risk of SQL injections. See the [DBMS_ASSERT](../reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/01a_dbms_assert) for more information. | | | Feature | Added support for the Oracle-equivalent `NLS_UPPER`,`NLS_LOWER`, and `NLS_INITCAP` functions. See the [NLS functions](../reference/sql_reference/03_functions_and_operators/nls_functions) for more information. | | | Feature | Implemented `alteruser` utility to modify roles in the clusters. See the [alteruser utility](/tools/alteruser_utility/) for more information. | | diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr.mdx index ae685a2ae99..ca1cd0744a7 100644 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr.mdx +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr.mdx @@ -1,4 +1,4 @@ -s--- +--- title: "SUBSTR" redirects: - /epas/latest/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr/ #generated for docs/epas/reorg-role-use-case-mode diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/appendchild.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/appendchild.mdx new file mode 100644 index 00000000000..0df6f7c10fa --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/appendchild.mdx @@ -0,0 +1,43 @@ +--- +title: "APPENDCHILD" +--- + +The `APPENDCHILD` function adds the node at the end of the list of children of a particular node. It returns the newly added node and if the node is already present, it removes the existing node before adding new node. + +You can append more than one child to a document node. However, a node cannot belong to several documents. + +When appending elements, you cannot add an element to itself. Additionally, if the same element is added twice, only the latest is considered. + +``` +APPENDCHILD(n DOMNode, newChild IN DOMNode) RETURN DOMNode +``` + +## Parameters + +`n` + +The `DOMNode` where the new node is to be added. + +`newchild` + +The child node to be added to the existing list of children of node n. + +## Examples + +This example creates a new XML `DOMDocument` named `l_domdoc` and a new `DOMElement` named `l_department_element` with tag name `Departments`. It then appends the `DOMElement` as a child of the `DOMDocument`. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_department_element DBMS_XMLDOM.DOMElement; + l_xmltype XMLTYPE; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + PERFORM DBMS_XMLDOM.appendChild(DBMS_XMLDOM.MAKENODE(l_domdoc), DBMS_XMLDOM.MAKENODE(l_department_element)); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createelement.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createelement.mdx new file mode 100644 index 00000000000..3afe26dcb57 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createelement.mdx @@ -0,0 +1,39 @@ +--- +title: "CREATEELEMENT" +--- + +The `CREATEELEMENT` function creates and returns a DOMElement. + +``` +CREATEELEMENT( doc DOMDocument, tagname IN VARCHAR2) RETURN DOMElement +``` + +## Parameters + +`doc` + +Any `DOMDocument`. + +`tagname` + +Tag name to be given to the new `DOMElement`. + +## Examples + +This example creates a new XML `DOMDocument` named `l_domdoc` and a new `DOMElement` named `l_department_element` with tag name `Departments`. It then appends the `DOMElement` as a child of the `DOMDocument`. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_department_element DBMS_XMLDOM.DOMElement; + l_xmltype XMLTYPE; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(l_domdoc), DBMS_XMLDOM.MAKENODE(l_department_element)); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createtextnode.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createtextnode.mdx new file mode 100644 index 00000000000..f22cad7a7a0 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/createtextnode.mdx @@ -0,0 +1,45 @@ +--- +title: "CREATETEXTNODE" +--- + +The `CREATETEXTNODE` function creates and returns a DOMText node. + +``` +CREATETEXTNODE( doc DOMDocument, data IN VARCHAR2) RETURN DOMText +``` + +## Parameters + +`doc` + +Any `DOMDocument`. + +`data` + +Content provided for the `DOMText` node. + +## Examples + +This example creates a new XML `DOMDocument`, a `DOMElement` with tag name “Departments” and a text node with “Depts list” as its value. The `DOMElement` is appended as a child to the `DOMDocument`, and the text node as a child to the `DOMElement`. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + l_departments_node DBMS_XMLDOM.DOMNode; + l_name_text DBMS_XMLDOM.DOMText; + l_xmltype XMLTYPE; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + l_departments_node := DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.MAKENODE(l_department_element)); + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Depts list' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_departments_node,DBMS_XMLDOM.MAKENODE(l_name_text)); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/freedocument.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/freedocument.mdx new file mode 100644 index 00000000000..ee973653c9b --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/freedocument.mdx @@ -0,0 +1,33 @@ +--- +title: "FREEDOCUMENT" +--- + +The `FREEDOCUMENT` procedure is used to free the `DOMDocument` object. + +``` +FREEDOCUMENT(doc IN DOMDocument) +``` + +## Parameters + +`doc` + +The `DOMDocument` to be made free. + + +## Examples + +This example creates a new `DOMDocument`, which is not accessible after it has been freed. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + DBMS_XMLDOM.FREEDOCUMENT(l_domdoc); + DBMS_XMLDOM.SETVERSION(l_domdoc, '1.0'); +END; +/ +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getattribute.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getattribute.mdx new file mode 100644 index 00000000000..ba9e5bb0f8b --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getattribute.mdx @@ -0,0 +1,70 @@ +--- +title: "GETATTRIBUTE" +--- + +The `GETATTRIBUTE` function returns the value of an attribute of an `DOMElement` by name. + +``` +GETATTRIBUTE(elem DOMElement, name IN VARCHAR2) RETURN VARCHAR2 + +GETATTRIBUTE(elem DOMElement, name IN VARCHAR2, ns IN VARCHAR2) RETURN VARCHAR2 +``` + +## Parameters + +`elem` + +The `DOMElement` whose attribute value needs to be obtained. + +`name` + +The attribute name whose attribute value needs to be obtained. + +`ns` + +The namespace URI. + +## Examples + +This example creates a new `DOMDocument` named `l_domdoc`, and a `DOMElement` named `elem` with tag name “Departments”. It adds an attribute (`attr`) to the `DOMElement` with the value "value" and appends the `DOMElement` as a child of the `DOMDocument`. + +The `get` subprogram returns the value of the attribute `attr` of the "Departments" element. + + +```sql +DECLARE + l_xml XMLType; + l_domdoc DBMS_XMLDOM.DOMDocument; + l_departments_node DBMS_XMLDOM.DOMNode; + elem DBMS_XMLDOM.DOMElement; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + elem := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + DBMS_XMLDOM.SETATTRIBUTE(elem, 'attr', 'value'); + PERFORM DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(l_domdoc), DBMS_XMLDOM.MAKENODE(elem)); + l_xml := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + dbms_output.put_line(l_xml.getStringVal()); + dbms_output.put_line(DBMS_XMLDOM.GETATTRIBUTE(elem, 'attr')); +END; +``` + +This example defines a namespace named “example” and uses an XMLtype string to create an XML structure. `GETFIRSTCHILD` then returns a `DOMNode` that represents a `DOMElement`. Since `GETATTRIBUTE` expects a `DOMElement`, the `MAKEELEMENT` function converts a specified `DOMNode` into a `DOMElement` and returns it. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_departments_node DBMS_XMLDOM.DOMNode; + item_node DBMS_XMLDOM.DOMNode; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(XMLTYPE('')); + + + l_departments_node := DBMS_XMLDOM.GETFIRSTCHILD(DBMS_XMLDOM.MAKENODE(l_domdoc)); + item_node := DBMS_XMLDOM.GETFIRSTCHILD(l_departments_node); + dbms_output.put_line('item node: ' || DBMS_XMLDOM.GETNODENAME(item_node)); + dbms_output.put_line('item attr: ' || DBMS_XMLDOM.GETATTRIBUTE(DBMS_XMLDOM.MAKEELEMENT(item_node), 'id', 'example:namespace')); + + + DBMS_XMLDOM.FREEDOCUMENT(l_domdoc); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getchildnodes.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getchildnodes.mdx new file mode 100644 index 00000000000..5d077558a0d --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getchildnodes.mdx @@ -0,0 +1,51 @@ +--- +title: "GETCHILDNODES" +--- + +The `GETCHILDNODES` function retrieves a `DOMNodeList` that has all the children of the particular node. If no children are there, then the `DOMNodeList` doesn't contain nodes. + +``` +GETCHILDNODES(n DOMNode) RETURN DOMNodeList +``` + +## Parameters + +`n` + +The `DOMNode` whose childnode list is to be retrieved. + +## Examples + +This example executes a function named `func1` that creates the XML structure `Dept1` and returns the root node which is a `DOMDocument`. + +```sql +CREATE OR REPLACE FUNCTION func1 RETURN DBMS_XMLDOM.DOMNode IS + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + l_departments_node DBMS_XMLDOM.DOMNode; + l_name_text DBMS_XMLDOM.DOMText; + l_name_textnode DBMS_XMLDOM.DOMNode; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + l_departments_node := DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.MAKENODE(l_department_element)); + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Dept1' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_departments_node,DBMS_XMLDOM.MAKENODE(l_name_text)); + return l_root_node; +END; +``` + +You can retrieve all the child nodes of the root node by calling `GETCHILDNODES`, and you can determine the number of child nodes using the `GETLENGTH` function: + +```sql +DECLARE + clist DBMS_XMLDOM.DOMNodeList; + len NUMBER; +BEGIN + clist := DBMS_XMLDOM.GETCHILDNODES(func1()); + len := DBMS_XMLDOM.GETLENGTH(clist); + dbms_output.put_line('root node num children: ' || to_char(len)); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getfirstchild.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getfirstchild.mdx new file mode 100644 index 00000000000..341c8ddf6c3 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getfirstchild.mdx @@ -0,0 +1,35 @@ +--- +title: "GETFIRSTCHILD" +--- + +The `GETFIRSTCHILD` function retrieves the first child of the particular node. If there is no such node, then this function returns NULL. + +``` +GETFIRSTCHILD(n DOMNode) RETURN DOMNode +``` + +## Parameters + +`n` + +The `DOMNode` whose first child needs to be retrieved. + +## Examples + +This example creates a new `DOMDocument` named `l_domdoc`, and turns it into a `DOMNode`. Then, it creates a `DOMElement` named `l_department_element` with the tag name “Departments” and appends this element as a child to the `DOMNode`. Finally, it outputs the tag name of the first (and in this example, the only) appended child. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Deptartments' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.MAKENODE(l_department_element)); + DBMS_OUTPUT.PUT_LINE(DBMS_XMLDOM.GETNODENAME(DBMS_XMLDOM.GETFIRSTCHILD(l_root_node))); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getlength.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getlength.mdx new file mode 100644 index 00000000000..1c4c16598d6 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getlength.mdx @@ -0,0 +1,51 @@ +--- +title: "GETLENGTH" +--- + +The `GETLENGTH` function returns the number of nodes in a `DOMNodeList`. + +``` +GETLENGTH(nl DOMNodeList) RETURN PLS_INTEGER +``` + +## Parameters + +`nl` + +The `DOMNodeList` + +## Examples + +This example executes a function named `func1` that creates the XML structure `Dept1` and returns the root node which is a `DOMDocument`. + +```sql +CREATE OR REPLACE FUNCTION func1 RETURN DBMS_XMLDOM.DOMNode IS + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + l_departments_node DBMS_XMLDOM.DOMNode; + l_name_text DBMS_XMLDOM.DOMText; + l_name_textnode DBMS_XMLDOM.DOMNode; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Deptartments' ); + l_departments_node := DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.MAKENODE(l_department_element)); + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Dept1' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_departments_node,DBMS_XMLDOM.MAKENODE(l_name_text)); + return l_root_node; +END; +``` + +You can retrieve all the child nodes of the root node by calling `GETCHILDNODES`, and you can determine the number of child nodes using the `GETLENGTH` function: + +```sql +DECLARE + clist DBMS_XMLDOM.DOMNodeList; + len NUMBER; +BEGIN + clist := DBMS_XMLDOM.GETCHILDNODES(func1()); + len := DBMS_XMLDOM.GETLENGTH(clist); + dbms_output.put_line('root node num children: ' || to_char(len)); +END; +``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodename.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodename.mdx new file mode 100644 index 00000000000..174f0ba38ae --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodename.mdx @@ -0,0 +1,32 @@ +--- +title: "GETNODENAME" +--- + +The `GETNODENAME` function provides the name of the node depending on its type. + +``` +GETNODENAME(n DOMNODE) RETURN VARCHAR2 +``` + +## Parameters + +`n` + +`DOMNode` value to be provided. + +## Examples + +This example creates a new `DOMDocument` named `l_domdoc`, and a `DOMElement` named `elem` with tag name “Departments”. Finally, it outputs the tag name. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_department_element DBMS_XMLDOM.DOMElement; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + dbms_output.put_line(DBMS_XMLDOM.GETNODENAME(DBMS_XMLDOM.MAKENODE(l_department_element))); +END; +``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodevalue.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodevalue.mdx new file mode 100644 index 00000000000..75827faedec --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getnodevalue.mdx @@ -0,0 +1,33 @@ +--- +title: "GETNODEVALUE" +--- + +The `GETNODEVALUE` function provides the value of the node depending on its type. + +``` +GETNODEVALUE(n DOMNode) RETURN VARCHAR2 +``` + +## Parameters + +`n` + +`DOMNode` to be provided. + + +## Examples + +This example creates a new `DOMDocument` named `l_domdoc`, and a text node with tag name “Depts list”. Finally, it outputs the text node value in XML it set before. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_name_text DBMS_XMLDOM.DOMText; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Depts list' ); + dbms_output.put_line(DBMS_XMLDOM.GETNODEVALUE(DBMS_XMLDOM.MAKENODE(l_name_text))); +END; +``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getxmltype.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getxmltype.mdx new file mode 100644 index 00000000000..8c9b8557674 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/getxmltype.mdx @@ -0,0 +1,50 @@ +--- +title: "GETXMLTYPE" +--- + +The `GETXMLTYPE` function converts a `DOMDocument` to XMLTYPE and returns it. + +``` +GETXMLTYPE(doc IN DOMDOCUMENT) RETURN XMLTYPE +``` + +## Parameters + +`doc` + +The `DOMDocument`. + +## Examples + +This example creates a new XML `DOMDocument`, sets the version to 1.0, and converts it into an XMLType object. + +```sql +DECLARE + l_xmltype XMLTYPE; + l_domdoc DBMS_XMLDOM.DOMDocument; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + DBMS_XMLDOM.SETVERSION(l_domdoc, '1.0'); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` + +This example takes an xml string as input, converts it into a `DOMDocument`, and adds a new element to the document. It then converts the `DOMDocument` back to `XMLType`. + +```sql +DECLARE + doc DBMS_XMLDOM.domdocument; + xmldata xmltype:=xmltype('1020'); + l_xmltype XMLTYPE; + elem DBMS_XMLDOM.DOMElement; +BEGIN + doc := DBMS_XMLDOM.NEWDOMDOCUMENT(xmldata); + elem := DBMS_XMLDOM.CREATEELEMENT(doc, 'testTag'); + PERFORM DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(doc), DBMS_XMLDOM.MAKENODE(elem)); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(doc); + DBMS_OUTPUT.PUT_LINE(l_xmltype::varchar2); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/index.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/index.mdx new file mode 100644 index 00000000000..74423e0aa8c --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/index.mdx @@ -0,0 +1,64 @@ +--- +title: "DBMS_XMLDOM" +navigation: + +- appendchild +- createelement +- createtextnode +- freedocument +- getattribute +- getchildnodes +- getfirstchild +- getlength +- getnodename +- getxmltype +- item +- makeelement +- makenode +- newdomdocument +- setattribute +- setversion +--- + +The `DBMS_XMLDOM` package implements Document Object Model (DOM) and is used to create DOM documents from scratch or from an XML document. + +EDB Postgres Advanced Server's implementation of `DBMS_XMLDOM` is a partial implementation when compared to Oracle's version. Only the functions and procedures listed in this table are supported. + +## Types + +The `DBMS_XMLDOM` package implements the following types: + +| Type name | Description | +|---------------|-------------------------------------------| +| `DOMNode` | It implements the DOM Node interface. | +| `DOMNodeList` | It implements the DOM NodeList interface. | +| `DOMElement` | It implements the DOM Element interface. | +| `DOMText` | It implements the DOM Text interface. | +| `DOMDocument` | It implements the DOM Document interface. | + +## Subprograms + +This table lists the subprograms available with `DBMS_XMLDOM` package: + +| Subprogram | Type | Return type | Description | +|------------------|-----------|-------------|--------------------------------------------------------------------------------| +| `APPENDCHILD` | Function | DOMNode | Appends a new child to the node. | +| `CREATEELEMENT` | Function | DOMElement | Creates a new element. | +| `CREATETEXTNODE` | Function | DOMText | Creates a text node. | +| `FREEDOCUMENT` | Procedure | N/A | Frees the resources associated with the DOMDocument. | +| `GETATTRIBUTE` | Function | DOMElement | Retrieves the attribute value given to an attribute name and returns VARCHAR2. | +| `GETCHILDNODES` | Function | DOMNodeList | Retrieves the children of the node. | +| `GETFIRSTCHILD` | Function | DOMNode | Retrieves the first child of the node. | +| `GETLENGTH` | Function | PLS_INTEGER | Retrieves the number of items in the given DOMNodeList. | +| `GETNODENAME` | Function | VARCHAR2 | Retrieves the name of the node. | +| `GETNODEVALUE` | Function | VARCHAR2 | Retrieves the value of the node. | +| `GETXMLTYPE` | Function | XMLTYPE | Converts DOMDocument to xmltype and returns it. | +| `ITEM` | Function | DOMNode | Retrieves the item from the given the index in the NODELIST. | +| `MAKEELEMENT` | Function | DOMElement | Casts the node to a DOMElement. | +| `MAKENODE` | Function | DOMNode | Casts the attribute to a node. | +| `NEWDOMDOCUMENT` | Function | DOMDocument | Creates a new document. | +| `SETATTRIBUTE` | Procedure | N/A | Sets the attribute value of a DOMElement. | +| `SETVERSION` | Procedure | N/A | Sets the version of the document. | + + + diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/item.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/item.mdx new file mode 100644 index 00000000000..51ca627d4e8 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/item.mdx @@ -0,0 +1,55 @@ +--- +title: "ITEM" +--- + +The `ITEM` function returns the item in the collection corresponding to the `idx` parameter. If the value of `idx` parameter is greater than or equal to the number of nodes in the list, then function returns a `NULL`. + +``` +ITEM(nl DOMNodeList, idx IN PLS_INTEGER) RETURN DOMNode +``` + +## Parameters + +`nl` + +The DOMNodeList, the number of nodes in the list. + +`idx` + +The index in the NODELIST that is used to retrieve the item. + +## Examples + +This example uses a function named `func1` that creates an XML structure `Dept1` and returns the document node that is the root node. + +```sql +CREATE OR REPLACE FUNCTION func1 RETURN DBMS_XMLDOM.DOMNode IS + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + l_departments_node DBMS_XMLDOM.DOMNode; + l_name_text DBMS_XMLDOM.DOMText; + l_name_textnode DBMS_XMLDOM.DOMNode; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Deptartments' ); + l_departments_node := DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.MAKENODE(l_department_element)); + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Dept1' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_departments_node,DBMS_XMLDOM.MAKENODE(l_name_text)); + return l_root_node; +END; +``` + +The document node is passed to `GETCHILDNODES` using the function `func1`, which returns the list of children of the document node. The list contains the `DOMElement` representing "Departments". The call to item returns this element as a `DOMNode`, which is then picked by `GETNODENAME` to fetch the tag name of this `DOMElement`. + +```sql +DECLARE + clist DBMS_XMLDOM.DOMNodeList; + l_node DBMS_XMLDOM.DOMNode; +BEGIN + clist := DBMS_XMLDOM.GETCHILDNODES(func1()); + l_node := DBMS_XMLDOM.ITEM(clist, 0); + dbms_output.put_line(DBMS_XMLDOM.GETNODENAME(l_node)); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makeelement.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makeelement.mdx new file mode 100644 index 00000000000..6b3d60430d0 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makeelement.mdx @@ -0,0 +1,41 @@ +--- +title: "MAKEELEMENT" +--- + +The `MAKEELEMENT` function converts a specified `DOMNode` into a `DOMElement` and returns it. + +`MAKEELEMENT` can only convert a `DOMNode` that originates from a `DOMElement`. If the `DOMNode` originates from a different type, like a `DOMText`, running `MAKEELEMENT` results in failure. + + +``` +MAKEELEMENT(n DOMNode) RETURN DOMElement +``` + +## Parameters + +`n` + +Value of the `DOMNode` to convert. + +## Examples + +This example defines a namespace named “example” and uses an XMLtype string to create an XML structure. `GETFIRSTCHILD` then returns a `DOMNode` that represents a `DOMElement`. Since `GETATTRIBUTE` expects a `DOMElement`, the `MAKEELEMENT` function converts a specified `DOMNode` into a `DOMElement` and returns it. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_departments_node DBMS_XMLDOM.DOMNode; + item_node DBMS_XMLDOM.DOMNode; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(XMLTYPE('')); + + + l_departments_node := DBMS_XMLDOM.GETFIRSTCHILD(DBMS_XMLDOM.MAKENODE(l_domdoc)); + item_node := DBMS_XMLDOM.GETFIRSTCHILD(l_departments_node); + dbms_output.put_line('item node: ' || DBMS_XMLDOM.GETNODENAME(item_node)); + dbms_output.put_line('item attr: ' || DBMS_XMLDOM.GETATTRIBUTE(DBMS_XMLDOM.MAKEELEMENT(item_node), 'id', 'example:namespace')); + + + DBMS_XMLDOM.FREEDOCUMENT(l_domdoc); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makenode.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makenode.mdx new file mode 100644 index 00000000000..b98f76a0f4a --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/makenode.mdx @@ -0,0 +1,55 @@ +--- +title: "MAKENODE" +--- + +The `MAKENODE` function accepts different types of values and returns the `DOMNode`. + +``` +MAKENODE(doc DOMDocument) RETURN DOMNode + +MAKENODE(elem DOMElement) RETURN DOMNode + +MAKENODE(t DOMText) RETURN DOMNode +``` + +## Parameters + +`doc` + +The `DOMDocument` to be casted. + +`elem` + +The `DOMElement` to be casted. + +`t` + +The `DOMText` to be casted. + +## Examples + +You can turn a `DOMDocument`, `DOMElement` and `DOMText` to a `DOMNode`. + +This example creates a new XML DOMDocument, and turns it into a `DOMNode` so it can be root. Then, it creates a `DOMElement` with tag name “Departments”, turns it into a node and appends it to the `DOMElement`. It then creates a text node `DOMNode` with tag name “Depts list” and appends it as a child to the `DOMElement` node. + +```sql +DECLARE + l_domdoc DBMS_XMLDOM.DOMDocument; + l_root_node DBMS_XMLDOM.DOMNode; + l_department_element DBMS_XMLDOM.DOMElement; + l_departments_node DBMS_XMLDOM.DOMNode; + l_name_text DBMS_XMLDOM.DOMText; + l_xmltype XMLTYPE; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + l_root_node := DBMS_XMLDOM.MAKENODE(l_domdoc); + l_department_element := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + l_departments_node := DBMS_XMLDOM.APPENDCHILD(l_root_node,DBMS_XMLDOM.makeNode(l_department_element)); + l_name_text := DBMS_XMLDOM.CREATETEXTNODE(l_domdoc, 'Depts list' ); + PERFORM DBMS_XMLDOM.APPENDCHILD(l_departments_node,DBMS_XMLDOM.MAKENODE(l_name_text)); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/newdomdocument.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/newdomdocument.mdx new file mode 100644 index 00000000000..1c84ed519b3 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/newdomdocument.mdx @@ -0,0 +1,58 @@ +--- +title: "NEWDOMDOCUMENT" +--- + + +The `NEWDOMDOCUMENT` function accepts XMLTYPE or CLOB type as input and returns the `DOMDocument` type. You can also create an empty `DOMDocument`. + +``` +NEWDOMDOCUMENT RETURN DOMDocument + +NEWDOMDOCUMENT(xmldoc IN XMLTYPE) RETURN DOMDocument; + +NEWDOMDOCUMENT (cl IN CLOB) RETURN DOMDocument; +``` + +## Parameters + +`xmldoc` + +It is the `XMLTYPE` of source for the `DOMDocument`. + +`cl` + +It is the `CLOB` source for the `DOMDocument`. + +## Example + +This example creates a new XML `DOMDocument`, sets the version to 1.0, and converts it into an XMLType object. + +```sql +DECLARE + l_xmltype XMLTYPE; + l_domdoc DBMS_XMLDOM.DOMDocument; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + DBMS_XMLDOM.SETVERSION(l_domdoc, '1.0'); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` + +This example takes an XMLType object, converts it into a `DOMDocument`, and then back to a XMLType. + +```sql +DECLARE + doc DBMS_XMLDOM.DOMDocument; + xmldata xmltype:=xmltype('1020'); + l_xmltype XMLTYPE; +BEGIN + doc := DBMS_XMLDOM.NEWDOMDOCUMENT(xmldata); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(doc); + DBMS_OUTPUT.PUT_LINE(l_xmltype::varchar2); + + +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setattribute.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setattribute.mdx new file mode 100644 index 00000000000..e18419aac09 --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setattribute.mdx @@ -0,0 +1,43 @@ +--- +title: "SETATTRIBUTE" +--- + +The `SETATTRIBUTE` procedure sets the value of a `DOMElement`'s attribute by name. + +``` +SETATTRIBUTE(elem DOMElement, name IN VARCHAR2, newvalue IN VARCHAR2) +``` + +## Parameters + +`elem` + +The `DOMElement` whose attribute is to be set. + +`name` + +Attribute name to be set. + +`newvalue` + +Attribute value to be set. + +## Examples + +This example creates a new `DOMDocument` named `l_domdoc`, and a `DOMElement` named `elem` with tag name “Departments”. It adds an attribute (`attr`) to the `DOMElement` with the value "value" and appends the `DOMElement` as a child of the `DOMDocument`. + +```sql +DECLARE + l_xml xmltype; + l_domdoc DBMS_XMLDOM.DOMDocument; + l_departments_node DBMS_XMLDOM.DOMNode; + elem DBMS_XMLDOM.DOMElement; +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT; + elem := DBMS_XMLDOM.CREATEELEMENT(l_domdoc, 'Departments' ); + DBMS_XMLDOM.SETATTRIBUTE(elem, 'attr', 'value'); + PERFORM DBMS_XMLDOM.APPENDCHILD(DBMS_XMLDOM.MAKENODE(l_domdoc), DBMS_XMLDOM.MAKENODE(elem)); + l_xml := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + dbms_output.put_line(l_xml.getStringVal()); +END; +``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setversion.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setversion.mdx new file mode 100644 index 00000000000..e2a37fb349f --- /dev/null +++ b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/18_dbms_xmldom/setversion.mdx @@ -0,0 +1,37 @@ +--- +title: "SETVERSION" +--- + +The `SETVERSION` procedure is used to set the version of the `DOMDocument`. + +``` +SETVERSION(doc DOMDocument, v VARCHAR2) +``` + +## Parameters + +`doc` + +Any `DOMDocument`. + +`v` + +The version of the document. + +## Examples + +This example creates a new XML `DOMDocument`, sets the version to 1.0, and converts it into an XMLType object. + +```sql +DECLARE + l_xmltype XMLTYPE; + l_domdoc DBMS_XMLDOM.DOMDocument; + + +BEGIN + l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(); + DBMS_XMLDOM.setversion(l_domdoc, '1.0'); + l_xmltype := DBMS_XMLDOM.GETXMLTYPE(l_domdoc); + DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); +END; +``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/appendchild.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/appendchild.mdx deleted file mode 100644 index 1c46fa3f3ae..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/appendchild.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "APPENDCHILD" ---- - -The `APPENDCHILD` function adds the node at the end of the list of children of a particular node. It returns the newly added node and if the node is already present, it removes the existing node before adding new node. - -``` -APPENDCHILD(n DOMNode, newChild IN DOMNode) RETURN DOMNode -``` - -## Parameters - -`n` - -The DOMNODE where the new node is to be added. - -`newchild` - -The child node to be added to the existing list of children of node n. - -## Examples - -This example creates a new XML DOMDocument named `l_domdoc` and a new DOMElement named `l_department_element` with tag name `Departments`. It then converts `l_domdoc` and `l_department_element` into DOMNodes, so `l_department_element` can be appended as a child to `l_domdoc`. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_department_element dbms_xmldom.DOMElement; - l_xmltype XMLTYPE; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - PERFORM dbms_xmldom.appendChild(dbms_xmldom.makeNode(l_domdoc), dbms_xmldom.makeNode(l_department_element)); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createelement.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createelement.mdx deleted file mode 100644 index ddbe6da1296..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createelement.mdx +++ /dev/null @@ -1,39 +0,0 @@ ---- -title: "CREATEELEMENT" ---- - -The `CREATEELEMENT` function creates and returns a DOMELEMENT. - -``` -CREATEELEMENT( doc DOMDOCUMENT, tagname IN VARCHAR2) RETURN DOMELEMENT -``` - -## Parameters - -`doc` - -Any DOMDOCUMENT - -`tagname` - -Tag name to be given to the new DOMELEMENT. - -## Examples - -This example creates a new XML DOMDocument named `l_domdoc` and a new DOMElement named `l_department_element` with tag name `Departments`. It then converts `l_domdoc` and `l_department_element` into DOMNodes, so `l_department_element` can be appended as a child to `l_domdoc`. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_department_element dbms_xmldom.DOMElement; - l_xmltype XMLTYPE; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - PERFORM dbms_xmldom.appendChild(dbms_xmldom.makeNode(l_domdoc), dbms_xmldom.makeNode(l_department_element)); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createtextnode.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createtextnode.mdx deleted file mode 100644 index 5fc7eef5de8..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/createtextnode.mdx +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: "CREATETEXTNODE" ---- - -The `CREATETEXTNODE` function creates and returns a DOMTEXT node. - -``` -CREATETEXTNODE( doc DOMDOCUMENT, data IN VARCHAR2) RETURN DOMTEXT -``` - -## Parameters - -`doc` - -Any DOMDOCUMENT - -`data` - -Content provided for the DOMTEXT node. - -## Examples - -This example creates a new XML DOMDocument, and turns it into a node so it can be root. Then, it creates a DOMElement with tag name “Departments”, turns it into a node and appends it to the DOMDocument. It then creates a text node with tag name “Depts list” and appends it to the “Departments” node. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - l_departments_node dbms_xmldom.DOMNode; - l_name_text dbms_xmldom.DOMText; - l_xmltype XMLTYPE; - - -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Depts list' ); - PERFORM dbms_xmldom.appendChild(l_departments_node,dbms_xmldom.makeNode(l_name_text)); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/freedocument.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/freedocument.mdx deleted file mode 100644 index b8b9571de96..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/freedocument.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "FREEDOCUMENT" ---- - -The `FREEDOCUMENT` procedure is used to free the DOMDOCUMENT object. - -``` -FREEDOCUMENT(doc IN DOMDocument) -``` - -## Parameters - -`doc` - -The DOMDOCUMENT to be made free. - - -## Examples - -This example creates a new DOMDocument, which is not accessible after it has been freed. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - - -BEGIN - l_domdoc := dbms_xmldom.newDOMDocument(); - dbms_xmldom.freeDocument(l_domdoc); - dbms_xmldom.setversion(l_domdoc, '1.0'); -END; -/ -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getattribute.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getattribute.mdx deleted file mode 100644 index 415a5bda18c..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getattribute.mdx +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "GETATTRIBUTE" ---- - -The `GETATTRIBUTE` function returns the value of an attribute of an DOMELEMENT by name. - -``` -GETATTRIBUTE(elem DOMElement, name IN VARCHAR2) RETURN VARCHAR2 - -GETATTRIBUTE(elem DOMElement, name IN VARCHAR2, ns IN VARCHAR2) RETURN VARCHAR2 -``` - -## Parameters - -`elem` - -The DOMELEMENT whose attribute needs to be obtained. - -`name` - -The attribute name which needs to be obtained. - -`ns` - -The namespace URI - -## Examples - -This example creates a new DOMDocument named `l_domdoc`, and a DOMElement named `elem` with tag name “Departments”. It then adds an attribute to the DOMElement named ‘value’. The example turns both `l_domdoc` and `elem` to DOMNodes to append `elem` as a child of `l_domdoc`. Finally, it converts `l_domdoc` to `XMLType`. - -The `get` subprogram returns the value of the attribute `attr` of the "Departments" element. - - -```sql -DECLARE - l_xml xmltype; - l_domdoc dbms_xmldom.DOMDocument; - l_departments_node dbms_xmldom.DOMNode; - elem dbms_xmldom.DOMElement; -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - elem := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - dbms_xmldom.setAttribute(elem, 'attr', 'value'); - PERFORM dbms_xmldom.appendchild(dbms_xmldom.makeNode(l_domdoc), dbms_xmldom.makeNode(elem)); - l_xml := dbms_xmldom.getxmltype(l_domdoc); - dbms_output.put_line(l_xml.getStringVal()); - dbms_output.put_line(dbms_xmldom.getattribute(elem, 'attr')); -END; -``` - -This example defines a namespace named “example” and uses an XMLtype string to create an XML structure. `GETFIRSTCHILD` then returns a `DOMNODE` that represents a `DOMELEMENT`. Since `GETATTRIBUTE` expects a `DOMELEMENT`, the `MAKEELEMENT` function converts a specified `DOMNODE` into a `DOMELEMENT` and returns it. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_departments_node dbms_xmldom.DOMNode; - item_node dbms_xmldom.DOMNode; -BEGIN - l_domdoc := dbms_xmldom.newDOMDocument(XMLTYPE('')); - - - l_departments_node := DBMS_XMLDOM.getfirstchild(dbms_xmldom.makeNode(l_domdoc)); - item_node := dbms_xmldom.getfirstchild(l_departments_node); - dbms_output.put_line('item node: ' || dbms_xmldom.getnodename(item_node)); - dbms_output.put_line('item attr: ' || dbms_xmldom.getattribute(dbms_xmldom.makeelement(item_node), 'id', 'example:namespace')); - - - dbms_xmldom.freeDocument(l_domdoc); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getchildnodes.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getchildnodes.mdx deleted file mode 100644 index 9df6387b545..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getchildnodes.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "GETCHILDNODES" ---- - -The `GETCHILDNODES` function retrieves a DOMENODELIST that has all the children of the particular node. If no children are there, then the DOMENODELIST doesn't contain nodes. - -``` -GETCHILDNODES(n DOMNode) RETURN DOMNodeList -``` - -## Parameters - -`n` - -The DOMNODE whose childnode list is to be retrieved. - -## Examples - -This example executes a function named `func1` that creates the XML structure `Dept1` and returns the root node which is a DOMDocument. - -```sql -CREATE OR REPLACE FUNCTION func1 RETURN dbms_xmldom.DOMNode IS - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - l_departments_node dbms_xmldom.DOMNode; - l_name_text dbms_xmldom.DOMText; - l_name_textnode dbms_xmldom.DOMNode; -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Dept1' ); - PERFORM dbms_xmldom.appendChild(l_departments_node,dbms_xmldom.makeNode(l_name_text)); - return l_root_node; -END; -``` - -You can retrieve all the child nodes of the root node by calling `getChildNodes`, and you can determine the number of child nodes using the `getLength` function: - -```sql -DECLARE - clist dbms_xmldom.DOMNodeList; - len NUMBER; -BEGIN - clist := dbms_xmldom.getChildNodes(func1()); - len := dbms_xmldom.getlength(clist); - dbms_output.put_line('root node num children: ' || to_char(len)); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getfirstchild.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getfirstchild.mdx deleted file mode 100644 index 7e510b7ba1e..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getfirstchild.mdx +++ /dev/null @@ -1,35 +0,0 @@ ---- -title: "GETFIRSTCHILD" ---- - -The `GETFIRSTCHILD` function retrieves the first child of the particular node. If there is no such node, then this function returns NULL. - -``` -GETFIRSTCHILD(n DOMNODE) RETURN DOMNODE -``` - -## Parameters - -`n` - -The DOMNODE whose first child needs to be retrieved. - -## Examples - -This example creates a new DOMDocument named `l_domdoc`, and turns it into a DOMNode. Then, it creates a DOMElement named `l_department_element` with the tag name “Departments” and appends this element as a child to the DOMNode. Finally, it outputs the tag name of the first (and in this example, the only) appended child. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Deptartments' ); - PERFORM dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - DBMS_OUTPUT.PUT_LINE(dbms_xmldom.getNodename(dbms_xmldom.getfirstChild(l_root_node))); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getlength.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getlength.mdx deleted file mode 100644 index 5728cdf95e6..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getlength.mdx +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: "GETLENGTH" ---- - -The `GETLENGTH` function returns the number of nodes in a DOMNODELIST. - -``` -GETLENGTH(nl DOMNODELIST) RETURN PLS_INTEGER -``` - -## Parameters - -`nl` - -The DOMENODELIST - -## Examples - -This example executes a function named `func1` that creates the XML structure `Dept1` and returns the root node which is a DOMDocument. - -```sql -CREATE OR REPLACE FUNCTION func1 RETURN dbms_xmldom.DOMNode IS - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - l_departments_node dbms_xmldom.DOMNode; - l_name_text dbms_xmldom.DOMText; - l_name_textnode dbms_xmldom.DOMNode; -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Deptartments' ); - l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Dept1' ); - PERFORM dbms_xmldom.appendChild(l_departments_node,dbms_xmldom.makeNode(l_name_text)); - return l_root_node; -END; -``` - -You can retrieve all the child nodes of the root node by calling `getChildNodes`, and you can determine the number of child nodes using the `getLength` function: - -```sql -DECLARE - clist dbms_xmldom.DOMNodeList; - len NUMBER; -BEGIN - clist := dbms_xmldom.getChildNodes(func1()); - len := dbms_xmldom.getlength(clist); - dbms_output.put_line('root node num children: ' || to_char(len)); -END; -``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodename.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodename.mdx deleted file mode 100644 index b02326231f5..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodename.mdx +++ /dev/null @@ -1,32 +0,0 @@ ---- -title: "GETNODENAME" ---- - -The `GETNODENAME` function provides the name of the node depending on its type. - -``` -GETNODENAME(n DOMNODE) RETURN VARCHAR2 -``` - -## Parameters - -`n` - -DOMNODE value to be provided - -## Examples - -This example creates a new DOMDocument named `l_domdoc`, and a DOMElement named `elem` with tag name “Departments”. Finally, it outputs the tag name. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_department_element dbms_xmldom.DOMElement; - - -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - dbms_output.put_line(dbms_xmldom.getnodename(dbms_xmldom.makeNode(l_department_element))); -END; -``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodevalue.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodevalue.mdx deleted file mode 100644 index 8129ac155d3..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getnodevalue.mdx +++ /dev/null @@ -1,33 +0,0 @@ ---- -title: "GETNODEVALUE" ---- - -The `GETNODEVALUE` function provides the value of the node depending on its type. - -``` -GETNODEVALUE(n DOMNODE) RETURN VARCHAR2 -``` - -## Parameters - -`n` - -DOMNODE to be provided - - -## Examples - -This example creates a new DOMDocument named `l_domdoc`, and a text node with tag name “Depts list”. Finally, it outputs the text node value in XML it set before. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_name_text dbms_xmldom.DOMText; - - -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Depts list' ); - dbms_output.put_line(dbms_xmldom.getnodevalue(dbms_xmldom.makeNode(l_name_text))); -END; -``` diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getxmltype.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getxmltype.mdx deleted file mode 100644 index c8b9f73a792..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/getxmltype.mdx +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: "GETXMLTYPE" ---- - -The `GETXMLTYPE` function converts a DOMDOCUMENT to XMLTYPE and returns it. - -``` -GETXMLTYPE(doc IN DOMDOCUMENT) RETURN XMLTYPE -``` - -## Parameters - -`doc` - -The DOMDOCUMENT - -## Examples - -This example creates a new XML DOMDocument, sets the version to 1.0, and converts it into an XMLType object. - -```sql -DECLARE - l_xmltype XMLTYPE; - l_domdoc dbms_xmldom.DOMDocument; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - dbms_xmldom.setversion(l_domdoc, '1.0'); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` - -This example takes an xml string as input, converts it into a DOMDocument, and adds a new element to the document. It then converts the DOMDocument back to XMLType. - -```sql -DECLARE - doc dbms_xmldom.domdocument; - xmldata xmltype:=xmltype('1020'); - l_xmltype XMLTYPE; - elem dbms_xmldom.DOMElement; -BEGIN - doc := dbms_xmldom.newdomdocument(xmldata); - elem := dbms_xmldom.createElement(doc, 'testTag'); - PERFORM dbms_xmldom.appendChild(dbms_xmldom.makeNode(doc), dbms_xmldom.makeNode(elem)); - l_xmltype := dbms_xmldom.getXmlType(doc); - DBMS_OUTPUT.PUT_LINE(l_xmltype::varchar2); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/index.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/index.mdx deleted file mode 100644 index 5c13d59fc2e..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/index.mdx +++ /dev/null @@ -1,80 +0,0 @@ ---- -title: "DBMS_XMLDOM" -navigation: - -- appendchild -- createelement -- createtextnode -- freedocument -- getattribute -- getchildnodes -- getfirstchild -- getlength -- getnodename -- getxmltype -- item -- makeelement -- makenode -- newdomdocument -- setattribute -- setversion ---- - -The `DBMS_XMLDOM` package is mainly used to access the `XMLType` objects. It provides an application programming interface for HTML and XML documents as an Document Object Model (DOM). This package is specially designed to work like any other DOM interfaces. - -EDB Postgres Advanced Server's implementation of `DBMS_XMLDOM` is a partial implementation when compared to Oracle's version. Only the functions and procedures listed in this table are supported. - -## Guidelines - -These are some guidelines for the usage of the `DBMS_XMLDOM` subprogram: - -- The `makeNode` function supports DOM element types only (`DOMDocument`, `DOMElement`, `DOMText`, etc.). -- A `DOMDocument` accepts assigned DOMElement types only, otherwise an error is thrown. -- `DBMS_XMLDOM` accepts only unicode characters in the HTML or XML file. -- You can call methods on NULL objects. -- You cannot assign documents that are freed. -- Nodes: - - You can append more than one child to a document node. - - A node cannot belong to several documents. -- Elements: - - When an element is added twice, only the latest is considered. - - You cannot add an element to itself. - -## Types - -The `DBMS_XMLDOM` package implements the following types: - -| Type name | Description | -|---------------|-------------------------------------------| -| `DOMNode` | It implements the DOM Node interface. | -| `DOMNodeList` | It implements the DOM NodeList interface. | -| `DOMElement` | It implements the DOM Element interface. | -| `DOMText` | It implements the DOM Text interface. | -| `DOMDocument` | It implements the DOM Document interface. | - -## Subprograms - -This table lists the subprograms available with `DBMS_XMLDOM` package: - -| Subprogram | Type | Return type | Description | -|------------------|-----------|-------------|-------------------------------------------------------------------------------| -| `appendChild` | Function | DOMNODE | Appends a new child to the node | -| `createElement` | Function | DOMELEMENT | Creates a new element | -| `createTextNode` | Function | DOMTEXT | Creates a text node | -| `freeDocument` | Procedure | N/A | Frees the resources associated with the DOMDocument | -| `getAttribute` | Function | DOMELEMENT | Retrieves the attribute value given to an attribute name and returns VARCHAR2 | -| `getChildNodes` | Function | DOMNODELIST | Retrieves the children of the node | -| `getFirstChild` | Function | DOMNODE | Retrieves the first child of the node | -| `getLength` | Function | PLS_INTEGER | Retrieves the number of items in the given DOMNODELIST | -| `getNodeName` | Function | VARCHAR2 | Retrieves the name of the node | -| `getNodeValue` | Function | VARCHAR2 | Retrieves the value of the node | -| `getxmltype` | Function | XMLTYPE | Converts DOMDocument to xmltype and returns it | -| `item` | Function | DOMNODE | Retrieves the item from the given the index in the NODELIST | -| `makeElement` | Function | DOMELEMENT | Casts the node to a DOMELEMENT | -| `makeNode` | Function | DOMNODE | Casts the attribute to a node | -| `newDOMDcoument` | Function | DOMDOCUMENT | Creates a new document | -| `setAttribute` | Procedure | N/A | Sets the attribute value of a DOMElement | -| `setVersion` | Procedure | N/A | Sets the version of the document | - - - diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/item.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/item.mdx deleted file mode 100644 index e2becee172c..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/item.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "ITEM" ---- - -The `ITEM` function returns the item in the collection corresponding to the `idx` parameter. If the value of `idx` parameter is greater than or equal to the number of nodes in the list, then function returns a `NULL`. - -``` -ITEM(nl DOMNODELIST, idx IN PLS_INTEGER) RETURN DOMNODE -``` - -## Parameters - -`nl` - -The DOMNODELIST, the number of nodes in the list. - -`idx` - -The index in the NODELIST that is used to retrieve the item. - -## Examples - -This example uses a function named `func1` that creates an XML structure `Dept1` and returns the document node that is the root node. - -```sql -CREATE OR REPLACE FUNCTION func1 RETURN dbms_xmldom.DOMNode IS - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - l_departments_node dbms_xmldom.DOMNode; - l_name_text dbms_xmldom.DOMText; - l_name_textnode dbms_xmldom.DOMNode; -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Deptartments' ); - l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Dept1' ); - PERFORM dbms_xmldom.appendChild(l_departments_node,dbms_xmldom.makeNode(l_name_text)); - return l_root_node; -END; -``` - -The document node is passed to `getChildNodes` using the function `func1`, which returns the list of children of the document node. The list contains the `DOMElement` representing "Departments". The call to item returns this element as a `DOMNode`, which is then picked by `getnodename` to fetch the tag name of this `DOMElement`. - -```sql -DECLARE - clist dbms_xmldom.DOMNodeList; - l_node dbms_xmldom.DOMNode; -BEGIN - clist := dbms_xmldom.getChildNodes(func1()); - l_node := dbms_xmldom.item(clist, 0); - dbms_output.put_line(dbms_xmldom.getnodename(l_node)); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makeelement.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makeelement.mdx deleted file mode 100644 index 8e6f8263498..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makeelement.mdx +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: "MAKEELEMENT" ---- - -The `MAKEELEMENT` function converts a specified DOMNODE into a DOMELEMENT and returns it. - -`MAKEELEMENT` can only convert a DOMNODE that originates from a DOMELEMENT. If the DOMNODE originates from a different type, like a DOMTEXT, running `MAKEELEMENT` results in failure. - -``` -MAKEELEMENT(n DOMNODE) RETURN DOMELEMENT -``` - -## Parameters - -`n` - -Value of the DOMNODE to convert. - -## Examples - -This example defines a namespace named “example” and uses an XMLtype string to create an XML structure. `GETFIRSTCHILD` then returns a `DOMNODE` that represents a `DOMELEMENT`. Since `GETATTRIBUTE` expects a `DOMELEMENT`, the `MAKEELEMENT` function converts a specified `DOMNODE` into a `DOMELEMENT` and returns it. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_departments_node dbms_xmldom.DOMNode; - item_node dbms_xmldom.DOMNode; -BEGIN - l_domdoc := dbms_xmldom.newDOMDocument(XMLTYPE('')); - - - l_departments_node := DBMS_XMLDOM.getfirstchild(dbms_xmldom.makeNode(l_domdoc)); - item_node := dbms_xmldom.getfirstchild(l_departments_node); - dbms_output.put_line('item node: ' || dbms_xmldom.getnodename(item_node)); - dbms_output.put_line('item attr: ' || dbms_xmldom.getattribute(dbms_xmldom.makeelement(item_node), 'id', 'example:namespace')); - - - dbms_xmldom.freeDocument(l_domdoc); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makenode.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makenode.mdx deleted file mode 100644 index 31665be5532..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/makenode.mdx +++ /dev/null @@ -1,55 +0,0 @@ ---- -title: "MAKENODE" ---- - -The `MAKENODE` function accepts different types of values and returns the DOMNODE. - -``` -MAKENODE(doc DOMDOCUMENT) RETURN DOMNODE - -MAKENODE(elem DOMELEMENT) RETURN DOMNODE - -MAKENODE(t DOMTEXT) RETURN DOMNODE -``` - -## Parameters - -`doc` - -The DOMDOCUMENT to be casted - -`elem` - -The `DOMELEMENT` to be casted - -`t` - -The `DOMTEXT` to be casted - -## Examples - -You can turn a `DOMDocument`, `DOMElement` and `DOMText` to a `DOMNode`. - -This example creates a new XML DOMDocument, and turns it into a node so it can be root. Then, it creates a DOMElement with tag name “Departments”, turns it into a node and appends it to the DOMDocument. It then creates a text node with tag name “Depts list” and appends it to the “Departments” node. - -```sql -DECLARE - l_domdoc dbms_xmldom.DOMDocument; - l_root_node dbms_xmldom.DOMNode; - l_department_element dbms_xmldom.DOMElement; - l_departments_node dbms_xmldom.DOMNode; - l_name_text dbms_xmldom.DOMText; - l_xmltype XMLTYPE; - - -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - l_root_node := dbms_xmldom.makeNode(l_domdoc); - l_department_element := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - l_departments_node := dbms_xmldom.appendChild(l_root_node,dbms_xmldom.makeNode(l_department_element)); - l_name_text := dbms_xmldom.createTextNode(l_domdoc, 'Depts list' ); - PERFORM dbms_xmldom.appendChild(l_departments_node,dbms_xmldom.makeNode(l_name_text)); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/newdomdocument.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/newdomdocument.mdx deleted file mode 100644 index b334076a5b9..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/newdomdocument.mdx +++ /dev/null @@ -1,58 +0,0 @@ ---- -title: "NEWDOMDOCUMENT" ---- - - -The `NEWDOMDOCUMENT` function accepts XMLTYPE or CLOB type as input and returns the DOMDOCUMENT type. You can also create an empty DOMDOCUMENT. - -``` -NEWDOMDOCUMENT RETURN DOMDOCUMENT - -NEWDOMDOCUMENT(xmldoc IN XMLTYPE) RETURN DOMDOCUMENT; - -NEWDOMDOCUMENT (cl IN CLOB) RETURN DOMDOCUMENT; -``` - -## Parameters - -`xmldoc` - -It is the `XMLTYPE` of source for the DOMDOCUMENT. - -`cl` - -It is the `CLOB` source for the DOMDOCUMENT. - -## Example - -This example creates a new XML DOMDocument, sets the version to 1.0, and converts it into an XMLType object. - -```sql -DECLARE - l_xmltype XMLTYPE; - l_domdoc dbms_xmldom.DOMDocument; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - dbms_xmldom.setversion(l_domdoc, '1.0'); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -``` - -This example takes an XMLType object, converts it into a DOMDocument, and then back to a XMLType. - -```sql -DECLARE - doc dbms_xmldom.domdocument; - xmldata xmltype:=xmltype('1020'); - l_xmltype XMLTYPE; -BEGIN - doc := dbms_xmldom.newdomdocument(xmldata); - l_xmltype := dbms_xmldom.getXmlType(doc); - DBMS_OUTPUT.PUT_LINE(l_xmltype::varchar2); - - -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setattribute.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setattribute.mdx deleted file mode 100644 index 2c56eda10ba..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setattribute.mdx +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: "SETATTRIBUTE" ---- - -The `SETATTRIBUTE` procedure sets the value of a DOMELEMENT's attribute by name. - -``` -SETATTRIBUTE(elem DOMELEMENT, name IN VARCHAR2, newvalue IN VARCHAR2) -``` - -## Parameters - -`elem` - -The DOMELEMENT whose attribute is to be set. - -`name` - -Attribute name to be set. - -`newvalue` - -Attribute value to be set. - -## Examples - -This example creates a new DOMDocument named `l_domdoc`, and a DOMElement named `elem` with tag name “Departments”. It then adds an attribute to the DOMElement named ‘value’. The example turns both `l_domdoc` and `elem` to DOMNodes to append `elem` as a child of `l_domdoc`. Finally, it converts `l_domdoc` to `XMLType`. - -```sql -DECLARE - l_xml xmltype; - l_domdoc dbms_xmldom.DOMDocument; - l_departments_node dbms_xmldom.DOMNode; - elem dbms_xmldom.DOMElement; -BEGIN - l_domdoc := dbms_xmldom.newDomDocument; - elem := dbms_xmldom.createElement(l_domdoc, 'Departments' ); - dbms_xmldom.setAttribute(elem, 'attr', 'value'); - PERFORM dbms_xmldom.appendchild(dbms_xmldom.makeNode(l_domdoc), dbms_xmldom.makeNode(elem)); - l_xml := dbms_xmldom.getxmltype(l_domdoc); - dbms_output.put_line(l_xml.getStringVal()); -END; -``` \ No newline at end of file diff --git a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setversion.mdx b/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setversion.mdx deleted file mode 100644 index 33ccac022d8..00000000000 --- a/product_docs/docs/epas/17/reference/oracle_compatibility_reference/epas_compat_bip_guide/03_built-in_packages/dbms_xmldom/setversion.mdx +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "SETVERSION" ---- - -The `SETVERSION` procedure is used to set the version of the DOMDOCUMENT. - -``` -SETVERSION(doc DOMDOCUMENT, v VARCHAR2) -``` - -## Parameters - -`doc` - -Any DOMDOCUMENT - -`v` - -The version of the document - -## Examples - -This example creates a new XML DOMDocument, sets the version to 1.0, and converts it into an XMLType object. - -```sql -DECLARE - l_xmltype XMLTYPE; - l_domdoc dbms_xmldom.DOMDocument; - - -BEGIN - l_domdoc := dbms_xmldom.NewDOMDocument(); - dbms_xmldom.setversion(l_domdoc, '1.0'); - l_xmltype := dbms_xmldom.getXmlType(l_domdoc); - DBMS_OUTPUT.PUT_LINE(l_xmltype.getStringVal()); -END; -```