Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Creating valid and well-formed XML-output
I'd like to create a script to generate a valid XML-file based upon the
contents of a table containing employee information.
So far, I've come up with the following:
SELECT SYS_XMLGEN(XMLELEMENT("Medewerker",
XMLFOREST(Registratienr,
Voornaam, Achternaam, Tussenvoegsel, Voorletters, Geslacht, Datum_uit_dienst, Gebruikersnaam, Email
This results into the following XML-file:
<?xml version="1.0"?> <Medewerkerslijst> <ROW>
This is a valid XML-file, but in order for the file to be wellformed as well as valid I'll have to change the element <ROW> into <MEDEWERKER>. In addition, I'd like to add elements to point to a style sheet, e.g. <?xml-stylesheet href="test.xsl" type="text/xsl" ?>, and a reference to an XML-schema in the root-element <Medewerkerslijst>. I think I ought to achieve this by using the XMLFORMAT.createformat statement, but I can't seem to figure it out. Any help would be appreciated.
Willy Tadema Received on Tue Aug 15 2006 - 14:54:29 CDT