Export Forced Line Break (soft returns) to XML
Jeanne A. E. DeVoto
revolution at jaedworks.com
Tue Oct 11 06:01:18 CDT 2005
At 11:31 PM -1000 10/10/2005, Sivakatirswami wrote:
># this is the key function which closes and opens a verse,
># or puts char(10) (soft return) after any line
># where x is the name of the song and y is each line in that song:
> repeat for each line y in tVerses
> if y is empty then
> delete last char of tOutput
> put "</" & x &"_verses>" & cr & "<" & x &"_verses>" after tOutput
> put y & numTochar(10) after tOutput
> end if
># then save a binfile to avoid line ending translation:
> ask file "Enter an output filename."
> put tOutput into url ("binfile:"& it)
>Opening this in BBedit with line translation off.. I get 1 line of data!
Sivakatirswami, I'm not sure what the problem is... this is what
you'd expect. Your script exports a file with no return characters,
so naturally BBedit sees only one line... there *is* only one line.
I'm not sure but I think the problem may be that you misunderstand
the "CR" constant. It's a numToChar(10), not numToChar(13). I think
you want to be substituting "numToChar(13)" for cr:
put "</" & x &"_verses>" & numToChar(13) & "<" & x &"_verses>"
if I'm correctly understanding what's going on in your script.
jeanne a. e. devoto ~ revolution at jaedworks.com
More information about the use-livecode