Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: create XML from cursor

Re: create XML from cursor

From: amogh <amogh.r_at_gmail.com>
Date: Tue, 13 Sep 2005 17:09:18 +0530
Message-ID: <4326BA66.6070500@gmail.com>


stephen O'D wrote:

> Frank Dietrich wrote:
> 

>>Hi,
>>
>>I'm looking for a simple way to produce an valid XML file (with external
>>DTD) from a table.
>>
>>A function like: CreateXMLfile(tablename, dtd_filename, xml_filename);
>>
>>Or is the only way
>>
>> select XMLELEMENT( "elements",
>> XMLAGG ( XMLELEMENT ( "child_1",
>> XMLELEMENT ( "child_2",
>> [and so on ...]
>>
>>And check by my self that the XML will be valid to the DTD?
>>
>>regards
>>Frank
> 
> 
> I have been using the XML capabilities recently, and I have not yet
> found a way to validate an XML type using a DTD.  I believe you can
> validate against an XML Schema document though (these are the successor
> to DTD's and are quite a bit more powerful).  I am not sure if you can
> put the schema in a file, or if it has to be on a URL.  The XML
> Developers Guide tells you how to do this (in the section it describes
> the XMLTYPE api).
> 

Validating an XMLType through a DTD is possible. Check under "Using Triggers to Constrain XMLType Documents" here: http://www.oracle.com/oramag/oracle/01-nov/o61xml.html

The example uses a a DTD stored as a CLOB for validating the XML.

Amogh Received on Tue Sep 13 2005 - 06:39:18 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US