Foros del Web » Programación para mayores de 30 ;) » Programación General »

Problema que no encuentro solucion

Estas en el tema de Problema que no encuentro solucion en el foro de Programación General en Foros del Web. Saludos. Tengo que crear un archivo xsl que vaya creando filas segun datos que recibe de un archivo xml. El problema esta en que alguna ...
  #1 (permalink)  
Antiguo 13/03/2005, 17:44
 
Fecha de Ingreso: febrero-2005
Mensajes: 198
Antigüedad: 21 años, 7 meses
Puntos: 5
Problema que no encuentro solucion

Saludos.

Tengo que crear un archivo xsl que vaya creando filas segun datos que recibe de un archivo xml. El problema esta en que alguna de las filas puede tener dos columnas en las que contenga varias filas.

El problema que tengo es que cuando esta el cursor del raton encima de una fila se marque entera (incluyendo si tiene una columna con varias filas)

Es dificil de explicar pero os pongo los archivos y lo entendereis enseguida. solo teneis que abrir el xml con un explorador. Os pongo tambien la hoja de estilos.

si alguien me da una solucion le amaré

gracias por adelantado.

el archivo xsl:
Código PHP:
<?xml version='1.0' encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output media-type="text/html" encoding="ISO-8859-1"/>
    <xsl:template match="/">
        <html>
            <head>
                <title>Estadística</title>
                <link type="text/css" href="crm.css" media="screen" rel="stylesheet"/>
                <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
            </head>
            <body style="margin-left=0;margin-top=0;margin-right=0;margin-width=0;">
                <form method="post" action="" name="Relaciones">
                    <table width="590" class="table_list" style="table-layout:fixed">
                        <tbody id="registros">
                           
                            <xsl:for-each select="reclamaciones/reclamacion">
                                 <xsl:variable name="pos" select="position()"/>
                                <tr onMouseOver="this.className='celda_list_sel'" onClick="document.getElementById('prueba'+{position()}).checked=true;document.getElementById('prueba'+{position()}).click();">
                                    <xsl:attribute name="class">celda_list_imp</xsl:attribute>
                                    
                                    <xsl:attribute name="onMouseOut">this.className='celda_list_imp'</xsl:attribute>
                                    <xsl:if test="position() mod 2 = 0">
                                        <xsl:attribute name="class">celda_list_par</xsl:attribute>
                                        <xsl:attribute name="onMouseOut">this.className='celda_list_par'</xsl:attribute>
                                    </xsl:if>
                                    <td style="width:10" align="center">
                                        <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>
                                        <input type="radio" style="width:9;height:9"
                                            id="prueba{position()}" name="relacion" value="{idrel}" onClick="Llamar_Consulta(this.value, '{refrel}', '{numarchivo}')"/>
                                    </td>
                                    <td style="width:70" align="center" >
                                      <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>  
                                        <xsl:value-of select="refrel"/>
                                    </td>
                                    <td style="width:160" align="center">
                                        <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>
                                        <xsl:value-of select="nompax"/>
                                    </td>
                                    <td style="width:80" align="center" >
                                        <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>
                                        <xsl:value-of select="datins"/>
                                    </td>
                                    <td style="width:60" align="center">
                                        <xsl:value-of select="motivos/codmtr"/>
                                    </td>
                                    <td style="width:150">
                                        <xsl:value-of select="motivos/descr"/>
                                    </td>
                                    <td style="width:65" align="center" >
                                        <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>
                                        <xsl:value-of select="escaneado"/>
                                    </td>
                                    <td style="width:0" align="center">
                                        <xsl:attribute name="rowspan"><xsl:value-of select="count(motivos/codmtr)"/></xsl:attribute>
                                        <xsl:value-of select="numArchivo"/>
                                    </td>
                                </tr>
                          
                                    <xsl:for-each select="motivos/codmtr[not(position()=1)]">
                                        <tr onMouseOver="this.className='celda_list_sel'" onClick="document.getElementById('prueba'+{$pos}).checked=true;document.getElementById('prueba'+{$pos}).click();">
                                        <xsl:attribute name="class">celda_list_imp</xsl:attribute>
                                    
                                    <xsl:attribute name="onMouseOut">this.className='celda_list_imp'</xsl:attribute>
                                    <xsl:if test="$pos mod 2 = 0">
                                        <xsl:attribute name="class">celda_list_par</xsl:attribute>
                                        <xsl:attribute name="onMouseOut">this.className='celda_list_par'</xsl:attribute>
                                    </xsl:if>    
                                               
                                            
                                            <td style="width:60" align="center">
                                                <xsl:value-of select="text()"/>
                                            </td>
                                            <td style="width:150">
                                                <xsl:value-of select="following::descr"/>
                                            </td>
                                        </tr>
                                    </xsl:for-each>
                
                            </xsl:for-each>
                        </tbody>
                    </table>
                </form>
            </body>
        </html>
    </xsl:template>
