XML Data Application

G

Guest

I am planning a application that will output a report to a XML Schema. I have
planned the schema out and have a db architecture planned to maintain the
data for the whole app. What I can not seem to see is how do I output the
data from my app to my schema?

This is my scenario;
I have an app, it retrieves from the UserCurrent Key the CompanyName etc
info to go into the header of the xml. I then retrieve from the application a
list of objects that have 8 columns per row, and this section of code repeats
for however many objects there are.

What I can not seem to workout is how do I place the info in the xml file in
the right keys..

All help is greatly appreciated!
 
S

Steven Cheng[MSFT]

Hi Dewright_ca,

Welcome to MSDN newsgroup.
From your description, you have some data objects which is retrieved from
some certain backend data storage, and then you'd like to store them into a
certain XML file in the proper location according to a certain key value,
yes?

Based on my understanding, the main problem is the structure of the xml
file of your XML Schema and how should we tranform those data objects(8
columns per row) into xml elments and store into your XML file. Would you
provide some further description on the XmlSchema or the XML file 's
struture? Generally, for transforming the object instances into Xml
document we can consider using XmlSerialization or manually construcing
XML Document through the System.Xml namepsaces's classes.

Please feel free to post here if you have any further concerns.

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)







--------------------
| Thread-Topic: XML Data Application
| thread-index: AcXOmuOgOqe2jMXzTN6yNruy1VfQrg==
| X-WBNR-Posting-Host: 67.107.204.99
| From: "=?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?="
<[email protected]>
| Subject: XML Data Application
| Date: Tue, 11 Oct 2005 12:35:08 -0700
| Lines: 17
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework:101455
| X-Tomcat-NG: microsoft.public.dotnet.framework
|
| I am planning a application that will output a report to a XML Schema. I
have
| planned the schema out and have a db architecture planned to maintain the
| data for the whole app. What I can not seem to see is how do I output the
| data from my app to my schema?
|
| This is my scenario;
| I have an app, it retrieves from the UserCurrent Key the CompanyName etc
| info to go into the header of the xml. I then retrieve from the
application a
| list of objects that have 8 columns per row, and this section of code
repeats
| for however many objects there are.
|
| What I can not seem to workout is how do I place the info in the xml file
in
| the right keys..
|
| All help is greatly appreciated!
| --
| D @ premierdata
|
 
G

Guest

Right now I am kind of looking through the flow of the System.XML classes,
can you tell me in laymans terms about XMLSerialization?

Overall, my structure is something like this;
<Building bname="OfficeX">
<Office name="User1">
<Desk>mydesk-serial</>
<Chair>mychair-serial</>
<Table>mytable-serial</>
<Table-Chair1>tchair1-serial</>
<Table-Chair2>tchair2-serial</>
<Computer-CPU>CPU-serial</>
<Computer-CRT>CRT-serial</>
</Office>
</Building>

So as you can see, my table has many offices for many buildings, and I need
to export to a XML file to send to another group the contents of these
buildings offices.

Would serialization work best, or just a iterative loop through using
System.XML write process's. This app needs to have some longevity, so
whatever would be most scalable to Net2.0 would suit me great!

Thanks Steven!
 
G

Guest

Steven,
I got my function to work using the System.XML classes but still would like
to have a more big picture understanding of the XMLSerialization methods, can
you point me to any specific documentation?
 
S

Steven Cheng[MSFT]

Hi Dewright_ca,

As for Xml Serialization, it's one of the object persistence means in .NET
framework. .net provide the XmlSerializer which can help convert in memory
object instances into XML content. For example, in your scenario, you can
define some classes like:

public class BuildingGroup
{
public Building[] Buildings;
......
}

public class Building
{
public Office[] Offices;
.....
}

public class Office
{
....
}

Then, at runtime, we can programmatically construct many such class
instances and then use XmlSerializer to serialize them into XML Stream
(through a memory stream or directory flush to file stream, network
stream...)

