J
Jason Lehman
I want to depending on a parameter in the XML change wether the div should
display or not. Do I have to repeat the whole block in two if containers
with the style display:none and one with display:block but then whenever I
have to make a change to the block I have to update in two places? Any help
would be appreciated.
My example:
<xsl:if test="RequirementGroup/@ReqMet = "Y"">
<div style="display:none;margin-left:1em;" id="Area_Info{$intArea_Info}">
<xsl:if test="string-length(Code) > 0">
<br />Code:<xsl:for-each select="Code">
<xsl:apply-templates />
</xsl:for-each>
</xsl:if>
<br />
<span style="background-color:#336633; color:#FFFFFF; width:100%;
">Requirement Group:</span>
<xsl:apply-templates select="RequirementGroup" />
<br />Course Group:<xsl:apply-templates select="CourseGroup" />
<xsl:if test="string-length(Review) > 0">
<br />Review: <xsl:apply-templates select="Review" />
</xsl:if>
<br />Summary: <xsl:apply-templates select="Summary" />
<br />
</div>
</xsl:if>
<xsl:if test="RequirementGroup/@ReqMet = "N"">
<div style="display:block;margin-left:1em;" id="Area_Info{$intArea_Info}">
<xsl:if test="string-length(Code) > 0">
<br />Code:<xsl:for-each select="Code">
<xsl:apply-templates />
</xsl:for-each>
</xsl:if>
<br />
<span style="background-color:#336633; color:#FFFFFF; width:100%;
">Requirement Group:</span>
<xsl:apply-templates select="RequirementGroup" />
<br />Course Group:<xsl:apply-templates select="CourseGroup" />
<xsl:if test="string-length(Review) > 0">
<br />Review: <xsl:apply-templates select="Review" />
</xsl:if>
<br />Summary: <xsl:apply-templates select="Summary" />
<br />
</div>
</xsl:if>
display or not. Do I have to repeat the whole block in two if containers
with the style display:none and one with display:block but then whenever I
have to make a change to the block I have to update in two places? Any help
would be appreciated.
My example:
<xsl:if test="RequirementGroup/@ReqMet = "Y"">
<div style="display:none;margin-left:1em;" id="Area_Info{$intArea_Info}">
<xsl:if test="string-length(Code) > 0">
<br />Code:<xsl:for-each select="Code">
<xsl:apply-templates />
</xsl:for-each>
</xsl:if>
<br />
<span style="background-color:#336633; color:#FFFFFF; width:100%;
">Requirement Group:</span>
<xsl:apply-templates select="RequirementGroup" />
<br />Course Group:<xsl:apply-templates select="CourseGroup" />
<xsl:if test="string-length(Review) > 0">
<br />Review: <xsl:apply-templates select="Review" />
</xsl:if>
<br />Summary: <xsl:apply-templates select="Summary" />
<br />
</div>
</xsl:if>
<xsl:if test="RequirementGroup/@ReqMet = "N"">
<div style="display:block;margin-left:1em;" id="Area_Info{$intArea_Info}">
<xsl:if test="string-length(Code) > 0">
<br />Code:<xsl:for-each select="Code">
<xsl:apply-templates />
</xsl:for-each>
</xsl:if>
<br />
<span style="background-color:#336633; color:#FFFFFF; width:100%;
">Requirement Group:</span>
<xsl:apply-templates select="RequirementGroup" />
<br />Course Group:<xsl:apply-templates select="CourseGroup" />
<xsl:if test="string-length(Review) > 0">
<br />Review: <xsl:apply-templates select="Review" />
</xsl:if>
<br />Summary: <xsl:apply-templates select="Summary" />
<br />
</div>
</xsl:if>