![]() |
![]() | ![]() | ![]() | Altova Mailing List Archives>Archive Index >microsoft.public.xsl Archive Home >Recent entries >Thread Prev - Write DIV tag with xml / javascript >Thread Next - Re: Write DIV tag with xml / javascript Re: Write DIV tag with xml / javascriptTo: NULL Date: 12/4/2006 9:59:00 AM
"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="tab1" style="display:none;">
> <table class="Table0"><tr><td
> style="border-width:1;border-style:solid;">
> <a href="{@Link}" class="cell0"
> style="padding-left=8px;"><xsl:value-of select="@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='tab" + Counter + "'
> style='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="tab{position()}" ...
OR
use and outer DIV with ID="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 | |||||
|
