[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|