Results 1 to 2 of 2

Thread: How do I create a XSL file for this XML file?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80

    Smile How do I create a XSL file for this XML file?

    Hi,

    I'm a new bee in using XML and XSL. I've found some tutorials about XML and XLS. I get a good idea about the simple structures.

    But...

    I've found a piece of code that converts a ADODB recordset into a XML file. This file doesn't look like the standard XML from the tutorials.

    How do I create a XSL file, for this file?

    XML:

    <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" rs:updatable="true">
    <s:AttributeType name="ID" rs:number="1" rs:write="true">
    <s:datatype dt:type="i8" dt:maxLength="8" rsrecision="0" rs:fixedlength="true" rs:maybenull="false"/>
    </s:AttributeType>
    <s:AttributeType name="Tag" rs:number="2" rs:write="true">
    <s:datatype dt:type="string" dt:maxLength="4294967295" rsrecision="0" rs:long="true" rs:maybenull="false"/>
    </s:AttributeType>
    <s:extends type="rs:rowbase"/>
    </s:ElementType>
    </s:Schema>
    <rs:data>
    <rs:insert>
    <z:row ID="2" Tag="B"/>
    <z:row ID="3" Tag="C"/>
    </rs:insert>
    </rs:data>
    </xml>


    Visual Basic:

    Dim mrsRecordset1 As ADODB.Recordset

    Sub CreateRecordset()
    Set mrsRecordset1 = New ADODB.Recordset
    mrsRecordset1.Fields.Append "ID", adBigInt
    mrsRecordset1.Fields.Append "Tag", adBSTR
    mrsRecordset1.Open
    mrsRecordset1.AddNew
    mrsRecordset1.Fields("ID").Value = 2
    mrsRecordset1.Fields("Tag").Value = "B"
    mrsRecordset1.Update
    mrsRecordset1.AddNew
    mrsRecordset1.Fields("ID").Value = 3
    mrsRecordset1.Fields("Tag").Value = "C"
    mrsRecordset1.Update
    End Sub

    Sub Create()
    Dim objXMLDOM As New MSXML2.DOMDocument
    Set objXMLDOM = CreateXMLFromRecordset(mrsRecordset1)
    objXMLDOM.Save "c:\temp\test.xml"
    End Sub

    Public Function CreateXMLFromRecordset(objRS As ADODB.Recordset) As MSXML2.DOMDocument
    Dim objDOM As MSXML2.DOMDocument
    Set objDOM = New MSXML2.DOMDocument

    objRS.Save objDOM, adPersistXML
    Set CreateXMLFromRecordset = objDOM

    Set objDOM = Nothing
    End Function

    Can anyone help me to create a XLS file for this XML file?

    Fedor


    using VB6, starting to learn XML & XSL.

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jun 2000
    Posts
    80
    Without the smilies: rs:precision

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