I'm sorry but I gotta ask you this...is there an easy and elegant way to write this..a not closed/closing div tag whose attribute needs to be changed if it is the first or not:
Since the div inside is not self-closing, in fact it has a big deal of html inside, I wouldn't want to use the xsl:attribute and then put all of that html after attribute assigning construct...TIA
I don't really understand the problem, could you elaborate? I don't get why this won't work for you...
<divclass="slide"> <xsl:iftest="position() <= 1"> <xsl:attributename="class">slide first</xsl:attribute> </xsl:if> Massive bit of HTML </div>
Is the problem that you have dublicate instances of the code? Then maybe you should be refactoring your xslt to use more templates (call-template, apply-templates)?
It will work, I high fived for it, however I was hoping there could be some other attribute value assign mechanism in XSLT...since I'm an XSLT n00b...thus call-template, apply-templates are a bit over my head for now, though I wrote a couple of those by example.
Will look into those within xsl:for-each contrsuct just as soon as I can.
Change div tag's attribute based on position()
Hi guys,
I'm sorry but I gotta ask you this...is there an easy and elegant way to write this..a not closed/closing div tag whose attribute needs to be changed if it is the first or not:
Since the div inside is not self-closing, in fact it has a big deal of html inside, I wouldn't want to use the xsl:attribute and then put all of that html after attribute assigning construct...TIA
P.S.
Is SQL CE 4 umbraco version coming soon?
This should do it:
Regards,
Magnus
You can get even shorter:
/Chriztian
Thanks guys...it's just I was trying to avoid the "inside div code..." part...since that's massive.
Oh well, indenting with tabs is no more an option.
I don't really understand the problem, could you elaborate? I don't get why this won't work for you...
Is the problem that you have dublicate instances of the code? Then maybe you should be refactoring your xslt to use more templates (call-template, apply-templates)?
Hi Magnus,
It will work, I high fived for it, however I was hoping there could be some other attribute value assign mechanism in XSLT...since I'm an XSLT n00b...thus call-template, apply-templates are a bit over my head for now, though I wrote a couple of those by example.
Will look into those within xsl:for-each contrsuct just as soon as I can.
Thanks all the same though.
is working on a reply...