Click here to Skip to main content
14,665,831 members
Home » Discussions » XML / XSL
   

XML / XSL

 
AnswerRe: XSLT and asp.NET mixture Pin
Atwind27-Jun-10 23:42
MemberAtwind27-Jun-10 23:42 
Questionlanguage localization using XML in VC++ (MFC) Pin
punyah20108-May-10 9:03
Memberpunyah20108-May-10 9:03 
QuestionSuppress Xmlns in InnerXML / Rename an XML node in DOM Pin
Ger Hayden6-May-10 11:37
MemberGer Hayden6-May-10 11:37 
AnswerRe: Suppress Xmlns in InnerXML / Rename an XML node in DOM Pin
Ger Hayden8-May-10 7:24
MemberGer Hayden8-May-10 7:24 
QuestionParsing RSS Pin
Aljaz1116-May-10 3:37
MemberAljaz1116-May-10 3:37 
AnswerRe: Parsing RSS Pin
Stuart Dootson6-May-10 23:24
professionalStuart Dootson6-May-10 23:24 
QuestionXSLT to HTML Pin
vho12329-Apr-10 21:46
Membervho12329-Apr-10 21:46 
AnswerRe: XSLT to HTML Pin
Stuart Dootson6-May-10 1:00
professionalStuart Dootson6-May-10 1:00 
This does most of what you want...I've put in comments to show the different bits...

<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:output method="html" indent="yes"/>
  
  <!-- We need a template matching the document root to start the transformation -->
  <xsl:template match="/">
   <html>
   	  <head>
   	  <title>Bilingual Lexicon ES-EN</title>
   	  <link href="dictionary.css" rel="stylesheet" type="text/css"  />
   	  </head>
   	  <body>
   <h3>Browse by letter</h3>
          <table>
             <!-- Process each translation element, sorted by the initial attribute and then the English term -->
             <xsl:apply-templates select="//translation">
                <xsl:sort select="@initial"/>
                <xsl:sort select="search"/>
             </xsl:apply-templates>
       </table>
   	  </body>
   </html>
   </xsl:template>
   
   <!-- Template to process a translation element -->
   <xsl:template match="translation">
       <!--
          If this is the first translation element, or its initial attribute is different
          to the last one in the list of translation elements, output the
          initial attribute.
       -->
      <xsl:if test="position()=1 or @initial != preceding-sibling::translation[1]/@initial">
         <tr><td colspan="2"><h1><xsl:value-of select="@initial"/></h1></td></tr>
      </xsl:if>
      <!-- Output a row for each translation -->
      <tr>
         <td><xsl:value-of select="search"/></td>
         <td>
            <!-- Output the first replace element -->
            <xsl:value-of select="replace[1]"/>
            <!-- Output the other replace elements preceded by the separator -->
            <xsl:for-each select="replace[position()>1]">
               ;<xsl:value-of select="."/>
            </xsl:for-each>
         </td>
      </tr>
   </xsl:template>
</xsl:stylesheet>

Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

CodeProject MVP for 2010 - who'd'a thunk it!

QuestionCan anyone give me a hand with this? Pin
ajweber27-Apr-10 19:20
Memberajweber27-Apr-10 19:20 
AnswerRe: Can anyone give me a hand with this? Pin
Not Active28-Apr-10 0:54
mentorNot Active28-Apr-10 0:54 
GeneralRe: Can anyone give me a hand with this? Pin
ajweber28-Apr-10 5:59
Memberajweber28-Apr-10 5:59 
GeneralRe: Can anyone give me a hand with this? Pin
Not Active28-Apr-10 6:10
mentorNot Active28-Apr-10 6:10 
GeneralRe: Can anyone give me a hand with this? Pin
ajweber28-Apr-10 6:17
Memberajweber28-Apr-10 6:17 
GeneralRe: Can anyone give me a hand with this? Pin
Not Active28-Apr-10 6:31
mentorNot Active28-Apr-10 6:31 
GeneralRe: Can anyone give me a hand with this? Pin
ajweber28-Apr-10 6:52
Memberajweber28-Apr-10 6:52 
QuestionDesperate seeking answer to simple problem Pin
Axiom70m27-Apr-10 5:45
MemberAxiom70m27-Apr-10 5:45 
AnswerRe: Desperate seeking answer to simple problem Pin
Not Active27-Apr-10 6:57
mentorNot Active27-Apr-10 6:57 
GeneralRe: Desperate seeking answer to simple problem [modified] Pin
Axiom70m27-Apr-10 7:47
MemberAxiom70m27-Apr-10 7:47 
GeneralRe: Desperate seeking answer to simple problem Pin
Not Active27-Apr-10 9:41
mentorNot Active27-Apr-10 9:41 
GeneralRe: Desperate seeking answer to simple problem [modified] Pin
Axiom70m27-Apr-10 21:52
MemberAxiom70m27-Apr-10 21:52 
GeneralRe: Desperate seeking answer to simple problem Pin
Not Active28-Apr-10 0:52
mentorNot Active28-Apr-10 0:52 
GeneralRe: Desperate seeking answer to simple problem Pin
Axiom70m28-Apr-10 2:00
MemberAxiom70m28-Apr-10 2:00 
GeneralRe: Desperate seeking answer to simple problem Pin
Axiom70m29-Apr-10 0:16
MemberAxiom70m29-Apr-10 0:16 
QuestionHow ti create sitemap in xml? Pin
JMecier25-Apr-10 0:59
MemberJMecier25-Apr-10 0:59 
AnswerRe: How ti create sitemap in xml? Pin
User 171649225-Apr-10 1:11
professionalUser 171649225-Apr-10 1:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.