If I understand correctly, you want a single schema to transport data from
various tables.
>From the top of my head something like this:
<?xml version="1.0"?>
<rowset table="ORDERS">
<row>
<column name="DATE">6-24-04</column>
<column name="SHIPTOSTATE">GA</column>
</row>
</rowset>
So, the attributes of the rowset element determine the source/target
tablename. And the attributes of the column elements determine the names of
the fields. So the schema for this XML:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema elementFormDefault="qualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="column">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="name"
type="xs:string" use="required"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
<xs:element name="row">
<xs:complexType>
<xs:sequence>
<xs:element ref="column"
maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rowset">
<xs:complexType>
<xs:sequence>
<xs:element ref="row"/>
</xs:sequence>
<xs:attribute name="table" type="xs:string"
use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
Or the DTD:
<?xml version="1.0" encoding="UTF-8"?>
<!ELEMENT column (#PCDATA)>
<!ATTLIST column
name CDATA #REQUIRED
>
<!ELEMENT row (column+)>
<!ELEMENT rowset (row)>
<!ATTLIST rowset
table CDATA #REQUIRED
>
Should work for transporting data to/from any table.
Is this the kind of thing you're looking for??
This is kind of a neat idea. But there is a lot to be said for having an XML
schema defined for each table you want to work with. This allows the data to
be verified before attempting to write to a file. I.e. Ensure mandatory
fields are present. If there are only a few valid values a field can have...
Etc. etc.
SOAP is becoming a standard way of exchanging data..... But the data is
simply inserted into the SOAP body. The receiving SOAP client extracts the
body. 'Older' web apps simply receive XML documents via http, ftp, smtp etc.
etc.
As long as you have a valid DTD or schema for your XML documents - you are
standards compliant.
I do hope this helps in some way!
Mark.
-----Original Message-----
From: David Beahm [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 23, 2004 10:14 AM
To: [EMAIL PROTECTED]
Subject: Re: [U2] U2 & XML -- rowsets
OK, I give -- here's the question I posted in the forum:
I am making a PHP page that needs to write to and read from UniData. I
know how to create a web service that allows it to exchange data with UD
through UoJ. What I need is a standards-compliant format for sending
and receiving Recordsets/Rowsets. The most promising schema I have seen
is Microsoft's XML for Analysis Spec at
http://msdn.microsoft.com/library/en-us/dnxmlspec/html/xmlanalysis.asp.
It casts a very wide net by including data cube support along with
regular record sets, which does not sound like a bad idea.
Anyway, I want to use the most compatible format possible, and wondered
what other people are currently using. SOAP appears to be a good
starting place, and the schema listed above is the only one I have found
that isn't overly specific (ie, XMLBeans). I don't want to create
unique code to handle each type of record set, as that defeats the purpose.
Time is running out, and I am going to implement something shortly.
Thanks,
David Beahm
--
-----------------------------------------------------------------------
This email is confidential and intended solely for the use of the individual
to whom it is addressed. If you are not the intended recipient, be advised
that you have received this email in error and that any use, dissemination,
forwarding, printing, or copying of this email is strictly prohibited. If
you have received this email in error, please contact the sender.
-----------------------------------------------------------------------
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/