Jun 17, 2005 #1 jeffward MIS Joined Jul 3, 2002 Messages 33 Location GB I am using an xsl stylesheet to output my XML to HTML and would like to conditionally include the contents of a text file, for example: - ....html content here... <xsl:if test="something='true'"> show contents of .txt file here </xsl:if> ....html content here...
I am using an xsl stylesheet to output my XML to HTML and would like to conditionally include the contents of a text file, for example: - ....html content here... <xsl:if test="something='true'"> show contents of .txt file here </xsl:if> ....html content here...
Jun 17, 2005 #2 JontyMC Programmer Joined Nov 26, 2001 Messages 1,276 Location GB This is not possible just using XSL. XSL can only deal with XML files. If you converted your text file to XML there would be no problem: Code: <xsl:if test="something = true()"> <xsl:value-of select="document('mytextfile.xml')"/> </xsl:if> Jon "Asteroids do not concern me, Admiral. I want that ship, not excuses. Upvote 0 Downvote
This is not possible just using XSL. XSL can only deal with XML files. If you converted your text file to XML there would be no problem: Code: <xsl:if test="something = true()"> <xsl:value-of select="document('mytextfile.xml')"/> </xsl:if> Jon "Asteroids do not concern me, Admiral. I want that ship, not excuses.
Jun 17, 2005 #3 CubeE101 Programmer Joined Nov 19, 2002 Messages 1,492 Location US You could use an iframe, or textarea to show the text... Code: <xsl:if test="File"> <iframe src="{File}" frameborder="0"></iframe> </xsl:if> But that's just in a web browser... Visit My Site PROGRAMMER: Red-eyed, mumbling mammal capable of conversing with inanimate objects. Upvote 0 Downvote
You could use an iframe, or textarea to show the text... Code: <xsl:if test="File"> <iframe src="{File}" frameborder="0"></iframe> </xsl:if> But that's just in a web browser... Visit My Site PROGRAMMER: Red-eyed, mumbling mammal capable of conversing with inanimate objects.