Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to generate XML customized output in oracle 9.2 ?
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.orgReceived on Sun Jan 14 2007 - 13:05:12 CST
![]() |
![]() |