-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
streamline formatting: programs and subprograms capitalized in text a…
…nd code, types lower-case
- Loading branch information
1 parent
50e2482
commit 0bd91bd
Showing
19 changed files
with
259 additions
and
259 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
..._reference/epas_compat_bip_guide/03_built-in_packages/06_dbms_lob/11_substr.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
title: "GETATTRIBUTE" | ||
--- | ||
|
||
The `GETATTRIBUTE` function returns the value of an attribute of an DOMELEMENT by name. | ||
The `GETATTRIBUTE` function returns the value of an attribute of an `DOMElement` by name. | ||
|
||
``` | ||
GETATTRIBUTE(elem DOMElement, name IN VARCHAR2) RETURN VARCHAR2 | ||
|
@@ -14,57 +14,57 @@ GETATTRIBUTE(elem DOMElement, name IN VARCHAR2, ns IN VARCHAR2) RETURN VARCHAR2 | |
|
||
`elem` | ||
|
||
The DOMELEMENT whose attribute needs to be obtained. | ||
The `DOMElement` whose attribute needs to be obtained. | ||
|
||
`name` | ||
|
||
The attribute name which needs to be obtained. | ||
|
||
`ns` | ||
|
||
The namespace URI | ||
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`. | ||
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; | ||
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); | ||
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')); | ||
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. | ||
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; | ||
l_domdoc DBMS_XMLDOM.DOMDocument; | ||
l_departments_node DBMS_XMLDOM.DOMNode; | ||
item_node DBMS_XMLDOM.DOMNode; | ||
BEGIN | ||
l_domdoc := dbms_xmldom.newDOMDocument(XMLTYPE('<b:collection xmlns:b="example:namespace"><b:item b:type="primary" b:id="[email protected]"></b:item></b:collection>')); | ||
l_domdoc := DBMS_XMLDOM.NEWDOMDOCUMENT(XMLTYPE('<b:collection xmlns:b="example:namespace"><b:item b:type="primary" b:id="[email protected]"></b:item></b:collection>')); | ||
|
||
|
||
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')); | ||
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); | ||
DBMS_XMLDOM.FREEDOCUMENT(l_domdoc); | ||
END; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.