Trying to display tagname
Posted: Sat Nov 10, 2007 11:49 am
I am a translator, not a programmer, and I am completely new to this game.
I have several XML docs of the form:
Where I have to introduce the French translation of the English String (value of ENG) into the value of FRE.
I am trying to display these files as tables which will be much easier to handle.
I figured out how to display a table with 2 columns titled:
English and French
with the following XLS file:
But I would like to have a first column displaying the tagname of the first child :
checklist_c1, checklist_c2, etc...
I have tried with the following code :
...but it does not work.
(I realize that I don't realy know what I am doing here...)
If anybody has a suggestion, that would help!
Thanks!
Pascal
I have several XML docs of the form:
Code: Select all
<content>
<checklist_c1>
<ENG>Confirmation</ENG>
<CHI></CHI>
<CHT></CHT>
<RUS></RUS>
<POL></POL>
<FIL></FIL>
<FRE></FRE>
<VIE></VIE>
<SPA></SPA>
<PER></PER>
<PAN></PAN>
<HIN></HIN>
</checklist_c1>
<checklist_c2>
<ENG>You need the following three pieces of information as proof you have completed this orientation. Please select one of the options below, then click the</ENG>
<CHI></CHI>
<CHT></CHT>
<RUS></RUS>
<POL></POL>
<FIL></FIL>
<FRE></FRE>
<VIE></VIE>
<SPA></SPA>
<PER></PER>
<PAN></PAN>
<HIN></HIN>
</checklist_c2>
....
</content>
I am trying to display these files as tables which will be much easier to handle.
I figured out how to display a table with 2 columns titled:
English and French
with the following XLS file:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="node()">
<html>
<body>
<table border="2">
<tr>
<th>English</th>
<th>French</th>
</tr>
<xsl:for-each select="content/*">
<tr>
<td><xsl:value-of select="ENG" /></td>
<td><xsl:value-of select="FRE" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
checklist_c1, checklist_c2, etc...
I have tried with the following code :
Code: Select all
<?xml version="1.0" encoding="iso-8859-1" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">
<xsl:template match="node()">
<html>
<body>
<table border="2">
<tr>
<th>Entry #</th>
<th>English</th>
<th>French</th>
</tr>
<xsl:for-each select="content/*">
<tr>
<td><xsl:value-of select="name()" /></td>
<td><xsl:value-of select="ENG" /></td>
<td><xsl:value-of select="FRE" /></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
(I realize that I don't realy know what I am doing here...)
If anybody has a suggestion, that would help!
Thanks!
Pascal