[Corpora-List] creating XML through Xforms

Kamakshi Rajagopal rajagopal at lige.ucl.ac.be
Tue Dec 21 14:34:55 UTC 2004


Hello,
I am creating a database with XML documents following the XCES standard.
For adding new texts to the database, I am using XForms, as it has the
possibility to store the data directly in XML and it can be used offline
(which is important as the computers that will be used are not connected to
the internet). I am using the browser XSmiles (www.xsmiles.org) to display
Xforms.

The format of the form is quite straightforward: first it asks for metadata
about the text and author. Then the text itself has to be entered. Finally
there is a Submit button, and the data is stored in a default file.

I have 2 questions:

1.
My first question is regarding the actual input of the text, it is done
through a <textarea> element. Is there a way to add paragraph (<p>) and
sentence (<s>) tags to the text automatically? As the job of inputting the
texts will be done by some students, I would prefer to tag the texts
automatically to avoid inconsistencies. Also, I would prefer to do this
before or at the time the document is saved, rather than going through all
XML documents afterwards.
Possible solutions I thought of, were:
a) attaching a perl script to the form that adds markup to the textarea
when an "add markup" button is pushed. Is this possible in XForms? If yes,
how will you link the content of the textarea to the perlscript in Xforms?
b) using javascript to add markup to the content of the textarea. How do I
select the content of the textarea as a variable for Javascript to perform
regex substitutions on it? Also, can I do this at the same time as when the
document is saved?


2.
Is there a way to select the name of the document you are saving? In other
words, how can I make a 'Save As' button?

Thank you very much for your help!
Best Wishes,
Kamakshi Rajagopal



More information about the Corpora mailing list