</xsl:stylesheet>

el archivo xml

Código PHP:
<?xml version="1.0" encoding="UTF-8"?>
<?xml
-stylesheet href="Xml_Reclamacion_Rcp.list_relaciones_html.xsl" type="text/xsl"?>
<reclamaciones>
    <reclamacion>
        <refrel>ref002</refrel>
        <datins>11/07/1990</datins>
        <nompax>jose</nompax>
        <motivos>
            <codmtr>1</codmtr>
            <descr>galletas</descr>
            <codmtr>2</codmtr>
            <descr>leche</descr>
            <codmtr>3</codmtr>
            <descr>bbbb</descr>
        </motivos>
        <escaneado>s</escaneado>
    </reclamacion>
    <reclamacion>
        <refrel>ref002</refrel>
        <datins>11/07/1990</datins>
        <nompax>jose</nompax>
        <motivos>
            <codmtr>1</codmtr>
            <descr>galletas</descr>
            <codmtr>2.5</codmtr>
            <descr>lfsaddf</descr>
            <codmtr>3</codmtr>
            <descr>aaaaaa</descr>
        </motivos>
        <escaneado>s</escaneado>
    </reclamacion>
    <reclamacion>
        <refrel>ref002</refrel>
        <datins>11/07/1990</datins>
        <nompax>jose</nompax>
        <motivos>
            <codmtr>1</codmtr>
            <descr>galletas</descr>
            <codmtr>2.5</codmtr>
            <descr>lfsaddf</descr>
            <codmtr>3</codmtr>
            <descr>aaaaaa</descr>
            <codmtr>3</codmtr>
            <descr>aaaaaa</descr>
        </motivos>
        <escaneado>s</escaneado>
    </reclamacion>
    <reclamacion>
        <refrel>ref002</refrel>
        <datins>11/07/1990</datins>
        <nompax>jose</nompax>
        <motivos>
            <codmtr>1</codmtr>
            <descr>galletas</descr>
            <codmtr>2.5</codmtr>
            <descr>lfsaddf</descr>
            <codmtr>3</codmtr>
            <descr>aaaaaa</descr>
            <codmtr>2.5</codmtr>
            <descr>lfsaddf</descr>
            <codmtr>3</codmtr>
            <descr>aaaaaa</descr>
        </motivos>
        <escaneado>s</escaneado>
    </reclamacion>
</reclamaciones>
  #2 (permalink)  
Antiguo 13/03/2005, 17:45
 
Fecha de Ingreso: febrero-2005
Mensajes: 198
Antigüedad: 21 años, 7 meses
Puntos: 5
css
Código PHP:
body        {font-family: Arial;
            
font-size: 8px; 
            
font-style: normal; 
            
line-height: normal; 
            
font-weight: normal; 
            
color: #535353; 
            
background-color: #FFFFFF;
            
margin-top : 5pt;
            
margin-left : 3pt;
            }

.
pest_actizq { margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
width: 6px;
               
height: 15px;
               
background-image: url(../img/pest_izq_b.gif);
               
background-repeat: no-repeat;
               
background-position: bottom;
             }

.
pest_actder { margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
width: 15px;
               
height: 15px;
               
background-image: url(../img/pest_der_b.gif);
               
background-repeat: no-repeat;
               
background-position: bottom;
             }

.
pest_actcen {
               
font-size:11;
               
margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
height: 15px;
               
background-image:url(../img/punto_b.gif);
               
background-repeat:repeat-x;
               
background-position: bottom;
             }

