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

Can one <xsl:choose> <xsl:output>?

Subject: Can one <xsl:choose> <xsl:output>?
From: "Sudhir Malhotra" <sudhirmalhotra123@xxxxxxxxxxx>
Date: Mon, 07 May 2001 19:30:00 -0500
 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



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.