A simple XML & XSLT based Web Form

E

el_bandido

Hello,

I've tried the FAQ and some minutes in googl'ing but was not happy with
what I got. Basically I'd like to get a _simple_ example on how I could
create a web based (portable across all platforms and applications) form
for a simple web application using XML technologies.

I would like to have something like follows:

An XML DB containing that looks roughly like follows:

<?xml version="1.0" encoding="UTF-8"?>
<!-- my foobar DB --!>
<MY_FOORBAR_DB>
<ITEM title="../aaa/bbb.ext">
<KEYWORDS> Credite, Pisones, isti, tabulae, fore </KEYWORDS>
</ITEM>
<ITEM title="../ccc/aaa.ext">
<KEYWORDS> librum, persimilem, cuius, uelut, aegri </KEYWORDS>
</ITEM>
<ITEM title="../bbb/aaa.ext">
<KEYWORDS> somnia, uanae, fingentur, species, ut, nec </KEYWORDS>
</ITEM>
<ITEM title="../ddd/bbb.ext">
<KEYWORDS> pes, nec, caput, uni, reddatur, formae </KEYWORDS>
</ITEM>
</MY_FOOBAR_DB>

An index.xml which would basically be like an index.html with a query
form and a SUBMIT button as input type like follows:

Please enter keywords to search: _________________________ [SUBMIT]

Which would then create an appropriate XSLT file (using the keywords as
search parameters) _and_ call the XML DB with it, resulting in the
display of the selected ITEMS which contain the AND and OR match of the
submitted keywords.

In a second stage I'd like to add a form which takes an ITEM and a
variable amount of KEYWORDSs and adds it to the XML DB dynamically, when
hitting SUBMIT.

I know that I can do this with perl, python, bash, c, <insert other no
portable languages> but I thought that using a meta language would be an
interesting approach to solve this problem. Unfortunately I have not
found a simple enough example that would show me the solution to this
problem.

Basic questions for me right now (until I get the picture) are:

1. Can XML & XSLT be used to generate persistent files using IIS or
apaches as web servers and firefox or IE as clients?
2. Is regexp possible with XSLT?
3. How are Unicode characters passed as arguments to the XSLT processor?

Best regards,
Roberto Nibali, ratz
 
T

Tjerk Wolterink

Hello,

I've tried the FAQ and some minutes in googl'ing but was not happy with
what I got. Basically I'd like to get a _simple_ example on how I could
create a web based (portable across all platforms and applications) form
for a simple web application using XML technologies.

I would like to have something like follows:

An XML DB containing that looks roughly like follows:

<?xml version="1.0" encoding="UTF-8"?>
<!-- my foobar DB --!>
<MY_FOORBAR_DB>
<ITEM title="../aaa/bbb.ext">
<KEYWORDS> Credite, Pisones, isti, tabulae, fore </KEYWORDS>
</ITEM>
<ITEM title="../ccc/aaa.ext">
<KEYWORDS> librum, persimilem, cuius, uelut, aegri </KEYWORDS>
</ITEM>
<ITEM title="../bbb/aaa.ext">
<KEYWORDS> somnia, uanae, fingentur, species, ut, nec </KEYWORDS>
</ITEM>
<ITEM title="../ddd/bbb.ext">
<KEYWORDS> pes, nec, caput, uni, reddatur, formae </KEYWORDS>
</ITEM>
</MY_FOOBAR_DB>

[cut]

I did not read your whole story but i think it is better to store your keywords like this:

<item title="../aa/bb.ext">
<keywords>
<keyword>Credite</keyword>
<keyword>Pisones</keyword>
<keyword>Isti</keyword>
</keywords>

This is better because in your case you are separating information elements using your own comma like
markup syntax. But the whole reason d'existance of xml is to markup information elements.

Nice word: reason d'existance :)
 
E

el_bandido

I did not read your whole story but i think it is better to store your
keywords like this:

<item title="../aa/bb.ext">
<keywords>
<keyword>Credite</keyword>
<keyword>Pisones</keyword>
<keyword>Isti</keyword>
</keywords>

Indeed, thanks. It would be kind of stupid to have the XLST processor do
commata stripping and try to do pattern matching on a variable amount of
parameters.
This is better because in your case you are separating information
elements using your own comma like
markup syntax. But the whole reason d'existance of xml is to markup
information elements.

Correct, so my original request remains, but of course with your version
of separating information elements.
Nice word: reason d'existance :)

Horace salutes you ;).

Cheers,
Roberto Nibali, ratz
 

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

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top