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: 19 años, 2 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: 19 años, 2 meses
Puntos: 5
css
Código PHP:
body        {font-familyArial;
            
font-size8px
            
font-stylenormal
            
line-heightnormal
            
font-weightnormal
            
color#535353; 
            
background-color#FFFFFF;
            
margin-top 5pt;
            
margin-left 3pt;
            }

.
pest_actizq margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
width6px;
               
height15px;
               
background-imageurl(../img/pest_izq_b.gif);
               
background-repeatno-repeat;
               
background-positionbottom;
             }

.
pest_actder margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
width15px;
               
height15px;
               
background-imageurl(../img/pest_der_b.gif);
               
background-repeatno-repeat;
               
background-positionbottom;
             }

.
pest_actcen {
               
font-size:11;
               
margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
height15px;
               
background-image:url(../img/punto_b.gif);
               
background-repeat:repeat-x;
               
background-positionbottom;
             }

.
pest_desizq margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
width6px;
               
height15px;
               
background-imageurl(../img/pest_izq_a.gif);
               
background-repeatno-repeat;
               
background-positionbottom;
             }

.
pest_desder margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
width15px;
               
height15px;
               
background-imageurl(../img/pest_der_a.gif);
               
background-repeatno-repeat;
               
background-positionbottom;
             }

.
pest_descen {
               
font-size:11;
               
margin-bottom0px;
               
padding-bottom0px;
               
vertical-alignbottom;
               
colorwhite;
               
height15px;
               
background-image:url(../img/punto_a.gif);
               
background-repeat:repeat-x;
               
background-positionbottom;
             }

.
tmenu {background-color#3F7FAF; 
            
font-familyArial;              
             
Font-Size 8pt 
            
font-weightbold;
            
color white;
            
text-align left;
            
border-color #FFFFFF;
             
border-width 0px;
            
margin-top0px
             
margin-right0px
             
margin-bottom0px
              
margin-left0px
            
padding-top0px
            
padding-right0px
            
padding-bottom0px
            
padding-left0px;}

.
table_col    {border-style solid ;
                
border-width 2;
             
border-color#407090;
             
font-familyArial;              
              
Font-Size 8pt 
             
font-weightbold;
             
color #595959;
             
background-color #EEEEEE;
             
width100%;
             
height95%;              
             }

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

.
table_interior {border-style solid ;
                    
border-width 1pt;
                 
border-color#808080;
                 
font-familyArial;              
                  
Font-Size 8pt 
                 
font-weightnone;
                 
color #595959;
                 
background-color #FFFFFF;
                 
width95%;
                 
height95%;    
                }

.
table_datos {border-style solid ;
                 
border-width 1pt;
              
border-color#808080;
              
font-familyArial;              
               
Font-Size 8pt 
              
font-weightnone;
              
color #595959;
              
background-color #FFFFFF;
             
}

.
table.table_datos th {font-weightbold;
              
font-familyArial
              
background-color #3F7FB0;
              
color white;
              
Font-Size 8pt 
              
border-color #FFFFFF;
                 
border-width 0pt;
              
border-style solid ;
              
border0 solid;
              
margin-top0px
              
margin-right0px
              
margin-bottom0px
              
margin-left0px
              
padding-top0px
              
padding-right0px
              
padding-bottom0px
              
padding-left0px
                
height20px;
              }

.
table.table_datos td    {font-familyArial
                    
background-color white;
                    
Font-Size 8pt 
                    
color #606060;
                    
border-color #FFFFFF;
                       
border-width 0pt;
                    
border-style solid ;
                    
border0 solid;
                    
margin-top0px
                    
margin-right0px
                    
margin-bottom0px
                    
margin-left0px
                    
padding-top0px
                    
padding-right0px
                    
padding-bottom0px
                    
padding-left0px
                      
height20px;
                    }

.
table_list    {width100%;
                
border0px 0 none;
                
margin-top0px
                
margin-right0px
                
margin-bottom0px
                
margin-left0px
                
padding-top0px
                
padding-right0px
                
padding-bottom0px
                
padding-left0px;
                
background-color#FFFFFF;
               
}

.
table.table_list th {font-weightbold;
              
font-familyArial
              
background-color #3F7FB0;
              
color white;
              
Font-Size 8pt 
              
border-color #FFFFFF;
                 
border-width 0pt;
              
border-style solid ;
              
border0 solid;
              
margin-top0px
              
margin-right0px
              
margin-bottom0px
              
margin-left0px
              
padding-top0px
              
padding-right0px
              
padding-bottom0px
              
padding-left0px
                
height14px;
              }

