By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,455 Members | 2,306 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,455 IT Pros & Developers. It's quick & easy.

XML Nested List from Cascading Relations

P: n/a
CAM
Hi,

Does anyone know a simple way to create an .xml file containing a nested
list from a set of cascading relations.

In other words if I have tables for Catalogue, Section, Page, Product.

The output would be

Catalogue
Section
Page
Product
Product
Page
Product
Section
Page
Product
Catalogue

Thanks in anticipation

Craig
Nov 12 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
CAM wrote:
Hi,

Does anyone know a simple way to create an .xml file containing a nested
list from a set of cascading relations.

In other words if I have tables for Catalogue, Section, Page, Product.

The output would be

Catalogue
Section
Page
Product
Product
Page
Product
Section
Page
Product
Catalogue


In Access XP you can export a query in XML format. The result will be 4
files (.htm, .xml, .xsd, .xsl).

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 12 '05 #2

P: n/a
CAM wrote:
Hi,

Does anyone know a simple way to create an .xml file containing a nested
list from a set of cascading relations.

In other words if I have tables for Catalogue, Section, Page, Product.

The output would be

Catalogue
Section
Page
Product
Product
Page
Product
Section
Page
Product
Catalogue


In Access XP you can export a query in XML format. The result will be 4
files (.htm, .xml, .xsd, .xsl).

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

Nov 12 '05 #3

P: n/a
DFS
CAM,

You can write a few lines of VBA code to output the data in .xml format.

Set rs = db.openRecordset("SELECT Catalogue FROM Catalogues;")
do until rs.eof
xmlStr = xmlStr & "<Catalogue>" & rs("Catalogue") & "</Catalogue>" & vbcrlf

set rs1 = db.OpenRecordset("SELECT DISTINCT Section FROM Sections WHERE
Catalogue = " & rs("Catalogue") & ";")
do until rs1.eof
xmlStr = xmlStr & "<Section>" & rs("Section") & "</Section>" & vbcrlf

set rs2 = db.OpenRecordset("SELECT Page FROM Pages WHERE Catalogue = " &
rs("Catalogue") & " and Section = '" & rs1("Section") & "';")
do until rs2.eof
xmlStr = xmlStr & "<Page>" & rs2("Page") & "</Page>" & vbcrlf

etc.
etc.
etc


"CAM" <CA*@NOCONTACT.COM> wrote in message
news:40********@mk-nntp-2.news.uk.tiscali.com...
Hi,

Does anyone know a simple way to create an .xml file containing a nested
list from a set of cascading relations.

In other words if I have tables for Catalogue, Section, Page, Product.

The output would be

Catalogue
Section
Page
Product
Product
Page
Product
Section
Page
Product
Catalogue

Thanks in anticipation

Craig

Nov 12 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.