![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Re: Write DIV tag with xml / javascript [Thread Next] Re: Write DIV tag with xml / javascriptTo: NULL Date: 12/4/2006 4:25:00 PM
Works fine
Thank you so much Anthony.
Anthony Jones a =E9crit :
> "lucky" <lfelix@n...> wrote in message
> news:1165221236.255156.246570@j......
> > Hi,
> >
> > I'm just starting to learn XML and I have a problem I've been trying to
> > solve for a while now.
> >
> > For each item in my XML file, I need to write a DIV tag with an ID
> > attribute that will have the value of "tab1", "tab2", "tab3"....
> >
> > So the result should be something like
> >
> > <div ID=3D"tab1" style=3D"display:none;">
> > <table class=3D"Table0"><tr><td
> > style=3D"border-width:1;border-style:solid;">
> > <a href=3D"{@Link}" class=3D"cell0"
> > style=3D"padding-left=3D8px;"><xsl:value-of select=3D"@Title"/></a>
> > </td></tr></table>
> > </div>
> >
> > With the ID attribute of the DIV tab being incremented for every item.
> >
> > I've tried to write the <Div.....> line with javascript
> > -> document.write ("<div ID=3D'tab" + Counter + "'
> > style=3D'display:none;'> ")
> > but there is no way I can make it working.
> >
> > I tried to use the <xsl:number> element but nothing good came out
> > neither.
> >
> > Any idea?
> >
> > Thanks
> >
> > Luke
> >
>
> Try:-
>
> <div ID=3D"tab{position()}" ...
>
> OR
>
> use and outer DIV with ID=3D"tabs" and access the tab DIVs with
> document.getElementByID('tabs').childNodes[n] where n is the index number
> starting with 0.
| ![]() | ![]() | ![]() |
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | |||||
|
