Building XML DOM in VB..


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Building XML DOM in VB..

  1. #1
    deccan deccan Guest

    Building XML DOM in VB..


    Hi All,

    We are currently evaluating the performance/efficiency difference between
    concatenating a string when looping through a recordset building the XML
    structure (inlcudes nodes, elements, attributes, etc.) and then loading the
    DOM versuses adding elements and attributes dynamically to the DOM as one
    loops through the recordset.

    Visual Basic 6.0 is the tool being used.

  2. #2
    MS Guest

    Re: Building XML DOM in VB..


    Strictly from a performance standpoint, string concatenation is much faster.
    Creating a DOMDocument and manipulating it incurs some overhead. I prefer
    using the DOM because I find my code is much easier to read and maintain.
    If you use the string concatentation method, go over to www.vb-zone.com
    and click on 'VB2TheMax 10 Hot Tips'. Tip #9 deals with speeding up string
    concatenation using the Mid$ function. Will help speed up string concatenation
    dramtically.

    "deccan deccan" <deccandeccan@rediffmail.com> wrote:
    >
    >Hi All,
    >
    > We are currently evaluating the performance/efficiency difference

    between
    >concatenating a string when looping through a recordset building the XML
    >structure (inlcudes nodes, elements, attributes, etc.) and then loading

    the
    >DOM versuses adding elements and attributes dynamically to the DOM as one
    >loops through the recordset.
    >
    >Visual Basic 6.0 is the tool being used.



  3. #3
    Brian Parkinson Guest

    Re: Building XML DOM in VB..


    If I read your question correctly you are attempting to create an XML string
    by using VB's string concatenation ie s = s & data.

    Please visit 'www.icemister.com' or 'www.freeVBCode.com' and download the
    free VB source code project CWXMLDemo. It includes a class for creating an
    XML formatted string using a stringbuilder type process which is 60 to 100
    times faster than using the standard VB string concatenation. Also suggest
    you read some of the articles by Francesco Balena (VB2TheMax.com) and other
    articles in Vsual Basic Programmers Journal Magazine on speeding up string
    manipulation in VB to speeds approaching or better than C++.

    "MS" <ms@ms.com> wrote:
    >
    >Strictly from a performance standpoint, string concatenation is much faster.
    > Creating a DOMDocument and manipulating it incurs some overhead. I prefer
    >using the DOM because I find my code is much easier to read and maintain.
    > If you use the string concatentation method, go over to www.vb-zone.com
    >and click on 'VB2TheMax 10 Hot Tips'. Tip #9 deals with speeding up string
    >concatenation using the Mid$ function. Will help speed up string concatenation
    >dramtically.
    >
    >"deccan deccan" <deccandeccan@rediffmail.com> wrote:
    >>
    >>Hi All,
    >>
    >> We are currently evaluating the performance/efficiency difference

    >between
    >>concatenating a string when looping through a recordset building the XML
    >>structure (inlcudes nodes, elements, attributes, etc.) and then loading

    >the
    >>DOM versuses adding elements and attributes dynamically to the DOM as one
    >>loops through the recordset.
    >>
    >>Visual Basic 6.0 is the tool being used.

    >



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center