losing line breaks

L

linuxnooby

Hi

when I import xml data into Access 2002 , text imported into a memo
field loses the line breaks. For example I create in notepad the xml
file

<?xml version="1.0" encoding="iso-8859-1"?>
<table>
<record>
<column>
paragraph one

paragraph two
</column>
</record>
</table>

but what appears in Access is

paragraph one paragraph two

I want to preserve the line breaks, any suggestion welcome.
cheers David
 
J

John Nurick

Hi David,

When I import your sample XML into Access 2003 the white space is
preserved; this is pasted from the Immediate pane:

set R = currentdb.OpenRecordset("Record")
? "|" & R.fields(0).Value & "|"
|
paragraph one

paragraph two
|

I don't have Access 2002 here so can't test it myself, but try using
<table xml:space="preserve">
in place of
<table>
 
L

linuxnooby

Hi John

thanks for your reply

Tried
<table xml:space="preserve">

line breaks still not displayed in Access.

If I copy and paste the information from the table data view back into
notepad the line breaks are visible again.

How do I open the "immediate window"??

cheers David
 
J

John Nurick

Tried
<table xml:space="preserve">

line breaks still not displayed in Access.

When you say "not displayed in Access" do you mean that given
first line
second line
- you can only see the first line of the field
first line
- each line break is displayed as one or two square boxes
or bars
first line[][]second line
- linebreaks are not displayed at all, i.e.
first linesecond line
- linebreaks are displayed as spaces (as implied by your first message)
first line second line
If I copy and paste the information from the table data view

In datasheet view you'll normally only see the first line of data, and
never more than one line.
back into
notepad the line breaks are visible again.

Is this different from the way it works without xml:space="preserve" ?
How do I open the "immediate window"??

Search Help for
immediate window
or
use the immediate window
 
L

linuxnooby

Hi

In the datasheet view only the first line is displayed by default, but
i can resize the hight of rows and then I can see the formatting of the
text.

linebreaks are not displayed at all, i.e.
first linesecond line

this is regardless of whether the xml:space="preserve" attribute is
used or not

cheers Dave
 
J

John Nurick

Now I'm really confused. If linebreaks aren't being displayed at all,
the entire value appears on a single line, so why do you need to
increase the height of the datasheet rows to see the text?

Anyway, the only suggestion I have may not seem very helpful:

-upgrade to Access 2003 (XML support has improved significantly over
2002)
-modify your XML document and/or schema to treat line breaks explicitly.
 

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