.
pest_desizq { margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
width: 6px;
               
height: 15px;
               
background-image: url(../img/pest_izq_a.gif);
               
background-repeat: no-repeat;
               
background-position: bottom;
             }

.
pest_desder { margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
width: 15px;
               
height: 15px;
               
background-image: url(../img/pest_der_a.gif);
               
background-repeat: no-repeat;
               
background-position: bottom;
             }

.
pest_descen {
               
font-size:11;
               
margin-bottom: 0px;
               
padding-bottom: 0px;
               
vertical-align: bottom;
               
color: white;
               
height: 15px;
               
background-image:url(../img/punto_a.gif);
               
background-repeat:repeat-x;
               
background-position: bottom;
             }

.
tmenu {background-color: #3F7FAF; 
            
font-family: Arial;              
             
Font-Size : 8pt ; 
            
font-weight: bold;
            
color : white;
            
text-align : left;
            
border-color : #FFFFFF;
             
border-width : 0px;
            
margin-top: 0px; 
             
margin-right: 0px; 
             
margin-bottom: 0px; 
              
margin-left: 0px; 
            
padding-top: 0px; 
            
padding-right: 0px; 
            
padding-bottom: 0px; 
            
padding-left: 0px;}

.
table_col    {border-style : solid ;
                
border-width : 2;
             
border-color: #407090;
             
font-family: Arial;              
              
Font-Size : 8pt ; 
             
font-weight: bold;
             
color : #595959;
             
background-color : #EEEEEE;
             
width: 100%;
             
height: 95%;              
             }

.
celda_col   {border-width:0;
              
Vertical-Align : center;
              
border-color: 0;
             }

.
table_interior {border-style : solid ;
                    
border-width : 1pt;
                 
border-color: #808080;
                 
font-family: Arial;              
                  
Font-Size : 8pt ; 
                 
font-weight: none;
                 
color : #595959;
                 
background-color : #FFFFFF;
                 
width: 95%;
                 
height: 95%;    
                }

.
table_datos {border-style : solid ;
                 
border-width : 1pt;
              
border-color: #808080;
              
font-family: Arial;              
               
Font-Size : 8pt ; 
              
font-weight: none;
              
color : #595959;
              
background-color : #FFFFFF;
             
}

.
table.table_datos th {font-weight: bold;
              
font-family: Arial; 
              
background-color : #3F7FB0;
              
color : white;
              
Font-Size : 8pt ; 
              
border-color : #FFFFFF;
                 
border-width : 0pt;
              
border-style : solid ;
              
border: 0 solid;
              
margin-top: 0px; 
              
margin-right: 0px; 
              
margin-bottom: 0px; 
              
margin-left: 0px; 
              
padding-top: 0px; 
              
padding-right: 0px; 
              
padding-bottom: 0px; 
              
padding-left: 0px; 
                
height: 20px;
              }

.
table.table_datos td    {font-family: Arial; 
                    
background-color : white;
                    
Font-Size : 8pt ; 
                    
color : #606060;
                    
border-color : #FFFFFF;
                       
border-width : 0pt;
                    
border-style : solid ;
                    
border: 0 solid;
                    
margin-top: 0px; 
                    
margin-right: 0px; 
                    
margin-bottom: 0px; 
                    
margin-left: 0px; 
                    
padding-top: 0px; 
                    
padding-right: 0px; 
                    
padding-bottom: 0px; 
                    
padding-left: 0px; 
                      
height: 20px;
                    }

.
table_list    {width: 100%;
                
border: 0px 0 none;
                
margin-top: 0px; 
                
margin-right: 0px; 
                
margin-bottom: 0px; 
                
margin-left: 0px; 
                
padding-top: 0px; 
                
padding-right: 0px; 
                
padding-bottom: 0px; 
                
padding-left: 0px;
                
background-color: #FFFFFF;
               
}

.
table.table_list th {font-weight: bold;
              
font-family: Arial; 
              
background-color : #3F7FB0;
              
color : white;
              
Font-Size : 8pt ; 
              
border-color : #FFFFFF;
                 
border-width : 0pt;
              
border-style : solid ;
              
border: 0 solid;
              
margin-top: 0px; 
              
margin-right: 0px; 
              
margin-bottom: 0px; 
              
margin-left: 0px; 
              
padding-top: 0px; 
              
padding-right: 0px; 
              
padding-bottom: 0px; 
              
padding-left: 0px; 
                
height: 14px;
              }

