File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes xslt beginner Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xslt beginner" Watch "xslt beginner" New topic

xslt beginner

Rex Rock
Ranch Hand

Joined: Jun 25, 2001
Posts: 82
Hi folks,
I'm totally new to xml,xslt and the related technologies. I've a small xml file and .xsl file, but something seems to be wrong, am not getting the desired output. Can someone point out wat mistake am doing?
xml file is :

My .XSL file is

The output i get is

I was hoping to get

Hema Menon
Ranch Hand

Joined: Oct 29, 2000
Posts: 569
Try this
<xsl:stylesheet version = '1.0' xmlns:xsl=''><xsl:template match="/">
<xsl:for-each select="//one">
<xsl:value-of select="Author"/>
<xsl:value-of select="School"/>
This should get you what you need. From the root level you are looking for <one>which could have zero or more elements in between and then you select author and school for each.

wood burning stoves
subject: xslt beginner
Similar Threads
XSLT and embedded tags in text.
Problem with using PrintWriter inside a JSP
xmlns and xsl
Newbie problem with XSLT
Using XSL to display XML