Please help, VB & XML

Results 1 to 4 of 4

Thread: Please help, VB & XML

  1. #1
    Join Date
    Dec 1969

    Default Please help, VB & XML

    Can anyone send me a simple vb & XML program, i&#039ve been reading all about xml, sick of it, and just need a simple vb prob that manipulates and xml file.

  2. #2
    Join Date
    Dec 1969

    Default RE: Please help, VB & XML

    &#060;XML&#062;<BR>&#060;APPLICATION VERSION="1"&#062;<BR>&#060;NAME&#062;Nestea&#060;/NAME&#062;<BR>&#060;FUNCTION&#062;Test&#060;/FUNCTION&#062;<BR>&#060;/APPLICATION&#062;<BR>&#060;/XML&#062;<BR><BR>&#060;%<BR> Dim objXMLDoc<BR> Set objXMLDoc = Server.CreateObject("MSXML2.DOMDocument")<BR> <BR> objXMLDoc.load("xml.xml")<BR> objXMLDoc.async = False<BR><BR> Call UpdateAppName("NewName")<BR> Call UpdateAppVersion("2.0")<BR><BR> Sub UpdateAppName(strName)<BR> objXMLDoc.documentElement.selectSingleNode("/XML/APPLICATION/NAME").text = strName<BR> End Sub<BR><BR> Sub UpdateAppVersion(strVersion)<BR> Dim objTemp<BR> Set objTemp = objXMLDoc.documentElement.selectSinglNode("/XML/APPLICATION")<BR> Set objTemp.setAttribute("VERSION") = strVersion<BR> Set objTemp = Nothing<BR> End Sub<BR><BR> Response.Write objXMLDoc.xml<BR> Set objXMLDoc = Nothing<BR>%&#062;<BR><BR>Hope this helps. If not try reading some articles about XML at,,, ect...<BR><BR>BTW I&#039m sure there is an error or TWO in the above script so please don&#039t reply about that stuff.<BR><BR>Good Luck,<BR>ß

  3. #3
    Matiur Rahman Guest

    Default RE: Please help, VB & XML

    I not sure what exactly you mean. Below is a VB sample code that <BR>generate HTML. Inputs are XML and XSL file paths.<BR><BR>Public Function ConvertToHTML(ByVal xmlFilePath As String, ByVal xslFilePath As String) As String<BR><BR> Dim objXML As MSXML2.DOMDocument<BR> Dim objXSL As MSXML2.DOMDocument<BR> <BR> Dim strPathXML As String<BR> Dim strPathXSL As String<BR> Dim strHTML As String<BR> <BR> On Error GoTo ErrorHandler<BR> <BR> Set objXML = New MSXML2.DOMDocument<BR> Set objXSL = New MSXML2.DOMDocument<BR> <BR> objXML.async = False<BR> objXML.Load (xmlFilePath)<BR> <BR> objXSL.async = False<BR> objXSL.Load (xslFilePath)<BR> <BR> strHTML = objXML.transformNode(objXSL)<BR> <BR> ConvertToHTML = strHTML<BR> <BR> Set objXML = Nothing<BR> Set objXSL = Nothing<BR> <BR> Exit Function<BR> <BR>ErrorHandler:<BR> Set objXML = Nothing<BR> Set objXSL = Nothing<BR> Err.Raise Err.Number, Err.Description, Err.Source<BR><BR><BR>End Function<BR>

  4. #4
    fliptscript Guest

    Default RE: Please help, VB & XML

    This is about as simple as it gets...<BR><BR><BR><BR>Check out too.<BR><BR>Good Luck,<BR><BR>Ben

Posting Permissions

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