[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Debugging.... Conditionally including XML

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

My XML file looks something like this

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

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]" />
</xsl:template>

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...
<page>
	<content>....</content>
	if (debug = true)
		Include a debug data file, which would contain the data and
item tags
	else
		The data and item tags will be returned to me.
</page>

Thanks
John


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.