Re: msxml DOM: no linefeed after creating a new node
- From: vbDavidC <davidsusergroups@xxxxxxxxx>
- Date: Wed, 19 Aug 2009 10:14:57 -0700 (PDT)
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.
|
|
|
|
|
|
|
|
|
|
|
.
- References:
- msxml DOM: no linefeed after creating a new node
- From: vbDavidC
- Re: msxml DOM: no linefeed after creating a new node
- From: Bill McCarthy
- Re: msxml DOM: no linefeed after creating a new node
- From: vbDavidC
- Re: msxml DOM: no linefeed after creating a new node
- From: Bill McCarthy
- Re: msxml DOM: no linefeed after creating a new node
- From: Kevin Provance
- msxml DOM: no linefeed after creating a new node
- Prev by Date: Re: msxml DOM: no linefeed after creating a new node
- Next by Date: RE: WebDisplay.DocumentComplete in Vista
- Previous by thread: Re: msxml DOM: no linefeed after creating a new node
- Next by thread: Overcoming listbox text limit with sendmessage
- Index(es):
Relevant Pages
|