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

RE: how to deal with uncertain node name in xsl?

Subject: RE: how to deal with uncertain node name in xsl?
From: Jarno.Elovirta@xxxxxxxxx
Date: Fri, 22 Nov 2002 09:33:48 +0200
xslt value of node name
Hi,

>     I need help on the following problem.  Any suggestions?
> 
>       Thanks in Advance.
> 
>       glliu
>   
>   
>     xml file: I do not know the sub node name and number of  
> <A>,how can i convert the xml  to html in xsl?
> 
>     <A>
>                 <..>node value</..>
>                 <...>node value</...>
>                 <....>node value</...>
>                  ......
>                  ......
>    </A>

Could you show us your desired output? Since

<xsl:template match="/">
  <html>
    <head><title>foo</title></head>
    <body>
      <xsl:apply-templates select="decendant::A" />
    </body>
  </html>
</xsl:template>

<xsl:template match="A">
  <ul>
    <xsl:for-each select="*">
      <li>
        <xsl:value-of select="." />
      </li>
    </xsl:for-each>
  </ul>
</xsl:template>

would transform the input into HTML, but probably not the kind you want. Anyhow, if you didn't know how to match an element without knowing it's name, use * and see <http://localhost/tr/xpath/#node-tests>.

Cheers,

Jarno

 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.