xsl-list
[Top] [All Lists]

Re: document(lang_*.xml)?

2003-01-25 04:22:38

Solved this prob somehow....

Here is how I in a "not so pretty" way managed to produce
the desired output:
<?xml version="1.0" encoding="UTF-8"?>
<LangList>
<language>lang_en.xml</language>
<language>lang_fi.xml</language>
<language>lang_no.xml</language>
<language>lang_se.xml</language>
</LangList>

with this lang_list.sh

#!/bin/sh
# this skript reads the directory and selects all lang_*.xml files. 
# from them it generates list.xml file to be used by profiler.xsl 
path=/var/www/xslt
beginline= /bin/cat begin
rootbeginline= /bin/cat rootbegin
rootendline= /bin/cat rootend

cd $path
/bin/echo ""
/bin/echo "Creating backup of previous list.xml file to bu_list.xml file"
cp $path/list.xml $path/bu_list.xml
/bin/echo "Starting lang_list Listing"
/bin/echo ""
/bin/echo "List of languages in the file list.xml:" 
/bin/echo "********************************"
ls lang_*.xml | sed -e "s(_at_)\(.*xml\)@<language>\1</language>@" 
/bin/echo "********************************"
ls lang_*.xml | sed -e "s(_at_)\(.*xml\)@<language>\1</language>@" > list

# put all three file contents to one file
/bin/cat beginline rootbeginline list rootendline > list.xml

/bin/echo "Stopping lang_list Listing"

Cheers, 
Jarkko

***************************************************
* Jarkko Moilanen                                 *
* Project Researcher, ITCM (www.itcm.org)         *
* Profound XML technology Expert                  *
* University of Tampere                           *
* Hypermedia Laboratory                           *
***************************************************

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



<Prev in Thread] Current Thread [Next in Thread>