Hello all.
 
My problem, is that not like solving that my bucle for-each shows the two to me imagenes together and not like separating them or giving an option them so that xml does not show to meetings when executing my file to it.
 
My file .xml:
 
books.xml
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<?xml-stylesheet href="books.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<!DOCTYPE Libros SYSTEM "books.dtd">
<Libros>
 <Libro Idioma="Inglés">
  <Nombre>
        Designing XML Internet Applications
        </Nombre>
  <img url="book1.gif"/>
                <Precio>
                   67.55 USD
                </Precio>
 </Libro>
 <Libro Idioma="Inglés">
  <Nombre>
         Perl 5 Complete
         </Nombre>
  <img url="book2.gif"/>
                <Precio>
                   72.75 USD
                </Precio>
 </Libro>
</Libros>
 
My file .xsl:
books.xsl
<?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="/">

<xsl:processing-instruction name="cocoon-format">
   type="text/html"
</xsl:processing-instruction>
<HTML>
 <HEAD>
  <TITLE>
   Libro
  </TITLE>
 </HEAD>
        <BODY>
                        <CENTER><IMG src="javascript:void(0);"/>
                                <H1> 
         VENTA LIBROS
    </H1>
           <IMG src="javascript:void(0);"/>
                        </CENTER>
    <H2>
                                <BR>
      SELECCIONE EL LIBRO QUE DESEA COMPRAR:
                                </BR>
    </H2>
 <FORM action="http://localhost/cgi-bin/prueba1.pl" method="POST" enctype="TEXT/PLAIN">
        <xsl:for-each select="Libros/Libro">
        <CENTER> 
        <H3>
        <INPUT type="radio" name="Libro" value="1"/>
        <xsl:value-of select="Nombre"/>       
        </H3>
        </CENTER>
        <CENTER>
           <TABLE align="CENTER" border="0">
              <TR>  <!-- Unica Fila -->
                 <TD>
                 <H6>
                    <BR>
                    Idioma:
                    <FONT color="#000000" size="2">
                    </FONT>
                    <xsl:value-of select="@Idioma"/>
                    </BR>
                   
                 </H6>
                 </TD> 
                 <TD>  
                 <!-- Error the show imagen --> 
                 <xsl:for-each  select="/Libros/Libro/img">
                       <IMG src="{@url}" border="1" height="125" width="95"/>
                 </xsl:for-each>
                 <!-- End Error -->
                 </TD> 
                 <TD> 
                 <BR/>
                 </TD>
                 <TD>  
                 <H6>
                    <BR>
                    <FONT color="#000000" size="2">
                    Precio:
                    </FONT>
                    <xsl:value-of select="Precio"/>
                    </BR> 
                 </H6>
                 </TD>
              </TR>  
           </TABLE> 
        </CENTER>
        </xsl:for-each>
        <P/>
        <CENTER>
        <IMG src="javascript:void(0);"/>
        <P/>
        <INPUT type="submit" value="Ver Libros"/>
        <INPUT type="reset" value="Borrar Seleccion"/>
        <P/>
        <IMG src="javascript:void(0);"/>
        <P/>
        <A href="Tarea4a.html"> <IMG src="javascript:void(0);"/> </A>
        <P/>
        </CENTER> 
  </FORM> 
 </BODY>
</HTML>
</xsl:template>
</xsl:stylesheet>
 
My file .dtd :
books.dtd
 
<!ELEMENT Libros (Libro+)>
<!ELEMENT Libro (Nombre, img, Precio)>
<!ATTLIST Libro Idioma CDATA #REQUIRED>
<!ELEMENT Nombre (#PCDATA)>
<!ELEMENT img EMPTY>
<!ATTLIST img url CDATA  #REQUIRED>
<!ELEMENT Precio (#PCDATA)>
 
As it shows to the file books.xml to me in cocoon, with imagenes repeated.
 
Thank you all.
Ivan Andrade M.
Punta Arenas.
Chile.
 


Con MSN Hotmail súmese al servicio de correo electrónico más grande del mundo. http://www.hotmail.com/ES
--------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to