CrLf in XML ?

B

Balex

Hi

I've generated XML files through VBA code (using the MSXML.DOMDocument
object). Now the developers of the application that receives and should
process my XML are having problems because my XML is one long string, and
they expected that there would be a carriage return+line feed (vbCrLf) at the
end of each tag, and probabyl also an indentation ! As I am using standard
methods of the DOMDocument object, I have no control (at least I think so)
over the way the XML is concatenated, but the default from Microsoft seems to
be clearly a one-line long string.

Can anyone tell me:
1. what's the real standard in XML: a one-line loooong string, or a
delimited, indented structure ?
2. Is there a way to tell the DOMDocument object to generate the latter ?

Thanks for help.
Balex
 
B

Balex

Hi Tim

Thanks for reply. After some rummaging, I also found various bits on the
internet about whitespace, so now I have answers about my first question.

Unfortunately, regarding my second question, the MS article you pointed at
deals exclusively with *reading* XML with whitespace, but says nothing about
how to *generate* an XML with whitespace between consecutive tags. And all I
could find on the Internet only deals with CrLf *within* tag content, which
is not my problem. So, so far, I still don't know how to do it...

Balex
 
S

Sergey Poberezovskiy

Balex,

you could create a simple dll in .Net and register it for COM
interoperability. The sample code could be found on
http://builder.com.com/5100-31-5075652.html
Then just add reference to the compiled dll in your access project and you
will be able to format the document programmatically. If you do not Visual
Studio.Net, you could always download free VS Express from Microsoft site.

HTH
 
T

Tim Ferguson

Unfortunately, regarding my second question, the MS article you
pointed at deals exclusively with *reading* XML with whitespace, but
says nothing about how to *generate* an XML with whitespace between
consecutive tags.

Since xml is only a text file anyway, it should not be too hard to create
it using Print # commands and then put in whatever whitespace you want?


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top