For detailed description on XML Serialization in .NET, you can refer to the
following MSDN tutorial:

#XML and SOAP Serialization
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconserialization.asp?
frame=true

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)



--------------------
| Thread-Topic: XML Data Application
| thread-index: AcXPOtO3I0ayO0oFRlKP+AcwAZHjmQ==
| X-WBNR-Posting-Host: 67.107.204.99
| From: "=?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?="
<[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: RE: XML Data Application
| Date: Wed, 12 Oct 2005 07:40:01 -0700
| Lines: 112
| Message-ID: <[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.public.dotnet.framework
| NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework:101500
| X-Tomcat-NG: microsoft.public.dotnet.framework
|
| Right now I am kind of looking through the flow of the System.XML
classes,
| can you tell me in laymans terms about XMLSerialization?
|
| Overall, my structure is something like this;
| <Building bname="OfficeX">
| <Office name="User1">
| <Desk>mydesk-serial</>
| <Chair>mychair-serial</>
| <Table>mytable-serial</>
| <Table-Chair1>tchair1-serial</>
| <Table-Chair2>tchair2-serial</>
| <Computer-CPU>CPU-serial</>
| <Computer-CRT>CRT-serial</>
| </Office>
| </Building>
|
| So as you can see, my table has many offices for many buildings, and I
need
| to export to a XML file to send to another group the contents of these
| buildings offices.
|
| Would serialization work best, or just a iterative loop through using
| System.XML write process's. This app needs to have some longevity, so
| whatever would be most scalable to Net2.0 would suit me great!
|
| Thanks Steven!
|
| --
| D @ premierdata
|
|
| "Steven Cheng[MSFT]" wrote:
|
| > Hi Dewright_ca,
| >
| > Welcome to MSDN newsgroup.
| > From your description, you have some data objects which is retrieved
from
| > some certain backend data storage, and then you'd like to store them
into a
| > certain XML file in the proper location according to a certain key
value,
| > yes?
| >
| > Based on my understanding, the main problem is the structure of the xml
| > file of your XML Schema and how should we tranform those data objects(8
| > columns per row) into xml elments and store into your XML file. Would
you
| > provide some further description on the XmlSchema or the XML file 's
| > struture? Generally, for transforming the object instances into Xml
| > document we can consider using XmlSerialization or manually
construcing
| > XML Document through the System.Xml namepsaces's classes.
| >
| > Please feel free to post here if you have any further concerns.
| >
| > Steven Cheng
| > Microsoft Online Support
| >
| > Get Secure! www.microsoft.com/security
| > (This posting is provided "AS IS", with no warranties, and confers no
| > rights.)
| >
| >
| >
| >
| >
| >
| >
| > --------------------
| > | Thread-Topic: XML Data Application
| > | thread-index: AcXOmuOgOqe2jMXzTN6yNruy1VfQrg==
| > | X-WBNR-Posting-Host: 67.107.204.99
| > | From: "=?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?="
| > <[email protected]>
| > | Subject: XML Data Application
| > | Date: Tue, 11 Oct 2005 12:35:08 -0700
| > | Lines: 17
| > | Message-ID: <[email protected]>
| > | MIME-Version: 1.0
| > | Content-Type: text/plain;
| > | charset="Utf-8"
| > | Content-Transfer-Encoding: 7bit
| > | X-Newsreader: Microsoft CDO for Windows 2000
| > | Content-Class: urn:content-classes:message
| > | Importance: normal
| > | Priority: normal
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| > | Newsgroups: microsoft.public.dotnet.framework
| > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework:101455
| > | X-Tomcat-NG: microsoft.public.dotnet.framework
| > |
| > | I am planning a application that will output a report to a XML
Schema. I
| > have
| > | planned the schema out and have a db architecture planned to maintain
the
| > | data for the whole app. What I can not seem to see is how do I output
the
| > | data from my app to my schema?
| > |
| > | This is my scenario;
| > | I have an app, it retrieves from the UserCurrent Key the CompanyName
etc
| > | info to go into the header of the xml. I then retrieve from the
| > application a
| > | list of objects that have 8 columns per row, and this section of code
| > repeats
| > | for however many objects there are.
| > |
| > | What I can not seem to workout is how do I place the info in the xml
file
| > in
| > | the right keys..
| > |
| > | All help is greatly appreciated!
| > | --
| > | D @ premierdata
| > |
| >
| >
|
 
S

Steven Cheng[MSFT]

Hi Dewright_ca,

Have you got any further progress on this issue or does my previous reply
helps a little? If there're anything else we can help, please feel free to
post here. Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| X-Tomcat-ID: 116430468
| References: <[email protected]>
<[email protected]>
<[email protected]>
| MIME-Version: 1.0
| Content-Type: text/plain
| Content-Transfer-Encoding: 7bit
| From: (e-mail address removed) (Steven Cheng[MSFT])
| Organization: Microsoft
| Date: Thu, 13 Oct 2005 07:04:56 GMT
| Subject: RE: XML Data Application
| X-Tomcat-NG: microsoft.public.dotnet.framework
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework
| Lines: 158
| Path: TK2MSFTNGXA01.phx.gbl
| Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.dotnet.framework:34236
| NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122
|
| Hi Dewright_ca,
|
| As for Xml Serialization, it's one of the object persistence means in
..NET
| framework. .net provide the XmlSerializer which can help convert in
memory
| object instances into XML content. For example, in your scenario, you can
| define some classes like:
|
| public class BuildingGroup
| {
| public Building[] Buildings;
| .....
| }
|
| public class Building
| {
| public Office[] Offices;
| ....
| }
|
| public class Office
| {
| ...
| }
|
| Then, at runtime, we can programmatically construct many such class
| instances and then use XmlSerializer to serialize them into XML Stream
| (through a memory stream or directory flush to file stream, network
| stream...)
|
| For detailed description on XML Serialization in .NET, you can refer to
the
| following MSDN tutorial:
|
| #XML and SOAP Serialization
|
http://msdn.microsoft.com/library/en-us/cpguide/html/cpconserialization.asp?
| frame=true
|
| Thanks,
|
| Steven Cheng
| Microsoft Online Support
|
| Get Secure! www.microsoft.com/security
| (This posting is provided "AS IS", with no warranties, and confers no
| rights.)
|
|
|
| --------------------
| | Thread-Topic: XML Data Application
| | thread-index: AcXPOtO3I0ayO0oFRlKP+AcwAZHjmQ==
| | X-WBNR-Posting-Host: 67.107.204.99
| | From: "=?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?="
| <[email protected]>
| | References: <[email protected]>
| <[email protected]>
| | Subject: RE: XML Data Application
| | Date: Wed, 12 Oct 2005 07:40:01 -0700
| | Lines: 112
| | Message-ID: <[email protected]>
| | MIME-Version: 1.0
| | Content-Type: text/plain;
| | charset="Utf-8"
| | Content-Transfer-Encoding: 7bit
| | X-Newsreader: Microsoft CDO for Windows 2000
| | Content-Class: urn:content-classes:message
| | Importance: normal
| | Priority: normal
| | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | Newsgroups: microsoft.public.dotnet.framework
| | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework:101500
| | X-Tomcat-NG: microsoft.public.dotnet.framework
| |
| | Right now I am kind of looking through the flow of the System.XML
| classes,
| | can you tell me in laymans terms about XMLSerialization?
| |
| | Overall, my structure is something like this;
| | <Building bname="OfficeX">
| | <Office name="User1">
| | <Desk>mydesk-serial</>
| | <Chair>mychair-serial</>
| | <Table>mytable-serial</>
| | <Table-Chair1>tchair1-serial</>
| | <Table-Chair2>tchair2-serial</>
| | <Computer-CPU>CPU-serial</>
| | <Computer-CRT>CRT-serial</>
| | </Office>
| | </Building>
| |
| | So as you can see, my table has many offices for many buildings, and I
| need
| | to export to a XML file to send to another group the contents of these
| | buildings offices.
| |
| | Would serialization work best, or just a iterative loop through using
| | System.XML write process's. This app needs to have some longevity, so
| | whatever would be most scalable to Net2.0 would suit me great!
| |
| | Thanks Steven!
| |
| | --
| | D @ premierdata
| |
| |
| | "Steven Cheng[MSFT]" wrote:
| |
| | > Hi Dewright_ca,
| | >
| | > Welcome to MSDN newsgroup.
| | > From your description, you have some data objects which is retrieved
| from
| | > some certain backend data storage, and then you'd like to store them
| into a
| | > certain XML file in the proper location according to a certain key
| value,
| | > yes?
| | >
| | > Based on my understanding, the main problem is the structure of the
xml
| | > file of your XML Schema and how should we tranform those data
objects(8
| | > columns per row) into xml elments and store into your XML file.
Would
| you
| | > provide some further description on the XmlSchema or the XML file 's
| | > struture? Generally, for transforming the object instances into Xml
| | > document we can consider using XmlSerialization or manually
| construcing
| | > XML Document through the System.Xml namepsaces's classes.
| | >
| | > Please feel free to post here if you have any further concerns.
| | >
| | > Steven Cheng
| | > Microsoft Online Support
| | >
| | > Get Secure! www.microsoft.com/security
| | > (This posting is provided "AS IS", with no warranties, and confers no
| | > rights.)
| | >
| | >
| | >
| | >
| | >
| | >
| | >
| | > --------------------
| | > | Thread-Topic: XML Data Application
| | > | thread-index: AcXOmuOgOqe2jMXzTN6yNruy1VfQrg==
| | > | X-WBNR-Posting-Host: 67.107.204.99
| | > | From: "=?Utf-8?B?REVXcmlnaHRfQ0FAb25saW5lLm5vc3BhbQ==?="
| | > <[email protected]>
| | > | Subject: XML Data Application
| | > | Date: Tue, 11 Oct 2005 12:35:08 -0700
| | > | Lines: 17
| | > | Message-ID: <[email protected]>
| | > | MIME-Version: 1.0
| | > | Content-Type: text/plain;
| | > | charset="Utf-8"
| | > | Content-Transfer-Encoding: 7bit
| | > | X-Newsreader: Microsoft CDO for Windows 2000
| | > | Content-Class: urn:content-classes:message
| | > | Importance: normal
| | > | Priority: normal
| | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| | > | Newsgroups: microsoft.public.dotnet.framework
| | > | NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
| | > | Path: TK2MSFTNGXA02.phx.gbl!TK2MSFTNGXA03.phx.gbl
| | > | Xref: TK2MSFTNGXA02.phx.gbl microsoft.public.dotnet.framework:101455
| | > | X-Tomcat-NG: microsoft.public.dotnet.framework
| | > |
| | > | I am planning a application that will output a report to a XML
| Schema. I
| | > have
| | > | planned the schema out and have a db architecture planned to
maintain
| the
| | > | data for the whole app. What I can not seem to see is how do I
output
| the
| | > | data from my app to my schema?
| | > |
| | > | This is my scenario;
| | > | I have an app, it retrieves from the UserCurrent Key the
CompanyName
| etc
| | > | info to go into the header of the xml. I then retrieve from the
| | > application a
| | > | list of objects that have 8 columns per row, and this section of
code
| | > repeats
| | > | for however many objects there are.
| | > |
| | > | What I can not seem to workout is how do I place the info in the
xml
| file
| | > in
| | > | the right keys..
| | > |
| | > | All help is greatly appreciated!
| | > | --
| | > | D @ premierdata
| | > |
| | >
| | >
| |
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top