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

Re: Getting name of and element

Subject: Re: Getting name of and element
From: "cutlass" <cutlass@xxxxxxxxxxx>
Date: Fri, 16 Nov 2001 13:10:48 -0000
xslt getting name of element
Hello Ragulf,

here are some online tutorials which should help

www.zvon.org
www.topxml.com

www.bayes.co.uk

www.dpawson.co.uk

and i would heartedly suggest obtaining any of the good books that are out
there, esp. Michael Kay's XSLT Prg Reference.

u may find that simple questions get answered quickly here, almost too
quickly i think, but consistent posting of basic type questions may illicit
grumbles.


good luck, jim fuller

----- Original Message -----
From: "Ragulf Pickaxe" <jawxml@xxxxxxxxxxx>
To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Friday, November 16, 2001 1:05 PM
Subject: RE:  Getting name of and element


> Well, first it seems that I am a bit slow, perhaps :(
>
> I did write "name()" in my code, not just "name" as I did here.
>
> The problem with when to use the differnt XPath(?) expressions is that I
> don't know what is legal and what isn't. Or even worse, I don't know which
> effect any expression but the simplest has, and if the result is nothing,
I
> don't know what is wrong and therefore not how to correct it.
> I have not seen any tutorials that can give me any good understanding of
> this (me being slow and all that).
>
> I have tried erading the posts on this list, but it seems that you realy
> have totry things out yourself before you find that you can't do them like
> you want to :(
>
> Well, I did find the name of my root-element and my code works now, using
> your answers here. Thank you all for your patience.
>
> Ragulf Pickaxe :)
>
> >From: "Chris Bayes" <chris@xxxxxxxxxxx>
> >Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> >To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> >Subject: RE:  Getting name of and element
> >Date: Fri, 16 Nov 2001 12:46:15 -0000
> >
> >Ragulf,
> >I think this is an off topic question. Maybe the opticians list can help
> >you ;-)
> >Your code
> >XXX<xsl:value-of select="name"/>YYY <br/>
> >My code
> >    <xsl:value-of select="name()" />
> >
> > > By the way, is there a diffrence between
> > > <xsl:template match="/"> that I use and
> > > <xsl:template match="/*"> that you use?
> > >
> >Mike/David just answered that although not that *specific* question
> >Mike> "/*" selects all the ELEMENT children of the root node (in a
> >well-formed document there will be exactly one)
> >David> I used * rather than an explicit name as (I think I remember)
> >that you explictly said that the top level element may have one of
> >several names in your situation.
> >
> >Ciao Chris
> >
> >XML/XSL Portal
> >http://www.bayes.co.uk/xml
> >
> >
> > > -----Original Message-----
> > > From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of
> > > Ragulf Pickaxe
> > > Sent: 16 November 2001 12:11
> > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > Subject: RE:  Getting name of and element
> > >
> > >
> > > Well, the problem is that I actually have code that tries to
> > > do this like: <xsl:template match="/"> XXX<xsl:value-of
> > > select="name"/>YYY <br/> ... Which output in the start of the
> > > result: XXXYYY (meaning that it doesn't get any value, but
> > > the rest of the document is
> > > output, so there does exist nodes).
> > >
> > > What is wrong here?
> > >
> > >
> > > By the way, is there a diffrence between
> > > <xsl:template match="/"> that I use and
> > > <xsl:template match="/*"> that you use?
> > >
> > > Hope you can help me
> > > Ragulf :)
> > >
> > >
> > >
> > > >From: "Chris Bayes" <chris@xxxxxxxxxxx>
> > > >Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> > > >To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx>
> > > >Subject: RE:  Getting name of and element
> > > >Date: Fri, 16 Nov 2001 11:27:48 -0000
> > > >
> > > >Pickaxe,
> > > ><?xml version="1.0" ?>
> > > ><test att1="" att2="" att3="">
> > > ></test>
> > > >
> > > ><?xml version="1.0"?>
> > > ><xsl:stylesheet version="1.0"
> > > >xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > > > <xsl:output method = "html" encoding="Windows-1252" />
> > > >
> > > > <xsl:template match="/*">
> > > > <html>
> > > > <head></head>
> > > > <body>My top level element is <xsl:value-of
> > > >select="name()" /><br/>
> > > >   It's attributes are <xsl:for-each
> > > >select="@*">
> > > >   <xsl:value-of select="name()" />
> > > >   </xsl:for-each>
> > > > </body>
> > > > </html>
> > > > </xsl:template>
> > > ></xsl:stylesheet>
> > > >
> > > >Ciao Chris
> > > >
> > > >XML/XSL Portal
> > > >http://www.bayes.co.uk/xml
> > >
> > >
> > > _________________________________________________________________
> > > Get your FREE download of MSN Explorer at
> > > http://explorer.msn.com/intl.asp
> > >
> > >
> > >  XSL-List info and
> > > archive:  http://www.mulberrytech.com/xsl/xsl-list
> > >
> > >
> >
> >
> >  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
> >
>
>
> _________________________________________________________________
> Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.