It won't do any good to output the Content control tags from the macro - at that point they're just text rendered to the page, so they wouldn't be picked up by the server process... (I would be very surprised if that worked).
Is the datatype in the Macro or is it on the Document Type? If it's on the document you can use inline XSLT (or a simple Item control) to output the value... ?
XSLT Validation - Opening Tag Only
Hi,
Im looking to apply a class to a div by using a macro, with a dropdown list datatype.
The div that i want to apply a class to looks like this.
I have tried to output the first part of the <div class="content"> within the macro, but i am getting a validation error for not closing the div.
Any ideas on how i can output the first part of the div within the macro? or is this even a good idea to do it this way?
Hi Martin,
You cant do that in a nice way - you *can* set your XSLT to output "text" only, e.g. like this:
(Please not that you need to put your own condition in the test="" attribute — mine will definitely fail :-)
/Chriztian
Hi Criztian,
Thanks for the reply, although im looking to apply the class on the content div, using the datatype with a dropdown.
Could the asp content placeholder be outputted through the CDATA method you posted?
Is there any issue that would arise from that?
Hi Martin,
It won't do any good to output the Content control tags from the macro - at that point they're just text rendered to the page, so they wouldn't be picked up by the server process... (I would be very surprised if that worked).
Is the datatype in the Macro or is it on the Document Type? If it's on the document you can use inline XSLT (or a simple Item control) to output the value... ?
/Chriztian
Hi Chriztian
I created a simple datatype using the dropdown list property editor. It has a 3 values that represent the class values.
Ive used the datatype inside document type.
I was tryng to apply the class using a macro with a simple attribute call.
<xsl:output method="html" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:variable name="class" select="$currentPage/ancestor-or-self::*/selectClass"/>
<xsl:template match="/">
<div class="content">
<xsl:if test="$class !=''">
<xsl:attribute name="class">
<xsl:value-of select="$class"/>
</xsl:attribute>
</xsl:if>
</div>
</xsl:template>
* sorry the forum code styling has gone missing.
Thanks Chriztain. got it working using the inline method
is working on a reply...