Debugging.... Conditionally including XML

Subject: Debugging.... Conditionally including XML
From: "Mirick, John" <jmirick@xxxxxxxxxxxx>
Date: Fri, 10 Nov 2000 08:28:37 -0500
This might be more of an XML related question than XSL...

My XML file looks something like this

		<dataReference name="test" />
		<item name="test">This is a data value</item>

I write the content part of the page by hand and the data portion is
returned to me.
Within my xsl I might have something like this

<xsl:template match="dataReference">
	<xsl:variable name="referenceName"><xsl:value-of  select="@name"
/></xsl variable>
	<xsl:value-of select="/page/data/item[$referenceName = @name]" />

What I would like to know is if there is any way to conditionally add XML to
my XML document. Im looking for a way to be able to debug the XML/XSL before
the data section of the XML document is being populated by the
backend/middle tier developers.  Currently how I do this is just write the
data section of the page and either remove it or comment it out when Im
actually getting data. Im getting sick of commenting and un-commenting stuff
(and I cant count the number of times we have checked in an XML file to
source control with the data section still uncommented). It is just a
general annoyance but I would like to fix it if I could. 

I would like to be able to do something like this in my XML file...
	if (debug = true)
		Include a debug data file, which would contain the data and
item tags
		The data and item tags will be returned to me.


 XSL-List info and archive:

Current Thread