[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-edu-devel
Subject:    Re: [kde-edu]: generating word lists for kwordquiz
From:       Peter Hedlund <peter () peterandlinda ! com>
Date:       2005-01-12 23:02:54
Message-ID: 41E5AC9E.1090606 () peterandlinda ! com
[Download RAW message or body]

Peter Hedlund wrote:
> Hi,
> 
> CPH wrote:
> 
>> Hi,   Is it a reasonable suggestion for kwordquiz to use the data from 
>> kgeography (i.e. city/region) ? I think that it could be generated 
>> thru a "simple" XSLT or python script, either during startup or when 
>> given a kgeography file ( .kgm ).

Just for the fun of it, here's some XSLT that will display a .kgm file 
in a table that can be copied into KWordQuiz (somewhat tested). Save as 
kgeography.xsl and then insert this line at the top of the .kgm file:

<?xml-stylesheet type="text/xsl" href="kgeography.xsl"?>

Thanks,
Peter

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" 
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">
   <html>
   <body>
     <h2>KGeography Map</h2>
     <table border="1">
       <tr bgcolor="#9acd32">
         <th align="left">Country</th>
         <th align="left">Capital</th>
       </tr>
       <xsl:for-each select="map/division">
         <xsl:choose>
           <xsl:when test="ignore='yes'">
           </xsl:when>
           <xsl:otherwise>
             <tr>
               <td><xsl:value-of select="name"/></td>
               <td><xsl:value-of select="capital"/></td>
             </tr>
           </xsl:otherwise>
         </xsl:choose>
       </xsl:for-each>
     </table>
   </body>
   </html>
</xsl:template>
</xsl:stylesheet>
_______________________________________________
kde-edu mailing list
kde-edu@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-edu
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic