<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META content="MSHTML 5.00.2314.1000" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=203463615-22101999>But
also see the messages about Oracle's building of XML from the data set returned
from an SQL query...</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT color=#0000ff face=Arial size=2><SPAN class=203463615-22101999>
<DIV><B>From:</B> <A href="mailto:abisheks@india.hp.com"
title=abisheks@india.hp.com>Abhishek Srivastava</A> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I tried the Oracle's SQL - XML utility and it
does what i want. Except a few things.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I generated the following XML file as a result to
a query to my oracle database.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><ROWSET><BR> <ROW
num="1"><BR> <SPNAME>Huntington services
Company
</SPNAME><BR>
<CUSTPERMID>123456789123456
</CUSTPERMID><BR>
<CUSTLOGINID>jamesb
</CUSTLOGINID><BR>
<FIRSTNAME>james </FIRSTNAME><BR>
<LASTNAME>Bond </LASTNAME><BR> </ROW><BR> </ROW><BR></ROWSET></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The ROWSET and the ROW tags were introduced
by the builder itself. I would like the document to look like :</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><CUSTID></FONT></DIV>
<DIV><FONT face=Arial size=2><SPNAME>My Own Business Services
Company </SPNAME><BR>
<CUSTPERMID>123456789123456
</CUSTPERMID><BR>
<CUSTLOGINID>jamesb
</CUSTLOGINID><BR>
<FIRSTNAME>james
</FIRSTNAME><BR>
<LASTNAME>Bond
</LASTNAME><BR> </CUSTID><BR></FONT></DIV>
<DIV><FONT face=Arial size=2>This is very important because this xml file will
be sent to the client who will "validate" it. Since ROWSET and ROW are not a
part of standard message format we use... an exception will be
thrown.</FONT></DIV>
<DIV><FONT face=Arial size=2>Is there any way to customize the output from the
builder so that it conforms to a predefined DTD ?</FONT></DIV>
<DIV></SPAN></FONT><FONT face=Tahoma size=2>-----Original
Message-----<BR><B>From:</B> Goyal, Sanjeev
[mailto:Sanjeev.Goyal@usa.xerox.com]<BR><B>Sent:</B> Thursday, October 21,
1999 9:49 AM<BR><B>To:</B> 'Abhishek Srivastava'<BR><B>Cc:</B> xml dev mailing
list<BR><B>Subject:</B> RE: Is this Impossible
!!<BR><BR></DIV></BLOCKQUOTE></DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px"></FONT>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG>Abhishek<SPAN
class=310504413-21101999>,</SPAN></STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG><SPAN
class=310504413-21101999></SPAN></STRONG></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG><SPAN
class=310504413-21101999>Most of the XML Parser implementations provides
mechanism to generate well formed XML documents from the DOM Tree. I have used
sun's XML parser, it provides APIs to generate well-formed XML from your
Document Node.</SPAN></STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG><SPAN
class=310504413-21101999></SPAN></STRONG></FONT></FONT></FONT> </DIV>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG><SPAN
class=310504413-21101999>Hope it
helps.</SPAN></STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT size=2><FONT color=#0000ff><FONT face=Arial><STRONG><SPAN
class=310504413-21101999>Sanjeev</SPAN></STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT color=#0000ff><FONT face=Arial><SPAN
class=310504413-21101999></SPAN></FONT></FONT><FONT face=Tahoma><FONT
size=2><SPAN class=310504413-21101999><STRONG><FONT color=#0000ff
face="Comic Sans MS"> </FONT></STRONG></SPAN></FONT></FONT></DIV>
<DIV><FONT face=Tahoma><FONT size=2><SPAN
class=310504413-21101999> </SPAN>-----Original
Message-----<BR><B>From:</B> Abhishek Srivastava
[mailto:abisheks@india.hp.com]<BR><B>Sent:</B> Wednesday, October 20, 1999
1:29 AM<BR><B>To:</B> xml dev mailing list<BR><B>Subject:</B> Is this
Immpossible !!<BR><BR></DIV></FONT>
<BLOCKQUOTE
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px"></FONT>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>I have the following requirement. A client
wants to query a database. It sends out an SQL Query to the Database server.
At the server side, instead of returning a recordset, it returns an XML
File.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>The client on receiving the XML file, parsers
it for "Validity" (to be sure that all elements it had asked for are
there).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Problem is that at the server side, How to
build the xml document.</FONT></DIV>
<DIV><FONT face=Arial size=2>Presently, I am doing something like
this</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>String("<Name>") + rs.getField("auName")
+ String("</Name>")</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>However, this is a very inelegant approach as
the code is full of such string concatenations.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Is there a more elegant solution to this
? All the material on XML talks about parsing and reading XML. What
about writing them ? Are there DOM / SAX Api extensions available that would
</FONT></DIV>
<DIV><FONT face=Arial size=2>create "VALID" XML documents without clutter in
the code ?</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Any help would be greatly
appreciated.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Thanks & Best Regards,</FONT></DIV>
<DIV><FONT face=Arial size=2>Abhishek.</FONT></DIV>
<DIV><FONT face=Arial
size=2>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>
_/
Abhishek Srivastava<BR>
_/
Hewlett Packard ISO <BR>
_/_/_/ _/_/_/ -------------------
<BR> _/ / _/ _/
(Work) +91-80-2251554 x1190<BR>_/ _/
_/_/_/ (Ip)
15.10.47.37
<BR>
_/
(Url) <A
href="http://sites.netscape.net/abhishes/homepage">http://sites.netscape.net/abhishes/homepage</A>
<BR>
_/ You've
heard it all by now. Get wired or get whacked.
<BR>
You're networking or you're not working. Dot-com or die
<BR>
- SUN
MICROSYSTEMS <BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR></FONT></DIV></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>