Justin Law
03-31-2000, 09:08 AM
I write VB code for a living, but want to explore the XML world for an application
I am writing that can either go Internet or desktop. Anyway, my business
objects retrieve data from the database and pass the recordset to the client.
I have changed this so that now the BO passes a DOMDocument. The problem
I have is that when I save the recordset as a DOMDocument, It creates the
following. This file is not at all what I expect, and none of the books
I have purchased on XML talk about this. The problem appears to be that
I have a Schema on top of my XML, and also that the information is no longer
in proper nodes. What I mean is that all of the database information is
no longer set up like <FirstName>Justin</FirstName>. I really need a pointer
in the right direction. I just can't seem to find a good resource for this
stuff. I realize that I could just save the recordset to a file and that
creates proper XML, but I would prefer the ability to pass the object from
one BO to a client side class. Any help is appreciated.
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly">
- <s:AttributeType name="EmployeeID" rs:number="1" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"
/>
</s:AttributeType>
- <s:AttributeType name="FirstName" rs:number="2" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="LastName" rs:number="3" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Address1" rs:number="4" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Address2" rs:number="5" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="City" rs:number="6" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="State" rs:number="7" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Zip" rs:number="8" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Phone" rs:number="9" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Email" rs:number="10" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Code" rs:number="11" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"
/>
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
- <rs:data>
<z:row EmployeeID="1" FirstName="Justin" LastName="Law" Address1="3 Squire
Lane" Address2="c/o Amy Law" City="Clifton Park" State="NY" Zip="12065" Phone="5183737900"
Email="jlaw@iasystems.com" Code="5555" />
<z:row EmployeeID="2" FirstName="Amy" LastName="Law" Address1="3 Squire
Lane" City="Clifton Park" State="NY" Zip="12065" Phone="5183737900" Email="alaw@nycap.rr.com"
Code="1234" />
<z:row EmployeeID="3" FirstName="Greg" LastName="Henderson" Address1="7
Dennis Drive" City="Clifton Park" State="NY" Zip="12065" Phone="5183836170"
Email="greghen@us.ibm.com" Code="1111" />
<z:row EmployeeID="4" FirstName="Angela" LastName="Rice" Address1="10 Birch
Hill Rd." Address2="c/o Barbara Law" City="Ballston Lake" State="NY" Zip="12019"
Phone="5188777870" Email="blaw@global2000.net" Code="2222" />
<z:row EmployeeID="5" FirstName="Don" LastName="Baylor" Address1="10 Colorado
Way" City="Colorado Springs" State="CO" Zip="85261" Code="2440" />
</rs:data>
</xml>
I am writing that can either go Internet or desktop. Anyway, my business
objects retrieve data from the database and pass the recordset to the client.
I have changed this so that now the BO passes a DOMDocument. The problem
I have is that when I save the recordset as a DOMDocument, It creates the
following. This file is not at all what I expect, and none of the books
I have purchased on XML talk about this. The problem appears to be that
I have a Schema on top of my XML, and also that the information is no longer
in proper nodes. What I mean is that all of the database information is
no longer set up like <FirstName>Justin</FirstName>. I really need a pointer
in the right direction. I just can't seem to find a good resource for this
stuff. I realize that I could just save the recordset to a file and that
creates proper XML, but I would prefer the ability to pass the object from
one BO to a client side class. Any help is appreciated.
- <xml xmlns:s="uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882"
xmlns:rs="urn:schemas-microsoft-com:rowset" xmlns:z="#RowsetSchema">
- <s:Schema id="RowsetSchema">
- <s:ElementType name="row" content="eltOnly">
- <s:AttributeType name="EmployeeID" rs:number="1" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"
/>
</s:AttributeType>
- <s:AttributeType name="FirstName" rs:number="2" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="LastName" rs:number="3" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Address1" rs:number="4" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Address2" rs:number="5" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="City" rs:number="6" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="State" rs:number="7" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Zip" rs:number="8" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Phone" rs:number="9" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Email" rs:number="10" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="string" dt:maxLength="50" />
</s:AttributeType>
- <s:AttributeType name="Code" rs:number="11" rs:nullable="true" rs:writeunknown="true">
<s:datatype dt:type="int" dt:maxLength="4" rs:precision="10" rs:fixedlength="true"
/>
</s:AttributeType>
<s:extends type="rs:rowbase" />
</s:ElementType>
</s:Schema>
- <rs:data>
<z:row EmployeeID="1" FirstName="Justin" LastName="Law" Address1="3 Squire
Lane" Address2="c/o Amy Law" City="Clifton Park" State="NY" Zip="12065" Phone="5183737900"
Email="jlaw@iasystems.com" Code="5555" />
<z:row EmployeeID="2" FirstName="Amy" LastName="Law" Address1="3 Squire
Lane" City="Clifton Park" State="NY" Zip="12065" Phone="5183737900" Email="alaw@nycap.rr.com"
Code="1234" />
<z:row EmployeeID="3" FirstName="Greg" LastName="Henderson" Address1="7
Dennis Drive" City="Clifton Park" State="NY" Zip="12065" Phone="5183836170"
Email="greghen@us.ibm.com" Code="1111" />
<z:row EmployeeID="4" FirstName="Angela" LastName="Rice" Address1="10 Birch
Hill Rd." Address2="c/o Barbara Law" City="Ballston Lake" State="NY" Zip="12019"
Phone="5188777870" Email="blaw@global2000.net" Code="2222" />
<z:row EmployeeID="5" FirstName="Don" LastName="Baylor" Address1="10 Colorado
Way" City="Colorado Springs" State="CO" Zip="85261" Code="2440" />
</rs:data>
</xml>