Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

single line XML file
I'm at a loss of how to put in LFs in an XML file.

A brief example:

dim objXML, pi, root, zones

set objXML = CreateObject("MSXML2.DOMDocument.4.0")
objXML.async = false

set pi = objXML.createProcessingInstruction("xml", "version='1.0'
encoding='ISO-8859-1'")
objXML.insertBefore pi, objXML.firstChild

set root = objXML.createElement("freight")
objXML.appendChild(root)

set zones = objXML.createNode(1, "zones", "")
root.appendChild(zones)
.
.
.

When the file is written I get this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<freight><zones><...></zones><zones><...></zones>...</freight>

My goal is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<freight>
<zones>
<...>
</zones>
<zones>
<...>
</zones>
.
.
.
</freight>

When I open a raw XML file into IE, it takes forever, and sometimes crashes
trying to read the file.  I'm not sure if it is due to the extremely long
line it is trying to parse.  I can open an XML file in Wordpad quick enough
but the long line still exists and it will not display the end of the line
unless I manually add line feeds.  Notepad will not show it either.



Report this thread to moderator Post Follow-up to this message
Old Post
Roland Hall
12-28-04 08:55 AM


Re: single line XML file
If you want to control the format of the raw xml you will probably have to
build it as a string and embed the CrLf characters where you want them (and
tabs too if you really want it readable).

Or you can run it through an XSL conversion the way that IE does when you
open an XML file. Not sure of the XSL code to do that though.

--
--Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com


"Roland Hall" <nobody@nowhere> wrote in message
news:e33u4WI7EHA.2156@TK2MSFTNGP10.phx.gbl...
> I'm at a loss of how to put in LFs in an XML file.
>
> A brief example:
>
> dim objXML, pi, root, zones
>
> set objXML = CreateObject("MSXML2.DOMDocument.4.0")
> objXML.async = false
>
> set pi = objXML.createProcessingInstruction("xml", "version='1.0'
> encoding='ISO-8859-1'")
> objXML.insertBefore pi, objXML.firstChild
>
> set root = objXML.createElement("freight")
> objXML.appendChild(root)
>
> set zones = objXML.createNode(1, "zones", "")
> root.appendChild(zones)
> .
> .
> .
>
> When the file is written I get this:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <freight><zones><...></zones><zones><...></zones>...</freight>
>
> My goal is:
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <freight>
> <zones>
> <...>
> </zones>
> <zones>
> <...>
> </zones>
> .
> .
> .
> </freight>
>
> When I open a raw XML file into IE, it takes forever, and sometimes
> crashes
> trying to read the file.  I'm not sure if it is due to the extremely long
> line it is trying to parse.  I can open an XML file in Wordpad quick
> enough
> but the long line still exists and it will not display the end of the line
> unless I manually add line feeds.  Notepad will not show it either.
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Mark Schupp
12-28-04 08:55 PM


Re: single line XML file
"Mark Schupp" wrote in message news:O9WKEhP7EHA.3124@TK2MSFTNGP11.phx.gbl...
: If you want to control the format of the raw xml you will probably have to
: build it as a string and embed the CrLf characters where you want them
(and
: tabs too if you really want it readable).
:
: Or you can run it through an XSL conversion the way that IE does when you
: open an XML file. Not sure of the XSL code to do that though.

Hi Mark.  Thanks for responding.

I'm familiar enough with XSL but I thought that was only for delivery to the
client.  I have some files the client will eventually see but there is no
need for them to see the rate table.  I just thought perhaps I was missing
something creating a two line file.  I doubt I want to write strings as I
did before, and add what I read was line-feeds [no carriage returns] but one
would think MSFT would have included it if that is the norm.

--
Roland Hall
/* This information is distributed in the hope that it will be useful, but
without any warranty; without even the implied warranty of merchantability
or fitness for a particular purpose. */
Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
MSDN Library - http://msdn.microsoft.com/library/default.asp



Report this thread to moderator Post Follow-up to this message
Old Post
Roland Hall
12-28-04 08:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

ASP archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:22 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.