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

RE: newbie question: how do get node names

Subject: RE: newbie question: how do get node names
From: "Kielen, Agnes" <Agnes.Kielen@xxxxxxxxxxxxxx>
Date: Tue, 10 Aug 2004 13:09:34 +0200
xml get node name
Hi,
Try this stylesheet:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.w3.org/1999/xhtml">
<xsl:template match="/window">
<html>
<head>
  <title>Node Names List</title>
</head>
<body>
   <xsl:apply-templates select="Title"/>
   <blockquote>Authors<xsl:apply-templates select="Authors/Author"/>
   </blockquote>
   <blockquote><xsl:apply-templates select="test1/test2"/></blockquote>
</body>
</html>
</xsl:template>
<xsl:template match="Author | test2  | Title">
   <blockquote><xsl:value-of select="."/></blockquote>
</xsl:template>

</xsl:stylesheet>

Cheers,
Agnes

-----Original Message-----
From: Anko Lamb [mailto:mewphobia@xxxxxxxxxxxxxx]
Sent: dinsdag 10 augustus 2004 7:51
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  newbie question: how do get node names


Hi,
Basically I have a file like this;
---------------------------------
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="cowdata.xsl"?>
<window>
  <Title>My Article</Title>
  <Authors>
    <Author>Mr. 1</Author>
    <Author>Mr. 2</Author>
    <Author>Mr. 3</Author>
    <Author>Mr. 4</Author>
  </Authors>
  <test1>
    <test2>hi man</test2>
  </test1>
</window>
---------------------------------
and I want to transform it to
---------------------------------
<?xml version="1.0"?>
<?xml-stylesheet href="cow.css" type="text/css"?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Node Names List</title>
</head>
<body>
<blockquote>window
  <blockquote>Title

  </blockquote>
  <blockquote>Authors
    <blockquote>Author</blockquote>
    <blockquote>Author</blockquote>
    <blockquote>Author</blockquote>
    <blockquote>Author</blockquote>
  </blockquote>
  <blockquote>test1
      <blockquote>test2</blockquote>
  </blockquote>
</blockquote>
</body>
</html>
---------------------------------
It should be pretty simple - I can list all the node text elements
easily, but I can't find a way to move the nodeNames into the text.

Any ideas or suggestions would be greatly appreciated!
I'm using XSLT Processor VersionVendor: TransformiixVendor URL:
              http://www.mozilla.org/projects/xslt/

Anko

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.