.
celda_list_par {font-family: Arial; 
                 
background-color : #9FAFCF;
                 
Font-Size : 8pt ; 
                 
color : white;
                 
border-color : #FFFFFF;
                    
border-width : 0pt;
                 
border-style : solid ;
                 
border: 0 solid;
                 
margin-top: 0px; 
                 
margin-right: 0px; 
                 
margin-bottom: 0px; 
                 
margin-left: 0px; 
                 
padding-top: 0px; 
                 
padding-right: 0px; 
                 
padding-bottom: 0px; 
                 
padding-left: 0px; 
                   
height: 14px;
              }

.
celda_list_imp {font-family: Arial; 
                 
background-color : #ECECEC;
                 
Font-Size : 8pt ; 
                 
color : #606060;
                 
border-color : #FFFFFF;
                    
border-width : 0pt;
                 
border-style : solid ;
                 
border: 0 solid;
                 
margin-top: 0px; 
                 
margin-right: 0px; 
                 
margin-bottom: 0px; 
                 
margin-left: 0px; 
                 
padding-top: 0px; 
                 
padding-right: 0px; 
                 
padding-bottom: 0px; 
                 
padding-left: 0px; 
                   
height: 14px;}

.
celda_list_sel {font-family: Arial; 
                 
background-color : #E3C5C5;
                 
cursor : hand ; 
                 
Font-Size : 8pt ; 
                 
color : #606060;
                 
border-color : #FFFFFF;
                    
border-width : 0pt;
                 
border-style : solid ;
                 
border: 0 solid;
                 
margin-top: 0px; 
                 
margin-right: 0px; 
                 
margin-bottom: 0px; 
                 
margin-left: 0px; 
                 
padding-top: 0px; 
                 
padding-right: 0px; 
                 
padding-bottom: 0px; 
                 
padding-left: 0px; 
                   
height: 14px;}

.
FieldOpc      {font-family : Arial ;
              
font-size : 7pt ;
               
background-color : #ECECEC;
              
Vertical-Align : Middle;
              
color : #303070;
              
vertical-align : middle;      
              
font-weight: lighter;
              
border: #CCCCCC; 
              
border-style: groove; 
              
border-top-width: 1px; 
              
border-right-width: 1px; 
              
border-bottom-width: 1px; 
              
border-left-width: 1px}

.
FieldObl      {font-family : Arial ;
              
font-size : 7pt ;
               
background-color : #CFD0E0;
              
Vertical-Align : Middle;
              
color : #303070;
              
vertical-align : middle;      
              
font-weight: lighter;
              
border: #CCCCCC; 
              
border-style: groove; 
              
border-top-width: 1px; 
              
border-right-width: 1px; 
              
border-bottom-width: 1px; 
              
border-left-width: 1px}

.
Botones     {cursor : hand ; 
                 
Background-color : transparent;
                 
vertical-align : middle;
                 
border-collapse : collapse;
              
margin-top : 0pt;
              
margin-bottom : 0pt;
              
border-style: none ;};

.
menu_sup     {font-family : Arial ;
               
font-size : 7pt ;
                
color : #CFD0E0;
              
}

.
menu_sup_sel {font-family : Arial ;
               
font-size : 7pt ;
                
color : #FFFFFF;
              
}
.
menu {  background-color: #FFFFFF; 
         
background-position: top; 
         
margin-top: 0px; 
         
margin-right: 0px; 
         
margin-bottom: 0px; 
         
margin-left: 0px; 
         
padding-top: 0px; 
         
padding-right: 0px; 
         
padding-bottom: 0px; 
         
padding-left: 0px; 
         
border: #FFFFFF; 
         
border-style: ridge; 
         
border-top-width: medium; 
         
border-right-width: medium; 
         
border-bottom-width: medium; 
         
border-left-width: medium}

