xsl-list
[Top] [All Lists]

RE: XML/XSLT reading

2004-12-06 04:30:24
Thanks Michael

I am putting together a language file/xml 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 for
the user.

So, on one part of the site, the user will select his/her language to
use. This is then written to a user specific config. I would need the
XSL file to read in the config file to know which language to display
(alonside the English version) in the languages file i.e. If they have
chosen French, use XSL to format the XML file to display the English and
then the French alongside so they can alter the French version of that
word/phrase to display on the site. This is a simple process in Perl but
I need to understand XML/XSLT to determine whether It can be of use in
this example.

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>

So reitterating on what I have above, the user would see something like
this ...

CHOOSE_A_LANGUAGE
        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'

I undertand now that I will need another script to post the data to so
it can modify the XML file (apparently XSL can't do this directly!)

What do you suggest?

Thanks for listening

Andy

perl -e "print qq^bIG VeRN ! ^^qq^#'#Yv#=<D+ ^"

On Mon, 2004-12-06 at 11:16 +0000, Michael Kay wrote:
Can anyone provide me with some useful URLs so I can read up
on how and where XML and XSL is used ( in the real world ).

You'll find any number of pieces giving a local perspective on this,
but I'm
not aware of anything that you'll find useful to address the question
below.

I have a very specific
use which I am now implementing in Perl as I can't see a
valid reason to use XML/XSL.

I can think of many problems that would be better programmed in Perl
than in
XSLT, so this shouldn't be a worry. But you wouldn't be posting here
unless
you were uncertain of your decision. So explain it here, and let's see
if
other people agree with your choice.

Michael Kay
http://www.saxonica.com/


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--




This e-mail is private and may be confidential and is for the intended 
recipient only.  If misdirected, please notify us by telephone and confirm that 
it has been deleted from your system and any copies destroyed.  If you are not 
the intended recipient you are strictly prohibited from using, printing, 
copying, distributing or disseminating this e-mail or any information contained 
in it.  We use reasonable endeavours to virus scan all e-mails leaving the 
Company but no warranty is given that this e-mail and any attachments are virus 
free.  You should undertake your own virus checking.  The right to monitor 
e-mail communications through our network is reserved by us. 



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--