Archive of UserLand's first discussion group, started October 5, 1998.

textToXml script for Frontier 6

Author:Dave Winer
Posted:6/17/1999; 9:36:34 AM
Topic:Scripts to produce Channel files?
Msg #:7516 (In response to 7483)
Prev/Next:7515 / 7517

OK, I have the example script ready to go.

Input file

First, here's a link to the input file. Please do a View Source on the file, since it's a text file, your web browser may wrap it in a funny way. The formatting of the text is important.

http://nirvana.userland.com/misc/myUserLandDemo/inputFile.txt

Output file

Next, here's the XML file the script produces. Again it might be necessary to View Source to get an accurate representation of the file.

http://nirvana.userland.com/misc/myUserLandDemo/outputFile.xml

The script

Here's the source code of the script that converts the .txt file into the .xml file:

http://pointers.userland.com/textToXmlScript

Format of the text

A few comments on the formatting of the text.

Each section is separated by a pair carriage-return-linefeeds.

The text can contain markup, but it will be neutered on processing

CharacterIs replaced with
&&
<&lt;
>&gt;

s are treated specially, they are stripped out and used to build the part of the .

Groundrules

If you're going to convert this script to another language or environment, please put a copy of the script on your server and post a pointer in the DG. Don't try to paste the text of the script into a DG message, it'll mangle it for sure. Thanks!


There are responses to this message:


This page was archived on 6/13/2001; 4:50:53 PM.

© Copyright 1998-2001 UserLand Software, Inc.