.
celda_list_par {font-familyArial
                 
background-color #9FAFCF;
                 
Font-Size 8pt 
                 
color white;
                 
border-color #FFFFFF;
                    
border-width 0pt;
                 
border-style solid ;
                 
border0 solid;
                 
margin-top0px
                 
margin-right0px
                 
margin-bottom0px
                 
margin-left0px
                 
padding-top0px
                 
padding-right0px
                 
padding-bottom0px
                 
padding-left0px
                   
height14px;
              }

.
celda_list_imp {font-familyArial
                 
background-color #ECECEC;
                 
Font-Size 8pt 
                 
color #606060;
                 
border-color #FFFFFF;
                    
border-width 0pt;
                 
border-style solid ;
                 
border0 solid;
                 
margin-top0px
                 
margin-right0px
                 
margin-bottom0px
                 
margin-left0px
                 
padding-top0px
                 
padding-right0px
                 
padding-bottom0px
                 
padding-left0px
                   
height14px;}

.
celda_list_sel {font-familyArial
                 
background-color #E3C5C5;
                 
cursor hand 
                 
Font-Size 8pt 
                 
color #606060;
                 
border-color #FFFFFF;
                    
border-width 0pt;
                 
border-style solid ;
                 
border0 solid;
                 
margin-top0px
                 
margin-right0px
                 
margin-bottom0px
                 
margin-left0px
                 
padding-top0px
                 
padding-right0px
                 
padding-bottom0px
                 
padding-left0px
                   
height14px;}

.
FieldOpc      {font-family Arial ;
              
font-size 7pt ;
               
background-color #ECECEC;
              
Vertical-Align Middle;
              
color #303070;
              
vertical-align middle;      
              
font-weightlighter;
              
border#CCCCCC; 
              
border-stylegroove
              
border-top-width1px
              
border-right-width1px
              
border-bottom-width1px
              
border-left-width1px}

.
FieldObl      {font-family Arial ;
              
font-size 7pt ;
               
background-color #CFD0E0;
              
Vertical-Align Middle;
              
color #303070;
              
vertical-align middle;      
              
font-weightlighter;
              
border#CCCCCC; 
              
border-stylegroove
              
border-top-width1px
              
border-right-width1px
              
border-bottom-width1px
              
border-left-width1px}

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

.
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-positiontop
         
margin-top0px
         
margin-right0px
         
margin-bottom0px
         
margin-left0px
         
padding-top0px
         
padding-right0px
         
padding-bottom0px
         
padding-left0px
         
border#FFFFFF; 
         
border-styleridge
         
border-top-widthmedium
         
border-right-widthmedium
         
border-bottom-widthmedium
         
border-left-widthmedium}

button {        background-color#9CBEDE;
                
font-size8pt;
                
font-weightbold;
                
font-familyArial;
                
line-height1em;
                
colorwhite;
                
cursorpointer;
                
margin0;
                
padding0;
                
vertical-alignMiddle;
                
text-align center;
                
text-transformcapitalize;
                
text-decorationnone;
            }
.
datos_tab{         font-familyArial
                    
background-color white;
                    
Font-Size 5pt 
                    
color #606060;
                    
border-color #FFFFFF;
                       
border-width 0pt;
                    
border-style solid ;
                    
border0 solid;
                    
margin-top0px
                    
margin-right0px
                    
margin-bottom0px
                    
margin-left0px
                    
padding-top0px
                    
padding-right0px
                    
padding-bottom0px
                    
padding-left0px
                      
height20px;
                    }

.
descripcion {
    
font-familyArialHelveticasans-serif;
    
font-size12px;
    
font-stylenormal;
    
line-heightnormal;
    
font-weightnormal;
    
font-variantnormal;
    
text-decorationnone;
    
borderthin none #FFFFFF;
}
.
table_consulta {
                 
border-width 1pt;
              
border-color#808080;
              
font-familyArial;              
               
Font-Size 7pt 
              
font-weightnone;
              
color #595959;
              
background-color #FFFFFF;
              
border-style solid ;

             }
.
table.table_consulta th {font-weightbold;
              
font-familyArial
              
background-color #3F7FB0;
              
color white;
              
Font-Size 7pt 
              
border-color #FFFFFF;
                 
border-style solid ;
              
border0 solid;
              
margin-top0px
              
margin-right0px
              
margin-bottom0px
              
margin-left0px
              
padding-top0px
              
padding-right0px
              
padding-bottom0px
              
padding-left0px
                
font-weightnone;

              } 
  #3 (permalink)  
Antiguo 13/03/2005, 18:52
 
Fecha de Ingreso: febrero-2004
Mensajes: 221
Antigüedad: 20 años, 2 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: 22 años, 4 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: 19 años, 2 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: 20 años
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: 19 años, 2 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 14:26.