Re: [xsl] xsl wrting to an xml document

Subject: Re: [xsl] xsl wrting to an xml document
From: "Joe Fawcett" <joefawcett@xxxxxxxxxxx>
Date: Fri, 3 Dec 2004 13:28:14 -0000
----- Original Message ----- From: "Andy Ford" <andy.ford@xxxxxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, December 03, 2004 11:38 AM
Subject: [xsl] xsl wrting to an xml document



I'm assuming writing to an element in an xml document is a simple operation for xsl.

I am putting together a language tree that will allow a user to read a
site in French (FR), English (EN) etc etc. I originally had it as a tab
separated list that was read in by Perl, and then decided to change it
to XML and get XSL to do the formatting.
Languages that have no value for the element will default to English.

The XML tree structure is this ...

<languages>
   <script>GLOBAL
       <var>CHOOSE_A_LANGUAGE
           <string lang='EN'>Please choose a language</string>
           <string lang='ES'>Elija un idioma por favor</string>
           <string lang='FI'>Valitse kieli</string>
           <string lang='IT'>Per favore, scegli una lingua</string>
           <string lang='NL'>Selecteer een taal</string>
           <string lang='PT'>Escolha um idioma</string>
           <string lang='FR'></string>
           <string lang='NO'></string>
</var>
       <var>GOLD
           <string lang ='DE'></string>
           <string lang ='DK'></string>
           <string lang ='EN'>Gold</string>
           <string lang ='ES'></string>
           <string lang ='FI'></string>
           <string lang ='FR'>Or</string>
           <string lang ='IT'></string>
           <string lang ='NL'></string>
           <string lang ='NO'></string>
           <string lang ='PT'></string>
           <string lang ='SE'></string>
       </var>
   </script>
</languages>

What I would need XSL to do is display the default Engligh version along
with a text box, to enter their chosen language version i.e...

GLOBAL
EN: Please choose a language
FR: [    ]

GOLD
EN: Gold
FR: [Or    ]

[Submit changes button]

And update the XML file with the French version when they enter the text
and click on the 'Submit button'

So, essentially I need XSL to format the XML data into an HTML Form so I
can submit the changes back into the XML document.

Can this be done?

Thanks

Andy


Yes, providing you have some sort of server side processing capability such as JSP, ASP, PHP etc.
I presume the user are going to pick a language and add in the terms. You can create a dropdown list from the lang attributes and then they will see a selection of phrases in English and will enter the equivalent term in their chosen language. The data is then submitted and inserted into the file.
One problem would be more than one user editing at a time. It maybe better for each to create a copy of the document and merger them later.
You could also use Google language tools to do do this automatically, not all your languages are available though.


--

Joe

Current Thread