|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Can one <xsl:choose> <xsl:output>?
Given the following input document:
<?xml version="1.0" encoding="UTF-8"?> <response TYPE="Table"> <data>1</data> <data>15.2</data> </response> The output of the transformation could be directed to a Chart, or To a Table, depending on the TYPE attribute. Chart has ABChartData.dtd, and Table has ABTableData.dtd. In the xsl, I want to do something like: <xsl:choose> <xsl:when test="response/@TYPE='Table'"> <xsl:output doctype-system="TableData.dtd"/> </xsl:when> <xsl:otherwise> <xsl:output doctype-system="ChartData.dtd"/> </xsl:otherwise> </xsl:choose> I get an error saying the tag <xsl:output> is not allowed in this location. Questions: 1. How can this be done? 2. I am using Xalan Java API. Is there any way to pass the value of doctype-system attribute to the transform? Assuming that I am able to determine the value through some other means before doing the transform. Thanks a lot for your help. -sm Further information: The API for supplying the xml (after transformation) to Chart or to Table requires that the XML be of the form: <!--For Chart -->
<?xml version="1.0"?>
<!DOCTYPE ABChartData SYSTEM "ABChartData.dtd">
<ABChartData Name="Item Code vs Price" >
<PointLabel> Mercury </PointLabel>
<Series>
<SeriesLabel>Price</SeriesLabel>
<XData>1</Xdata>
<YData>15.2</YData>
</Series>
</ABChartData><!--For Table --> <?xml version="1.0" > <!DOCTYPE ABTableData SYSTEM "ABTableData.dtd"> <ABTableData > <ColumnLabel>Item Code</ColumnLabel> <ColumnLabel>Price</ColumnLabel> <Row> <RowLabel/> <Cell>1</Cell> <Cell>15.2</Cell> </Row> </ABTableData> === END === _________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com 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
|

Cart








