Re: msxml DOM: no linefeed after creating a new node

Tech-Archive recommends: Speed Up your PC by fixing your registry



I will fix that Dim/Set line. Thanks.

On Aug 19, 6:49 pm, "Kevin Provance"
<Bill.McCarthy.Is.Stalking.TPASoft.com...@xxxxxxxxxxx> wrote:
1) Stop trolling .NxT in groups where it does not belong Bill, you know
better.  No one asked about .NxT.

2) Dim someobject As New ObjectName is bad practice.

The preferred practice is

Dim someobject as ObjectName

Set someobject = New ObjectName

'when you are done with the object, set it to nothing

Set someobject = Nothing.

--
2025
If you do not believe in time travel,
your beliefs are about to be tempered.

http://www.facebook.com/group.php?gid=43606237254"Bill McCarthy" <b...@xxxxxxxxxxxxx> wrote in message

news:%2399gd4LIKHA.4608@xxxxxxxxxxxxxxxxxxxxxxx
| Hi David,
|| "vbDavidC" <davidsusergro...@xxxxxxxxx> wrote in message

|news:c95b09d9-0b50-4ea8-a798-631fc476b232@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
| > Bill,
| >
| > After your post I set it to true and it did not add a <LF> or <CRLF>
| > to the line.
| >
| > However, I did notice something that was good.  When set to False
| > (default) what were originally spaces in front of the tags were
| > converted to what appears to tabs.  My Notepad++ shows either 1 or
| > more arrows in front I guess for indentation.  Since I am returning
| > these XML files to the originator I want to keep them as close to the
| > original format as possible so that was a good thing if nothing else
| > for that.
| >
| > Would you have any other suggestions.  I wish there were some property
| > that I could set that would allow this 'end of line' character(s) to
| > be added.
| >
| > Would it have anything to do with the encoding?
| >
| > <?xml version="1.0" encoding="ISO-8859-1"?>
|
| No I'd doubt that would make any difference. The problem is the XMLDOM
| writer doesn't indent properly for some reason.  In .NET this is a lot
| simpler, but if using the MSXML libraries then the best you can probably
do
| is to use a  MXXMLWriter and set the indent property to true.  For
example,
| tack this code onto your existing code:
|
|   Dim rdr As New SAXXMLReader30
|   Dim wrt As New MXXMLWriter30
|   wrt.indent = True
|   Set rdr.contentHandler = wrt
|   rdr.parse xmlDoc
|   wrt.flush
|   Debug.Print wrt.output
|
| The output will be pretty indented. Problem with this is you are double
| parsing.
|
|
|
|
|
|
|
|
|
|
|

.



Relevant Pages

  • Re: How To Rebuild Objects From Text Files?
    ...     SaveDataAccessPagesAsText ...     Dim DataAccessPage As AccessObject ... Dim ObjectName$ ... Open TempFullPath For Binary As #FileNumber ...
    (comp.databases.ms-access)
  • Re: msxml DOM: no linefeed after creating a new node
    ... Stop trolling .NxT in groups where it does not belong Bill, ... Dim someobject As New ObjectName is bad practice. ... | is to use a MXXMLWriter and set the indent property to true. ...
    (microsoft.public.vb.general.discussion)
  • Re: msxml DOM: no linefeed after creating a new node
    ... Dim xmlDoc As New MSXML2.DOMDocument30 ... Dim newNode As IXMLDOMNode ... Dim someobject As New ObjectName is bad practice. ... |   ...
    (microsoft.public.vb.general.discussion)