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

Home -> Community -> Usenet -> c.d.o.server -> Re: How to generate XML customized output in oracle 9.2 ?

Re: How to generate XML customized output in oracle 9.2 ?

From: DA Morgan <damorgan_at_psoug.org>
Date: Sun, 14 Jan 2007 11:05:12 -0800
Message-ID: <1168801511.299408@bubbleator.drizzle.com>


PJP wrote:
> Hi,
>
> I want to generate following XML output using SQL
>
> <?xml version="1.0" encoding="UTF-8" ?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified">
> <xs:element name="CLIENT">
> <xs:element name="TRANSACTION">
> <xs:complexType>
> <xs:sequence>
> <xs:element name="MessageCode">
> <xs:simpleType>
> <xs:restriction base="xs:0100">
> <xs:pattern value="0100" />
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element name="EMPNO">
> <xs:simpleType>
> <xs:restriction base="xs:xxxx"> => EMP NO
> <xs:minLength value="1" />
> <xs:maxLength value="4" />
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> <xs:element name="ENAME">
> <xs:simpleType>
> <xs:restriction base="xs:xxxx"> => ENAME
> <xs:minLength value="1" />
> <xs:maxLength value="10" />
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> - <xs:element name="JOB">
> - <xs:simpleType>
> - <xs:restriction base="xs:xxxx"> => JOB
> <xs:minLength value="1" />
> <xs:maxLength value="9" />
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> ...
> ...
> <xs:element name="COMMISSION">
> - <xs:simpleType>
> - <xs:restriction base="xs:xxxx"> => Only when commission is not null
> and greater than 0
> <xs:TotalDigital value="7" />
> <xs:FractionDigital value ="2" />
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> ....
>
> Can you show me how to generate above output using SQLX function using
> "EMP" table ? I am sure it is easily possible but sorry I do not have
> this skill.
>
> Kindly suggest me urgently
>
> thanks & regards
> PJP
http://www.oracle.com/pls/db92/db92.drilldown?remark=&word=XMLQUERY&book=&preference=

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu
(replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Sun Jan 14 2007 - 13:05:12 CST

Original text of this message

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