Results 1 to 2 of 2

Thread: Generate XML using schema

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2002
    Posts
    69

    Question Generate XML using schema

    May I know how am I suppose to generate XML output based on a given schema? I have a schema with elements and attributes. The value of the attributes will be extracted from Oracle database.

    I have tried with my own code but not sure if it's valid

    **********************************************
    OpenDatabase
    'Open App.Path & "\output.xml" For Output As #F
    Set RawParaQry = New ADODB.Recordset

    'Get DIAMETER Rawdata
    RawParaQry.Open "Select Dia1, Dia2, Dia3, Dia4, Dia5, _ & "From DiaTb " _
    & "Where DiaTb.Ingot = '" & itemno & "' " _
    & "And RawMainTb.Shpinv = '" & invoiceno & "'", S_GateDb

    'Execute Query
    'Calculate N, Max, Min
    ParaN_Dia = 0
    ParaMax_Dia = Val(RawParaQry(0)) / 100
    ParaMin_Dia = Val(RawParaQry(0)) / 100
    'Calculations for ParaMin_Dia, ParaMax_Dia will be done here

    'Print #F, " <Diameter N="; "'" & Val(ParaN_Dia) & "'"; " MIN="; "'" & ParaMin_Dia & "'"; " MAX="; "'" & ParaMax_Dia & "'"; "/>"
    'Close #F

    ************************************************
    For Print #F statement, how can I display more than one element eg <Dia...../> and next line
    <Length....../> and so on


    Thanks in advance.

  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    The best thing to do is to use the Microsoft Document Object Model ("the DOM") to write the XML file. The latest version is msxml4 and you can download it from MS. You will be able to easily add nodes using the DOM that can be validated against the schema.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width