Results 1 to 2 of 2

Thread: xsl not working

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    xsl not working

    below is an excert from an xsl i am writing.

    the xsl tests to see if varSTatus = new and tries to apply two templates
    before applying a third template no matter what happens.

    my problem is that whilst the xsl:if works fine the html from the two templates in the if doesn't get produce, only the divs show up in the source.

    but the third template outside of the if does produce html.

    not sure what is going on

    Code:
    			<body>
    			<xsl:variable name="varStatus"><xsl:value-of select="/document/form/status" /></xsl:variable>
    				<!-- added this in to try and sort presentation of popup when it isn't a popup -->
    				<xsl:if test="$varStatus = 'new'">
    					<!-- divs show up but not content why -->
    					<div id="hdr"><xsl:apply-templates select="header" /></div>
    					<div id="lh-col"><xsl:apply-templates select="menu" /></div>
    				</xsl:if>
    				<div id="title"><xsl:apply-templates select="developers" /></div>
    			</body>

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    Re: xsl not working (RESOLVED)

    sorted. i was being an idiot. i was thinking that i could create templates in the xsl and apply them without there actually being an element in the xml file with the same name.

    so i was trying to apply header, when there was no header element in the xml file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width