[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

how to extrac some child nodes and show. please help m

Subject: how to extrac some child nodes and show. please help me. thanks
From: "Dionisio Ruiz de Zarate" <dionisio@xxxxxxxxxxxxx>
Date: Mon, 8 Sep 2003 00:59:00 +0200
xsl child nodes
Hello i have the bello xml file and i have one great problem (for me). I am
working with this problem during 2 weeks and i dont solve it.
this is one resourcefull problem.
In the below xml i have some nodes and into each node can be one or x child
nodes.
i want to show the xml file in this method:
id 1.1 nombre 1.1 apellido 1.1
id 2.1 nombre 2,1 apellido 2.1
- id 2.1.1 nombre 2.1.1 apellido 2.1.1
--  id 2.1.1.1 nombre 2.1.1.1 apellido 2.1.1.1
id 2.2 nombre 2.2 apellido 2.2

<?xml version="1.0" encoding="ISO-8859-1"?>
<registros>
 <padre>
  <id_cliente>id 1.1</id_cliente>
  <id_padre>padre 1.1</id_padre>
  <nombre_cliente>nombre 1.1</nombre_cliente>
  <apellido_cliente>apellido 1.1</apellido_cliente>
   </padre>
   <padre>
     <id_cliente>id 2.1</id_cliente>
     <id_padre>padre 2.1</id_padre>
     <nombre_cliente>nombre 2.1</nombre_cliente>
     <apellido_cliente>apellido 2.1</apellido_cliente>
         <hijo>
         <id_cliente>id 2.1.1</id_cliente>
         <id_padre>padre 2.1.1</id_padre>
         <nombre_cliente>nombre 2.1.1</nombre_cliente>
         <apellido_cliente>apellido 2.1.1</apellido_cliente>
            <hijo>
               <id_cliente>id 2.1.1.1</id_cliente>
               <id_padre>padre 2.1.1.1</id_padre>
               <nombre_cliente>jnombre 2.1.1.1</nombre_cliente>
               <apellido_cliente>apellido 2.1.1.1</apellido_cliente>
           </hijo>
         </hijo>
         <hijo>
         <id_cliente>id 2.2</id_cliente>
         <id_padre>padre 2.2</id_padre>
         <nombre_cliente>nombre 2.2</nombre_cliente>
         <apellido_cliente>apellido 2.2</apellido_cliente>
        </hijo>
    </padre>
</registros>


the are some padre nodes and inside of these nodes can be some (x) hijo
nodes and inside od these nodes x hijo nodes.

Can you help me please for solving this problem?
i am trying for solving whith this XSL file but it doesn't show well.:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">

<xsl:for-each select="//padre">
<xsl:value-of select="id_cliente"
disable-output-escaping="yes"/>&#xa0;<xsl:value-of select="nombre_cliente"
disable-output-escaping="yes"/><xsl:value-of select="apellido_cliente"
disable-output-escaping="yes"/></td>
<xsl:apply-templates select="HIJOS"/>
</xsl:for-each>
</xsl:template>

<xsl:template match="//hijo" name="HIJOS">
-&#xa0;<xsl:value-of select="id_cliente"
disable-output-escaping="yes"/>&#xa0;<xsl:value-of select="nombre_cliente"
disable-output-escaping="yes"/><xsl:value-of select="apellido_cliente"
disable-output-escaping="yes"/></
<xsl:apply-templates select="HIJOS" >
</xsl:apply-templates>

</xsl:template>



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.