button {        background-color: #9CBEDE;
                
font-size: 8pt;
                
font-weight: bold;
                
font-family: Arial;
                
line-height: 1em;
                
color: white;
                
cursor: pointer;
                
margin: 0;
                
padding: 0;
                
vertical-align: Middle;
                
text-align : center;
                
text-transform: capitalize;
                
text-decoration: none;
            }
.
datos_tab{         font-family: Arial; 
                    
background-color : white;
                    
Font-Size : 5pt ; 
                    
color : #606060;
                    
border-color : #FFFFFF;
                       
border-width : 0pt;
                    
border-style : solid ;
                    
border: 0 solid;
                    
margin-top: 0px; 
                    
margin-right: 0px; 
                    
margin-bottom: 0px; 
                    
margin-left: 0px; 
                    
padding-top: 0px; 
                    
padding-right: 0px; 
                    
padding-bottom: 0px; 
                    
padding-left: 0px; 
                      
height: 20px;
                    }

.
descripcion {
    
font-family: Arial, Helvetica, sans-serif;
    
font-size: 12px;
    
font-style: normal;
    
line-height: normal;
    
font-weight: normal;
    
font-variant: normal;
    
text-decoration: none;
    
border: thin none #FFFFFF;
}
.
table_consulta {
                 
border-width : 1pt;
              
border-color: #808080;
              
font-family: Arial;              
               
Font-Size : 7pt ; 
              
font-weight: none;
              
color : #595959;
              
background-color : #FFFFFF;
              
border-style : solid ;

             }
.
table.table_consulta th {font-weight: bold;
              
font-family: Arial; 
              
background-color : #3F7FB0;
              
color : white;
              
Font-Size : 7pt ; 
              
border-color : #FFFFFF;
                 
border-style : solid ;
              
border: 0 solid;
              
margin-top: 0px; 
              
margin-right: 0px; 
              
margin-bottom: 0px; 
              
margin-left: 0px; 
              
padding-top: 0px; 
              
padding-right: 0px; 
              
padding-bottom: 0px; 
              
padding-left: 0px; 
                
font-weight: none;

              } 
  #3 (permalink)  
Antiguo 13/03/2005, 18:52
 
Fecha de Ingreso: febrero-2004
Mensajes: 221
Antigüedad: 22 años, 7 meses
Puntos: 0
Ahora no tengo ganas de meter todo eso en un archivo, pero si lo pones en algun link capaz que te ayude.

Por empezar, no uses for-each, usa apply-templates.
En segundo lugar, explica un poco mejor que carajo queres.
  #4 (permalink)  
Antiguo 14/03/2005, 03:03
Avatar de KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 24 años, 9 meses
Puntos: 61
Vamos a XML!
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.
  #5 (permalink)  
Antiguo 14/03/2005, 14:48
 
Fecha de Ingreso: febrero-2005
Mensajes: 198
Antigüedad: 21 años, 7 meses
Puntos: 5
Ahi teneis la pagina web, para que le hecheis un vistazo

http://webs.ono.com/usr004/jobegor/reclamacion.html
  #6 (permalink)  
Antiguo 14/03/2005, 21:02
 
Fecha de Ingreso: abril-2004
Ubicación: Juli - Puno - Perú
Mensajes: 51
Antigüedad: 22 años, 5 meses
Puntos: 0
Hola Occiso u ocioso?, jejejeje
Bueno te he ayudado a reconstruir tu xml para que sea mas presentable y su plantilla xsl también está modificada, supongo que es algo así como quieres eh??
http://webs.demasiado.com/radiocampe...eclamacion.xml
pero eso es lo que he podido entender, si fuera otra cosa que quieres, me avisas para hacer la modificación.

Saludos
__________________
Juli - La Pequeña Roma Aymara
  #7 (permalink)  
Antiguo 16/04/2005, 16:21
 
Fecha de Ingreso: febrero-2005
Mensajes: 198
Antigüedad: 21 años, 7 meses
Puntos: 5
Mas vale tarde que nunca y agradezco tu respuesta, aunque he tardado tanto en contestar porque solucione el problema de otra manera y no volvi a mirar el foro. Fue un quebradero de cabeza y quise olvidarme de él lo antes posible.


Sin embargo ahora vuelvo ha estar en las mismas, sin embargo el haber mirado este mensaje me ayudará a encontrar una solucion


saludos.
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 17:19.