[thelist] XML > XSL > HTML question

Kerin Cosford Kerin.Cosford at current-drugs.com
Fri May 25 08:53:23 CDT 2001


Yes, the data isn't held in the most intelligent format possible - all
future data will be however.

I'm working with large amounts of legacy data, several gigabytes (an
exhaustive databse of chemical data on pharmaceuticals), so changing the
source data format isnt an option.

-----Original Message-----
From: Matt Patterson [mailto:ltu97mp at reading.ac.uk]
Sent: 25 May 2001 13:13
To: thelist at lists.evolt.org
Subject: Re: [thelist] XML > XSL > HTML question


On 24/5/01 at 3:29 pm, Kerin.Cosford at current-drugs.com (Kerin Cosford)
wrote:

> A couple of parts of my XML file hold large chunks of text. When I view
the
> XML file, I can see that the text (in CDATA[]) is nicely formatted with
> carriage returns. Obviously though, XSL strips out all extraneous
> whitespace, so I just end up with these *huge* blocks of text with no
> linebreaks.

If I may...

Why are you storing large chunks of continuous text so crudely?

<large chunk>all my continuous text</large chunk>

Why not store it properly structured, with the paragraphs (which I assume
are
the things delimited by your carriage returns) in their own elements.

<large chunk><para>some of my continuous text</para><para>some more
text</para></large chunk>
 
> Now, I know how to get XSL to preserve whitespace, but thats no good - the
> text comes through still formatted, but obviously newline characters mean
> nothing to HTML - what I need to do is convert the newlines to <br>s, or
> <p>s, or whatever.

CDATA sections are for data which shouldn't be parsed...

You could replace the newlines with entities which parse to <br /> or
something
like that and store your data as PCDATA, but that might complicate things
more...

Give me fine granularity or give me death! (or something...)

Matt

-------------------------------------------------------------------------

Matt Patterson:
   Student
   Reading University
   Department of Typography & Graphic Communication

   ltu97mp at reading.ac.uk
   
   http://www.rdg.ac.uk/~ltu97mp/

   Piglet took Pooh's arm, in case Pooh was frightened.
   'Is it one of the Fiercer Animals?' he said, looking the other way.
   Pooh nodded. 
   'It's a Jagular,' he said.
   'What do Jagulars do?' asked Piglet, hoping that they wouldn't.

---------------------------------------
For unsubscribe and other options, including
the Tip Harvester and archive of TheList go to:
http://lists.evolt.org Workers of the Web, evolt ! 




More information about the thelist mailing list