xsl-list
[Top] [All Lists]

RE: [xsl] without a loop file get the element list

2008-08-13 02:15:25



 Hi
 I have following xml and XSL file as bellow.
 An application calls the XSL file and disply the
 nodes
 contents in a windows as a html.
 With a for-each loop i get each node content
 (element)
 more times. For example in this sample xml file each
 element is displayed three times because there are 3
 elements in the xml file and so on.
 I t seems that each time ??for each? elment in the
 for-each loop, the whole elements are displayed!
 Calling the xml file from web browser the XSL
 ?Stylesheet works fine and the elemnts are 
 displayed only one time as expected.
 I thought to walk throw the ?elements list? without
 the for-each loop and display the elements but I 
 don?t know how to do it!!??
 
 Thank you for your help
 
 *******************************
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="text-1.xsl" ?>
<document>
   <elements>
     <element type="author">Author-Element</element>
      <element
type="paragraph">Paragraph-Element</element>
    <element type="title">Title-Element</element>
  </elements>
</document>

*****************************************************************
<?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>
     <table >

        <xsl:for-each select="document/elements/element">

        <tr><td>
        <!--  <xsl:value-of disable-output-escaping="yes"
select="current()"/>  -->
           <xsl:value-of select="."/>
                </td></tr>

   </xsl:for-each>

</table>

                
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>

__________________________________________________
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.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>
--~--