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: stephen O'D <stephen.odonnell_at_gmail.com>
Date: 13 Sep 2005 06:02:30 -0700
Message-ID: <1126616550.019883.291070@z14g2000cwz.googlegroups.com>

amogh wrote:
> 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

Ah yes ... I knew it was possible to validate against a DTD using the inbuild XML Parser. However, I found it to perform very poorly when I tried it out (I was parsing a document and extracting some fields from it). Perhaps I was doing something wrong, but I found using the native XMLTYPE to perform the parsing and extraction of fields worked ~10 times faster. It is certainly worth giving it a go though, as it is the only way I have found to validate against a DTD. Received on Tue Sep 13 2005 - 08:02:30 CDT

Original text of this message

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