Results 1 to 5 of 5

Thread: how to display xml file

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    how to display xml file

    I am new to vb.net and to using xml. I have been able to use an xml/xsl. I have created the xmldoc and applied a style sheet to it. . This is the last line where the transform has happened to my document.

    xslTran.Transform(xmlDoc, Nothing, writer, Nothing)

    How do I display this on the window?

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Write the contents of the XmlDoc out... either using console.writeline or a multiline textbox...

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    Write to a window

    How does it get written to the window? Does console mean the window?

  4. #4
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    I don't know buddy.... you have to tell me what you want to write to...

    1) Console window for a Console Application

    or

    2) A multi-line textbox in a Windows Forms Application (if you have a Form object in your project, you want this one)


    after you do the transform, use an XmlReader to spit out the XML to the textbox...

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2004
    Posts
    4

    Getting there

    On some days it feels like I am standing still... but I am learning...

    I finally have all of my code working, and am able to display the transformed xslt in HTML form in the text window. Just don't have my data in it yet. I thought the transform would take the loaded xslt and merge it with the xmldoc. My code looks like this:


    Dim ds As New DataSet("Assessment")
    Dim sqladp As New SqlClient.SqlDataAdapter("SELECT idAssessment, strDemPatLstNm, StrDemPatFstNm,IntDemPatAge FROM tblDemographics WHERE idAssessment='" & m_subject.Assessment() & "'", objRefs.Conn)
    sqladp.Fill(ds, "Assessment")
    ' Loading Data Set into xmlDoc
    Dim xmlDoc As Xml.XmlDataDocument = New Xml.XmlDataDocument(ds)

    '1 Creating a obj to use to transform
    Dim xslTran As Xml.Xsl.XslTransform = New Xml.Xsl.XslTransform

    'Load style sheet into xslTran sheet sits in bin directory
    xslTran.Load("Quick_View.xslt")

    'Create file to hold Transformed data
    Dim writer2 As Xml.XmlTextWriter = New Xml.XmlTextWriter(Application.LocalUserAppDataPath & "xslt_output.html", System.Text.Encoding.UTF8)
    ---------------------------------------------------
    ' Load file with xml data from xmldoc
    xslTran.Transform(xmlDoc, Nothing, writer2, Nothing)
    ----------------------------------------------------


    writer2.Close()

    Me.AxWebBrowser1.Navigate(Application.LocalUserAppDataPath & "xslt_output.html")

    Any any ideas?

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