[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] Problem with attributes
Subject: Re: [xsl] Problem with attributes From: "Seema Kumar" <2kseema@xxxxxxxxxxxxxxxxxxxx> Date: Fri, 25 May 2001 16:39:16 +0530 |
Hi !! Thanks a lot for all the help . It works fine now, with the correct namespace. Got one more query, How would you represent the attribute value of the parent of the current node ? I tried something like this, but the attribute portion did not work :-( <xsl:for-each select="volume"> <a> <xsl:attribute name="href"> XMLGenServlet1? parent=<xsl:value-of select="name(parent::node())" />, parentnum=<xsl:value-of select="parent::@node" /> </xsl:attribute> <xsl:value-of select ="title"/><br/> </a> </xsl:for-each> I guess I'm missing out on the syntax, please help. Regards, Seema Kumar ----- Original Message ----- From: "Student1 ASCO-ELK (RBJE/ELK)" <Student1.ASCO-ELK@xxxxxxxxxxxx> To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Friday, May 25, 2001 3:17 PM Subject: RE: [xsl] Problem with attributes > ok i think i have it, and i hope it works on your computer as well ;) > > stylesheet: > <?xml version='1.0'?> > <xsl:stylesheet version='1.0' > xmlns:xsl='http://www.w3.org/1999/XSL/Transform'> > <xsl:template match='/'> > <html><body> > <xsl:for-each select='//volume'> > <a> > <xsl:attribute name='href'>XMLGenServlet1?num=<xsl:value-of > select='@no'/> > <xsl:value-of select='name'/></xsl:attribute> > <xsl:value-of select='title'/><br/> > </a> > </xsl:for-each> > </body></html> > </xsl:template> > </xsl:stylesheet> > > hope that helps ;) > cu goose > > > -----Original Message----- > From: Seema [mailto:2kseema@xxxxxxxxxxxxxxxxxxxx] > Sent: Friday, May 25, 2001 5:21 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] Problem with attributes > > > Hi !! > > I just tried out the xsl with the new namespace you had referred to, but > again it gives me problems. > Right now, my links do not appear in the page and it just gives me : > XMLGenServlet1?num= > in place of them. > I am using ie5.5 for the same. > Will there be any specific xml parser version I may have to download and > install ? > Please help me with this. > My current xsl looks like this : > > ?xml version="1.0"?> > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:template match="/"> > <xsl:for-each select="volume"> > > <a> > <xsl:attribute name="href"> > XMLGenServlet1?num=<xsl:value-of select="@no" />, > <xsl:value-of select="name" /> > </xsl:attribute> > <xsl:value-of select ="title"/><br/> > </a> > </xsl:for-each> > </html> > </xsl:template> > </xsl:stylesheet> > > > > > Regards, > Seema Kumar > Datamatics Technologies Ltd., > (Tel: 8290829 (Ext:619)) > ----- Original Message ----- > From: "Student1 ASCO-ELK (RBJE/ELK)" <Student1.ASCO-ELK@xxxxxxxxxxxx> > To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> > Sent: Thursday, May 24, 2001 5:57 AM > Subject: RE: [xsl] Problem with attributes > > > > hi, > > if you have the problem with "unkown function" then you should > > change your namespace delaration at the start of your xsl document. > > i think you have something like: > > > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl"> > > > > this one is obsolete,but ie5 uses it (thx to microsoft), > > but to use the name() function you should have: > > > > <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > > > > so just change it,and if you are using the ie5 as your browser, then you > > should perhaps go to www.microsoft.com and look for msxml to get the > latest > > update on their xml/xsl parser. > > your code seems to be correct, so i think ( and mike kay too ;) ) the > > problem is the namespacedeclaration. > > > > hope i could help you > > regards goose > > > > -----Original Message----- > > From: Seema [mailto:2kseema@xxxxxxxxxxxxxxxxxxxx] > > Sent: Wednesday, May 23, 2001 7:55 PM > > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > > Subject: Re: [xsl] Problem with attributes > > > > > > Hi ! > > > > Thanks for your solution. It worked !! > > One more help please... > > If I also want to pass the name of the current node, such as 'volume' or > > 'chapter', how do I do it in my xsl ? > > I tried using the name() function, but it gave me an error saying > > "Unknown function". > > This is the code I used : > > > > <xsl:for-each select="volume"> > > <a> > > <xsl:attribute name="href"> > > XMLGenServlet1?num=<xsl:value-of select="@no" />, > > node=<xsl:value-of select="name()" /> > > </xsl:attribute> > > <xsl:value-of select ="title"/><br/> > > </a> > > > > Thanks in advance. > > > > Regards, > > Seema Kumar > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > > 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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] Problem with attributes, Student1 ASCO-ELK (R | Thread | Re: [xsl] Problem with attributes, Jeni Tennison |
Re: Fwd: Re: [xsl] element nodes in, Wendell Piez | Date | [xsl] Re:Re:How to robustly handle , Yang |
Month |