1 package dbms_xmlparser AUTHID CURRENT_USER IS
2
3 /**
4 * Parser interface type
5 */
6 TYPE Parser IS RECORD (id dbms_xmldom.domtype);
7
8 /**
9 * Internal error
10 */
11 INTERNAL_ERR CONSTANT NUMBER := -20000;
12
13 /**
14 * Other errors
15 */
16 PARSE_ERR CONSTANT NUMBER := -20100;
17 FILE_ERR CONSTANT NUMBER := -20101;
18 CONN_ERR CONSTANT NUMBER := -20102;
19 NULL_ERR CONSTANT NUMBER := -20103;
20
21 /**
22 * Return the release version of the Oracle XML Parser for PL/SQL
23 */
24 FUNCTION getReleaseVersion RETURN VARCHAR2;
25
26 /**
27 * Parses xml stored in the given url/file and returns the built DOM Document
28 */
29 FUNCTION parse(url VARCHAR2, csid IN NUMBER := 0 )
30 RETURN dbms_xmldom.DOMDocument;
31
32 /**
33 * Returns a new parser instance
34 */
35 FUNCTION newParser RETURN Parser;
36
37 PROCEDURE freeParser(p Parser);
38
39 /**
40 * Parses xml stored in the given url/file
41 */
42 PROCEDURE parse(p Parser, url VARCHAR2, csid IN NUMBER := 0);
43
44 /**
45 * Parses xml stored in the given buffer
46 */
47 PROCEDURE parseBuffer(p Parser, doc VARCHAR2);
48
49 /**
50 * Parses xml stored in the given clob
51 */
52 PROCEDURE parseClob(p Parser, doc CLOB);
53
54 /**
55 * Parses the given dtd
56 */
57 PROCEDURE parseDTD(p Parser, url VARCHAR2, root VARCHAR2, csid IN NUMBER :=0);
58
59 /**
60 * Parses the given dtd
61 */
62 PROCEDURE parseDTDBuffer(p Parser, dtd VARCHAR2, root VARCHAR2);
63
64 /**
65 * Parses the given dtd
66 */
67 PROCEDURE parseDTDClob(p Parser, dtd CLOB, root VARCHAR2);
68
69 /**
70 * Sets base directory used to resolve relative urls
71 */
72 PROCEDURE setBaseDir(p Parser, dir VARCHAR2);
73
74 /**
75 * Gets base directory used to resolve relative urls
76 */
77 FUNCTION getBaseDir(p Parser) return VARCHAR2;
78
79 /**
80 * Sets warnings TRUE - on, FALSE - off
81 */
82 PROCEDURE showWarnings(p Parser, yes BOOLEAN);
83
84 /**
85 * Sets errors to be sent to the specified file
86 */
87 PROCEDURE setErrorLog(p Parser, fileName VARCHAR2);
88
89 /**
90 * Gets the error log file, if any
91 */
92 FUNCTION getErrorLog(p Parser) RETURN VARCHAR2;
93
94 /**
95 * Sets whitespace preserving mode TRUE - on, FALSE - off
96 */
97 PROCEDURE setPreserveWhitespace(p Parser, yes BOOLEAN);
98
99 /**
100 * Sets validation mode TRUE - validating, FALSE - non validation
101 */
102 PROCEDURE setValidationMode(p Parser, yes BOOLEAN);
103
104 /**
105 * Gets validation mode
106 */
107 FUNCTION getValidationMode(p Parser) RETURN BOOLEAN;
108
109 /**
110 * Sets DTD for validation purposes - MUST be before an xml document is parsed
111 */
112 PROCEDURE setDoctype(p Parser, dtd dbms_xmldom.DOMDocumentType);
113
114 /**
115 * Gets DTD parsed - MUST be called only after a dtd is parsed
116 */
117 FUNCTION getDoctype(p Parser) RETURN dbms_xmldom.DOMDocumentType;
118
119 /**
120 * Gets DOM Document built by the parser - MUST be called only after a
121 * document is parsed
122 */
123 FUNCTION getDocument(p Parser) RETURN dbms_xmldom.DOMDocument;
124
125 /**
126 * Internal function: writes the errors to the errorlog file, if any
127 */
128 PROCEDURE writeErrors(p Parser, err_num NUMBER, err_msg VARCHAR2);
129
130 /**********************************************************/
131 /* retainCDATASection is a no-op procedure added strictly */
132 /* for compatibility with XDK. In violation to the W3C */
133 /* spec, XDK allows a CDATA section to be parsed. If the */
134 /* appl does not want this behavior then a value of FALSE */
135 /* passed to this procedure. Since XDB will never parse */
136 /* CDATA sections, calling this procedure has no effect. */
137 /**********************************************************/
138 PROCEDURE retainCDATASection (p Parser, flag boolean);
139
140 end dbms_xmlparser;