dbTalk Databases Forums  

ExportXML

comp.databases.ms-access comp.databases.ms-access


Discuss ExportXML in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
eidosabi
 
Posts: n/a

Default ExportXML - 02-29-2008 , 09:14 AM






This is a repost from a couple of days ago. I didn't get any
responses, and am really hitting my head on the wall with this. Even
knowing that it is a complete impossibility would be welcome news, if
only so I can stop hitting my head. :-)

I've got an Access 2003 db that has many different relationships
between
tables, for example, books <-> book_author <-> authors <->
author_institution <-> institutions. If I do an export xml from the
toolbar, there is an option to choose which data to export, for
example:

- $B""(B books
--- $B""(B book_author
----- [Lookup Data]
------- $B""(B authors
--------- $B""(B author_institution
----------- [Lookup Data]
------------- $B""(B institutions

Regardless of whether I export this way or via ExportXML in a VB
module, I get all the data, but I loose the node structure at certain
points. After trying everything I could think of, or find on the web,
I went back and examined the manual/toolbar option and noticed that
the relationships that fail to be maintained during the automated
process have a "[Lookup Data]" node between the parent and child node
(in the example above, between the book_author and author tables). So
I end up with something like:

<books>
<book_id>1</book_id>
<title>Run Rhonda Run</title>
<book_author>
<book_id>1</book_id>
<author_id>1</author_id>
</book_author>
<book_author>
<book_id>1</book_id>
<author_id>2</author_id>
</book_author>
</books>
<books>...more books...</books>
<authors>
<author_id>1</author_id>
<name>Rhonda Roads</name>
<author_instutute>
<author_id>1</author_id>
<institution_id>1</institution_id>
</author_institution>
</authors>
<authors>
<author_id>2</author_id>
<name>Robby Roads</name>
<author_instutute>
<author_id>1</author_id>
<institution_id>1</institution_id>
</author_institution>
</authors>
<authors>...more authors...</authors>
<instututions>
<institution_id>1</institution>
<name>Lincoln Elementary</name>
</institutions>
<institutions>...more institutions...</institutions>

I tried mucking around with relationships, but I'm always give the
same export options, regardless of table relationship definitions.

Does anybody have any suggestions on how to maintain the parent-child-
grandchildren-greatgrandchildren...
node relationships all the way down a tree during an xml export?

Thanks in advance!

-d

Reply With Quote
  #2  
Old   
lyle
 
Posts: n/a

Default Re: ExportXML - 02-29-2008 , 10:04 AM






On Feb 29, 10:14 am, eidosabi <eidos... (AT) gmail (DOT) com> wrote:
Quote:
This is a repost from a couple of days ago. I didn't get any
responses, and am really hitting my head on the wall with this. Even
knowing that it is a complete impossibility would be welcome news, if
only so I can stop hitting my head. :-)

I've got an Access 2003 db that has many different relationships
between
tables, for example, books <-> book_author <-> authors <-
author_institution <-> institutions. If I do an export xml from the
toolbar, there is an option to choose which data to export, for
example:

- $B""(B books
--- $B""(B book_author
----- [Lookup Data]
------- $B""(B authors
--------- $B""(B author_institution
----------- [Lookup Data]
------------- $B""(B institutions

Regardless of whether I export this way or via ExportXML in a VB
module, I get all the data, but I loose the node structure at certain
points. After trying everything I could think of, or find on the web,
I went back and examined the manual/toolbar option and noticed that
the relationships that fail to be maintained during the automated
process have a "[Lookup Data]" node between the parent and child node
(in the example above, between the book_author and author tables). So
I end up with something like:

books
book_id>1</book_id
title>Run Rhonda Run</title
book_author
book_id>1</book_id
author_id>1</author_id
/book_author
book_author
book_id>1</book_id
author_id>2</author_id
/book_author
/books
books>...more books...</books
authors
author_id>1</author_id
name>Rhonda Roads</name
author_instutute
author_id>1</author_id
institution_id>1</institution_id
/author_institution
/authors
authors
author_id>2</author_id
name>Robby Roads</name
author_instutute
author_id>1</author_id
institution_id>1</institution_id
/author_institution
/authors
authors>...more authors...</authors
instututions
institution_id>1</institution
name>Lincoln Elementary</name
/institutions
institutions>...more institutions...</institutions

I tried mucking around with relationships, but I'm always give the
same export options, regardless of table relationship definitions.

Does anybody have any suggestions on how to maintain the parent-child-
grandchildren-greatgrandchildren...
node relationships all the way down a tree during an xml export?

Thanks in advance!

-d
This is relatively easy to achieve, (but not using the methods you
descirbe) but is it what you want? It's Northinds 2007's Employees
Table.

BTW: I'm sure Nancy said, "Just say No to LookUp Tables!"

---------------

<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='ID' rs:number='1' rs:maydefer='true'
rs:writeunknown='true'>
<s:datatype dt:type='int' dt:maxLength='4' rsrecision='10'
rs:fixedlength='true'/>
</s:AttributeType>
<s:AttributeType name='Company' rs:number='2' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c2' rs:name='Last Name' rs:number='3'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c3' rs:name='First Name' rs:number='4'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c4' rs:name='E-mail Address' rs:number='5'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c5' rs:name='Job Title' rs:number='6'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c6' rs:name='Business Phone' rs:number='7'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c7' rs:name='Home Phone' rs:number='8'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c8' rs:name='Mobile Phone' rs:number='9'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='c9' rs:name='Fax Number' rs:number='10'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='25'/>
</s:AttributeType>
<s:AttributeType name='Address' rs:number='11' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='City' rs:number='12' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c12' rs:name='State/Province' rs:number='13'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c13' rs:name='ZIP/Postal Code' rs:number='14'
rs:nullable='true' rs:maydefer='true'
rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='15'/>
</s:AttributeType>
<s:AttributeType name='c14' rs:name='Country/Region' rs:number='15'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='50'/>
</s:AttributeType>
<s:AttributeType name='c15' rs:name='Web Page' rs:number='16'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='Notes' rs:number='17' rs:nullable='true'
rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:AttributeType name='Attachments' rs:number='18'
rs:nullable='true' rs:maydefer='true' rs:writeunknown='true'>
<s:datatype dt:type='string' dt:maxLength='536870910'
rs:long='true'/>
</s:AttributeType>
<s:extends type='rs:rowbase'/>
</s:ElementType>
</s:Schema>
<rs:data>
<z:row ID='1' Company='Northwind Traders' c2='Freehafer' c3='Nancy'
c4='nancy (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 1st Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='#http://northwindtraders.com#' Attachments=''/>
<z:row ID='2' Company='Northwind Traders' c2='Cencini' c3='Andrew'
c4='andrew (AT) northwindtraders (DOT) com' c5='Vice President, Sales'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 2nd Avenue' City='Bellevue' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Joined the company as a sales
representative, was promoted to sales manager and was then named vice
president of sales.'
Attachments=''/>
<z:row ID='3' Company='Northwind Traders' c2='Kotas' c3='Jan'
c4='jan (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 3rd Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Was hired as a sales associate and was
promoted to sales representative.'
Attachments=''/>
<z:row ID='4' Company='Northwind Traders' c2='Sergienko' c3='Mariya'
c4='mariya (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 4th Avenue' City='Kirkland' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Attachments=''/>
<z:row ID='5' Company='Northwind Traders' c2='Thorpe' c3='Steven'
c4='steven (AT) northwindtraders (DOT) com' c5='Sales Manager'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 5th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Joined the company as a sales
representative and was promoted to sales manager. Fluent in French.'
Attachments=''/>
<z:row ID='6' Company='Northwind Traders' c2='Neipper' c3='Michael'
c4='michael (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 6th Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Fluent in Japanese and can read and
write French, Portuguese, and Spanish.'
Attachments=''/>
<z:row ID='7' Company='Northwind Traders' c2='Zare' c3='Robert'
c4='robert (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 7th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Attachments=''/>
<z:row ID='8' Company='Northwind Traders' c2='Giussani' c3='Laura'
c4='laura (AT) northwindtraders (DOT) com' c5='Sales Coordinator'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 8th Avenue' City='Redmond' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Reads and writes French.'
Attachments=''/>
<z:row ID='9' Company='Northwind Traders' c2='Hellung-Larsen'
c3='Anne' c4='anne (AT) northwindtraders (DOT) com' c5='Sales Representative'
c6='(123)555-0100' c7='(123)555-0102' c9='(123)555-0103'
Address='123 9th Avenue' City='Seattle' c12='WA' c13='99999'
c14='USA' c15='http://northwindtraders.com#http://
northwindtraders.com/#' Notes='Fluent in French and German.'
Attachments=''/>
</rs:data>
</xml>


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.