You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by xa...@xml.apache.org on 2004/09/24 20:26:32 UTC
[jira] Commented: (XALANJ-1931) XSL-T Stylesheet Succeeds With Small Stream, Fails With Large
The following comment has been added to this issue:
Author: Michael Duffy
Created: Fri, 24 Sep 2004 11:26 AM
Body:
Hi Brian,
You asked three questions in an e-mail:
Please add your comments there. I've got two questions for you that you can answer in the issue:
1) What do you mean by "turning on error tracting in Xalan"
I mean executing the Xalan.jar using the trace options:
[-TT (Trace the templates as they are being called.)]
[-TG (Trace each generation event.)]
[-TS (Trace each selection event.)]
[-TTC (Trace the template children as they are being processed.)]
[-TCLASS (TraceListener class for trace extensions.)]
2) What messages came out when you turned this on?
A long trace of what exactly was being done in each case, too large to reproduce here.
3) please add an example with differences in the root tag, I'm not
following you on those differences.
Root tag that failed:
<project xmlns="http://www.developer.cognos.com/schemas/bmt/32/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.developer.cognos.com/schemas/bmt/32/1 BMTModelSpecification.xsd">
Root tag that worked:
<project>
MOD
---------------------------------------------------------------------
View this comment:
http://issues.apache.org/jira/browse/XALANJ-1931?page=comments#action_53397
---------------------------------------------------------------------
View the issue:
http://issues.apache.org/jira/browse/XALANJ-1931
Here is an overview of the issue:
---------------------------------------------------------------------
Key: XALANJ-1931
Summary: XSL-T Stylesheet Succeeds With Small Stream, Fails With Large
Type: Bug
Status: Open
Project: XalanJ2
Components:
Xalan-interpretive transformation
transformation
Versions:
2.6
Assignee: Xalan Developers Mailing List
Reporter: Michael O. Duffy
Created: Mon, 30 Aug 2004 6:08 PM
Updated: Fri, 24 Sep 2004 11:26 AM
Environment: Operating System: Windows NT/2K
Platform: PC
Description:
I wrote a simple XSL-T stylesheet to make the following change to an XML stream:
"Copy out the input stream elements into the output stream. If you find a
<queryItem> whose <datatype> child has the value 'character', add the following
element after the <nullable> child:
<promptInfo>
<promptType>selectWithSearch</promptType>
</promptInfo>
"
This is the stylesheet that I wrote:
<!--
A simple stylesheet for adding a tag to a document
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Copy the document in its entirety -->
<xsl:template match="*|@*|comment()|processing-instruction()|text()">
<xsl:copy>
<xsl:apply-templates select="*|@*|comment()|processing-instruction()
|text()"/>
</xsl:copy>
</xsl:template>
<!-- Find the queryItem tag and add a promptInfo child after nulllable for
character datatype-->
<xsl:template match="queryItem">
<queryItem>
<xsl:apply-templates select="name"/>
<xsl:apply-templates select="lastChanged"/>
<xsl:apply-templates select="columnName"/>
<xsl:apply-templates select="usage"/>
<xsl:apply-templates select="datatype"/>
<xsl:apply-templates select="precision"/>
<xsl:apply-templates select="scale"/>
<xsl:apply-templates select="size"/>
<xsl:apply-templates select="nullable"/>
<xsl:if test="datatype/text()='character'">
<promptInfo>
<promptType>selectWithSearch</promptType>
</promptInfo>
</xsl:if>
<xsl:apply-templates select="regularAggregate"/>
<xsl:apply-templates select="semiAggregate"/>
</queryItem>
</xsl:template>
</xsl:stylesheet>
I apply it to this simple XML stream:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<name>KMC Master Model</name>
<locales>
<locale>en-US</locale>
</locales>
<namespace>
<querySubject>
<queryItem>
<name locale="en-us">Create Date</name>
<name locale="en-gb">_create_date</name>
<lastChanged>2004-07-23T14:31:46</lastChanged>
<columnName>_create_date</columnName>
<usage>identifier</usage>
<datatype>date</datatype>
<precision>0</precision>
<scale>0</scale>
<size>4</size>
<nullable>true</nullable>
<regularAggregate>unsupported</regularAggregate>
<semiAggregate>unsupported</semiAggregate>
</queryItem>
<queryItem>
<name locale="en-us">Ref Code</name>
<name locale="en-gb">_ref_code</name>
<lastChanged>2004-07-23T14:31:46</lastChanged>
<columnName>_ref_code</columnName>
<usage>identifier</usage>
<datatype>character</datatype>
<precision>15</precision>
<scale>0</scale>
<size>32</size>
<nullable>true</nullable>
<regularAggregate>unsupported</regularAggregate>
<semiAggregate>unsupported</semiAggregate>
<collationSequenceName>IF_CS819</collationSequenceName>
<collationSequenceLevel>0</collationSequenceLevel>
</queryItem>
</querySubject>
</namespace>
</project>
The output is as expected (<promptType> child not added for the first
<queryItem>; added for the second one):
<?xml version="1.0" encoding="UTF-8"?>
<project>
<name>KMC Master Model</name>
<locales>
<locale>en-US</locale>
</locales>
<namespace>
<querySubject>
<queryItem>
<name locale="en-us">Create Date</name>
<name locale="en-gb">_create_date</name>
<lastChanged>2004-07-23T14:31:46</lastChanged>
<columnName>_create_date</columnName>
<usage>identifier</usage>
<datatype>date</datatype>
<precision>0</precision>
<scale>0</scale>
<size>4</size>
<nullable>true</nullable>
<regularAggregate>unsupported</regularAggregate>
<semiAggregate>unsupported</semiAggregate>
</queryItem>
<queryItem>
<name locale="en-us">Ref Code</name>
<name locale="en-gb">_ref_code</name>
<lastChanged>2004-07-23T14:31:46</lastChanged>
<columnName>_ref_code</columnName>
<usage>identifier</usage>
<datatype>character</datatype>
<precision>15</precision>
<scale>0</scale>
<size>32</size>
<nullable>true</nullable>
<promptInfo>
<promptType>selectWithSearch</promptType>
</promptInfo>
<regularAggregate>unsupported</regularAggregate>
<semiAggregate>unsupported</semiAggregate>
</queryItem>
</querySubject>
</namespace>
</project>
However, when I apply the identical transformation to a larger stream (3.7MB),
which was the source of the <queryItem> instances used in the small test
stream, I find that the original stream is copied out, and NO <promptType>
children are added. No exceptions were thrown.
I used -Xmx128m as an argument when I ran xalan.jar, without effect. Why would
a transformation succeed on a smaller XML input stream and fail on a larger one?
MOD
---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xalan-dev-help@xml.apache.org