[ http://issues.apache.org/jira/browse/XALANJ-1931?page=all ]

Brian Minchau updated XALANJ-1931:
----------------------------------

    Version: Latest Development Code
                 (was: 2.6)

> XSL-T Stylesheet Succeeds With Small Stream, Fails With Large
> -------------------------------------------------------------
>
>          Key: XALANJ-1931
>          URL: http://issues.apache.org/jira/browse/XALANJ-1931
>      Project: XalanJ2
>         Type: Bug
>   Components: transformation, Xalan-interpretive
>     Versions: Latest Development Code
>  Environment: Operating System: Windows NT/2K
> Platform: PC
>     Reporter: Michael O. Duffy
>     Assignee: Xalan Developers Mailing List

>
> 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

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to