XML Nested List from Cascading Relations

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • CAM

    XML Nested List from Cascading Relations

    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


  • MGFoster

    #2
    Re: XML Nested List from Cascading Relations

    CAM wrote:
    [color=blue]
    > 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[/color]

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

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

    Comment

    • DFS

      #3
      Re: XML Nested List from Cascading Relations

      CAM,

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

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

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

      set rs2 = db.OpenRecordse t("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" <CAM@NOCONTACT. COM> wrote in message
      news:4081774a_2 @mk-nntp-2.news.uk.tisca li.com...[color=blue]
      > 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
      >
      >[/color]


      Comment

      Working...