473,796 Members | 2,618 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Error in output from transformation when output exceeds 16040 byte

I have written an XSLT transformation on an ASP.NET page. The resulting HTML
is primarily a table of links. I have found that when the resulting HTML is
less than or equal to 16040 bytes, the output display is normal, but when the
resulting HTML exceeds 16040 bytes, the output does not display correctly.
When I look at View Source, I see that the final </html> tag gets moved to
another spot in the output, byte by byte as I increase the size, that is, at
16041 bytes, the final > gets moved, at 16042 bytes the final l> get moved,
etc. And as the output size increases, more and more of the "final"
characters get moved to another spot in the output.

Can anyone else replicate this problem? Is there a workaround?

I am running .NET Framework 1.1 and Windows XP Professional.

Here's the code I am running:

<%@ Page Language="C#" %>
<%@ Import Namespace="Syst em.IO" %>
<%@ Import Namespace="Syst em.Xml" %>
<%@ Import Namespace="Syst em.Xml.XPath" %>
<%@ Import Namespace="Syst em.Xml.Xsl" %>

<script runat="server" >
void Page_Load(Objec t Sender, EventArgs E)
{
XslTransform xslDoc = new XslTransform();
StringBuilder sb = new StringBuilder(4 0000);
StringWriter sw = new StringWriter(sb );
lblMessage1.Tex t = sb.Capacity.ToS tring() + ' ' + sb.Length.ToStr ing();

try
{
XPathDocument xmlDoc = new
XPathDocument(S erver.MapPath("/GenDat/Moors.xml"));
xslDoc.Load(Ser ver.MapPath("/GenDat/GenDat.xsl"));
xslDoc.Transfor m(xmlDoc,null,s w);
lblMessage1.Tex t = lblMessage1.Tex t + ' ' + sb.Capacity.ToS tring() + '
' + sb.Length.ToStr ing();
}
catch(Exception ex)
{
lblMessage1.Tex t = ex.Message;
}
finally
{
sw.Close();
}

lblMessage2.Tex t = sb.ToString();
}
</script>

<html><body>
<asp:Label id="lblMessage1 " runat="server" />
<asp:Label id="lblMessage2 " runat="server" />
</body></html>

I have the same problem with the display of the output when I use the
following alternate code:

<%@ Page Language="C#" %>
<%@ Import Namespace="Syst em.IO" %>
<%@ Import Namespace="Syst em.Xml" %>
<%@ Import Namespace="Syst em.Xml.XPath" %>
<%@ Import Namespace="Syst em.Xml.Xsl" %>

<html>
<body>
<asp:Xml id="xslTransfor m" runat="server"
DocumentSource= "/Gendat/Moors.xml"
TransformSource ="/Gendat/GenDat.xsl" />
</body>
</html>

Nov 12 '05 #1
3 1535
Joseph A Romeo wrote:
I have written an XSLT transformation on an ASP.NET page. The resulting HTML
is primarily a table of links. I have found that when the resulting HTML is
less than or equal to 16040 bytes, the output display is normal, but when the
resulting HTML exceeds 16040 bytes, the output does not display correctly.
When I look at View Source, I see that the final </html> tag gets moved to
another spot in the output, byte by byte as I increase the size, that is, at
16041 bytes, the final > gets moved, at 16042 bytes the final l> get moved,
etc. And as the output size increases, more and more of the "final"
characters get moved to another spot in the output.


That sounds weird. Can you provide some repro? Show us your XML and
stylesheet.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #2

"Oleg Tkachenko [MVP]" wrote:
That sounds weird. Can you provide some repro? Show us your XML and
stylesheet.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com


The original XML file was 2M, a bit large to include here. I have made an
abbreviated XML file and an abbreviated XSLT file which produce the same
problem as I reported. When the XML file contains the records with
type="test", the problem is noticeable; without them, it displays fine.

Moors.xml

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE GenDat SYSTEM "GenDat.dtd " >

<GenDat>

<Family type="principal ">Argo</Family>
<Family type="principal ">Beckett</Family>
<Family type="principal ">Cambridge </Family>
<Family type="principal ">Carney</Family>
<Family type="principal ">Carter</Family>
<Family type="principal ">Clark</Family>
<Family type="principal ">Coker</Family>
<Family type="principal ">Cork</Family>
<Family type="principal ">Cott</Family>
<Family type="principal ">Counselor </Family>
<Family type="principal ">Dean</Family>
<Family type="principal ">Drain</Family>
<Family type="principal ">Driggus</Family>
<Family type="principal ">Durham</Family>
<Family type="principal ">Farmer</Family>
<Family type="principal ">Green</Family>
<Family type="principal ">Greenage</Family>
<Family type="principal ">Hansor</Family>
<Family type="principal ">Hargrove</Family>
<Family type="principal ">Harmon</Family>
<Family type="principal ">Hughes</Family>
<Family type="principal ">Johnson</Family>
<Family type="principal ">Keys</Family>
<Family type="principal ">LeCount</Family>
<Family type="principal ">Loatman</Family>
<Family type="principal ">Miller</Family>
<Family type="principal ">Morgan</Family>
<Family type="principal ">Morris</Family>
<Family type="principal ">Mosley</Family>
<Family type="principal ">Munce</Family>
<Family type="principal ">Norwood</Family>
<Family type="principal ">Oney</Family>
<Family type="principal ">Perkins</Family>
<Family type="principal ">Pickerem</Family>
<Family type="principal ">Ridgeway</Family>
<Family type="principal ">Sammons</Family>
<Family type="principal ">Sanders</Family>
<Family type="principal ">Seeney</Family>
<Family type="principal ">Sisco</Family>
<Family type="principal ">Sockum</Family>
<Family type="principal ">Songo</Family>
<Family type="principal ">Street</Family>
<Family type="principal ">Wilson</Family>
<Family type="principal ">Wright</Family>
<Family type="principal ">(-----)</Family>

<Family type="related"> Aldrich</Family>
<Family type="related"> Anderson</Family>
<Family type="related"> Appo</Family>
<Family type="related"> Baker</Family>
<Family type="related"> Ball</Family>
<Family type="related"> Bannister</Family>
<Family type="related"> Barr</Family>
<Family type="related"> Berkheiser</Family>
<Family type="related"> Blair</Family>
<Family type="related"> Blunt</Family>
<Family type="related"> Bolivar</Family>
<Family type="related"> Bordley</Family>
<Family type="related"> Borteles</Family>
<Family type="related"> Bowers</Family>
<Family type="related"> Bowles</Family>
<Family type="related"> Briant</Family>
<Family type="related"> Bridge</Family>
<Family type="related"> Brooks</Family>
<Family type="related"> Brown</Family>
<Family type="related"> Buckley</Family>
<Family type="related"> Burr</Family>
<Family type="related"> Burrell</Family>
<Family type="related"> Chambers</Family>
<Family type="related"> Cook</Family>
<Family type="related"> Coombs</Family>
<Family type="related"> Cooper</Family>
<Family type="related"> Coward</Family>
<Family type="related"> Cuff</Family>
<Family type="related"> Custis</Family>
<Family type="related"> Davis</Family>
<Family type="related"> Dawson</Family>
<Family type="related"> Derry</Family>
<Family type="related"> Dorsey</Family>
<Family type="related"> Downs</Family>
<Family type="related"> Ensign</Family>
<Family type="related"> Fargo</Family>
<Family type="related"> Faulkner</Family>
<Family type="related"> Ferguson</Family>
<Family type="related"> Fetters</Family>
<Family type="related"> Finley</Family>
<Family type="related"> Flowers</Family>
<Family type="related"> French</Family>
<Family type="related"> Galloway</Family>
<Family type="related"> Garrettson</Family>
<Family type="related"> Gates</Family>
<Family type="related"> Gibbons</Family>
<Family type="related"> Giboo</Family>
<Family type="related"> Gibson</Family>
<Family type="related"> Giffen</Family>
<Family type="related"> Gilbert</Family>
<Family type="related"> Gould</Family>
<Family type="related"> Gray</Family>
<Family type="related"> Gross</Family>
<Family type="related"> Gullin</Family>
<Family type="related"> Hale</Family>
<Family type="related"> Hall</Family>
<Family type="related"> Haskins</Family>
<Family type="related"> Heard</Family>
<Family type="related"> Hembsley</Family>
<Family type="related"> Heywood</Family>
<Family type="related"> Hider</Family>
<Family type="related"> Highgate</Family>
<Family type="related"> Hobart</Family>
<Family type="related"> Hoffman</Family>
<Family type="related"> Hogans</Family>
<Family type="related"> Holmes</Family>
<Family type="related"> Holston</Family>
<Family type="related"> Horn</Family>
<Family type="related"> Horton</Family>
<Family type="related"> Hutchison</Family>
<Family type="related"> Jacklin</Family>
<Family type="related"> Jackson</Family>
<Family type="related"> Jamison</Family>
<Family type="related"> Jennifer</Family>
<Family type="related"> Jones</Family>
<Family type="related"> Kelly</Family>
<Family type="related"> Kern</Family>
<Family type="related"> Kelson</Family>
<Family type="related"> King</Family>
<Family type="related"> Kitridge</Family>
<Family type="related"> Klick</Family>
<Family type="related"> Krouse</Family>
<Family type="related"> Linderman</Family>
<Family type="related"> Lulham</Family>
<Family type="related"> McCreary</Family>
<Family type="related"> Mann</Family>
<Family type="related"> Martin</Family>
<Family type="related"> Maslin</Family>
<Family type="related"> Mette</Family>
<Family type="related"> Norfolk</Family>
<Family type="related"> Okonski</Family>
<Family type="related"> Omans</Family>
<Family type="related"> Osterhout</Family>
<Family type="related"> Owens</Family>
<Family type="related"> Parelli</Family>
<Family type="related"> Parrish</Family>
<Family type="related"> Patterson</Family>
<Family type="related"> Payne</Family>
<Family type="related"> Phelps</Family>
<Family type="related"> Pierce</Family>
<Family type="related"> Pounder</Family>
<Family type="related"> Pritchett</Family>
<Family type="related"> Proctor</Family>
<Family type="related"> Reddick</Family>
<Family type="related"> Reed</Family>
<Family type="related"> Renton</Family>
<Family type="related"> Reynolds</Family>
<Family type="related"> Ricks</Family>
<Family type="related"> Robbins</Family>
<Family type="related"> Rodgers</Family>
<Family type="related"> Ross</Family>
<Family type="related"> Rothermel</Family>
<Family type="related"> Rush</Family>
<Family type="related"> Russell</Family>
<Family type="related"> Schaefer</Family>
<Family type="related"> Schramm</Family>
<Family type="related"> Schultz</Family>
<Family type="related"> Shaw</Family>
<Family type="related"> Smith</Family>
<Family type="related"> Spaulding</Family>
<Family type="related"> Spotts</Family>
<Family type="related"> Stith</Family>
<Family type="related"> Stone</Family>
<Family type="related"> Thomas</Family>
<Family type="related"> Thompson</Family>
<Family type="related"> Valentino</Family>
<Family type="related"> Voshell</Family>
<Family type="related"> Wapker</Family>
<Family type="related"> Waples</Family>
<Family type="related"> Way</Family>
<Family type="related"> Webb</Family>
<Family type="related"> Westcott</Family>
<Family type="related"> Whitcraft</Family>
<Family type="related"> Wielandt</Family>
<Family type="related"> Williams</Family>
<Family type="related"> Wood</Family>
<Family type="related"> Young</Family>

<Family type="test">Tes t1</Family>
<Family type="test">Tes t2</Family>
<Family type="test">Tes t3</Family>
<Family type="test">Tes t4</Family>
<Family type="test">Tes t5</Family>
<Family type="test">Tes t6</Family>
<Family type="test">Tes t7</Family>
<Family type="test">Tes t8</Family>
<Family type="test">Tes t9</Family>
<Family type="test">Tes t10</Family>
<Family type="test">Tes t11</Family>
<Family type="test">Tes t12</Family>
<Family type="test">Tes t13</Family>
<Family type="test">Tes t14</Family>
<Family type="test">Tes t15</Family>
<Family type="test">Tes t16</Family>

</GenDat>

Gendat.xsl

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform" >
<xsl:variable name="Family" select="/GenDat/Family" />

<xsl:template match="/" >
<xsl:call-template name="FamilyTab le" >
<xsl:with-param name="Type" select="'princi pal'" />
</xsl:call-template>
<xsl:call-template name="FamilyTab le" >
<xsl:with-param name="Type" select="'relate d'" />
</xsl:call-template>
</xsl:template>

<xsl:template name="FamilyTab le" >
<xsl:param name="Type" select="'None'" />
<xsl:variable name="Count" select="count($ Family[@type=$Type])" />
<xsl:if test="$Count > 0" >
<h3>
<xsl:choose>
<xsl:when test="$Type = 'principal'">Pr incipal </xsl:when>
<xsl:when test="$Type = 'related'">Rela ted </xsl:when>
</xsl:choose>
<xsl:text>Famil ies</xsl:text>
</h3>
<table width="100%">
<colgroup width="20%" valign="top" align="left"></colgroup>
<colgroup width="80%" valign="top" align="left"></colgroup>
<xsl:apply-templates select="$Family " />
</table>
</xsl:if>
</xsl:template>

<xsl:template match="Family" >
<tr>
<td>
<xsl:value-of select="@type" />
</td>
<td>
<xsl:value-of select="." />
</td>
</tr>
</xsl:template>

</xsl:stylesheet>

GenDat.dtd

<!ELEMENT GenDat (Family*) >
<!ELEMENT Family (#PCDATA) >
<!ATTLIST Family
type CDATA #IMPLIED >
Nov 12 '05 #3
After upgrading to .NET Framework 1.1 Service Pack 1, the transformation
works correctly.
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
5041
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I double-checked the path to my error log. It is in /var/www/logs/php_error_log Thanks. :) -Wayne Stevenson
4
4737
by: Mike Conmackie | last post by:
Hi Folks, I've probably omitted something very basic but I have no idea what it might be. The results of my transformation _should_ be an xml file but all I get is the xml declaration immediately followed by the input node text values in one long string -- no xml tags (barring the xml declaration, of course) appear in the output file. Anyone who wants to see either the input xml file or the xsl file, please let me know and I will...
1
1506
by: KwiKiwi | last post by:
Hey, I'm doing a series of XSL Transformations from a C#.NET Console app. I've designed a .xsl file (to output to "text" not "xml") to generate a text file with entries that look like: "<OD:FO:"yes.gif",Picture,"C:\images\yes.gif">" I designed the .xsl file in Marrowsofts Xselerator application and when I
1
4448
by: Tim Menninger | last post by:
When I use the XslTransform.Transform method to write to the HttpRequest.OutputStream The first byte of the output is always an invalid character, looks like an ascii zero or some other non-printable ascii char. The problem is that it messes up my display. Here is the code: .... Response.Write("<span>some text</span>"); XmlTextReader reader = new XmlTextReader(xslFile); XslTransform xsl = new XslTransform();
0
1224
by: Joseph A Romeo | last post by:
I have written an XSLT transformation on an ASP.NET page. The resulting HTML is primarily a table of links. I have found that when the resulting HTML is less than or equal to 16040 bytes, the output display is normal, but when the resulting HTML exceeds 16040 bytes, the output does not display correctly. When I look at View Source, I see that the final </html> tag gets moved to another spot in the output, byte by byte as I increase the...
25
17219
by: moondaddy | last post by:
I have an application where users need to upload images and in my web.config file I have a setting like this: <httpRuntime maxRequestLength="512" /> Which restricts image larger than 500k from being uploaded. I'm also using the HtmlInputFile control to do the uploading. My problem is that when the user's file size exceeds 512k, the page immediately redirects to the "The page cannot be displayed" error page which is very confusing. ...
6
3132
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for several serial ports. It only crashes when data is being received on one or more of the serial ports. Could someone please give me some ideas about what would cause a program to terminate in this way? Thanks....
0
3207
by: debug03 | last post by:
I am executing a DTS package on a Windows 2000 sp4 server running SQL Server 2000 and IBM DB2 V7 client. The DTS package source data(SQL Server) is selected from SQL server table and inserts data to the destination table(DB2). I get the following error when the package is executed: The execution of the following DTS Package succeeded: Package Name: PEX2-CopyQualDatatoDB2-UAT Package Description: (null) Package ID:...
2
2322
by: jthep | last post by:
I'm trying to get this piece of code I converted from C to work in C++ but I'm getting an access violation error. Problem occurs at line 61. Someone can help me with this? The function display(llist mylist) displays a list of choices for a record book: void display(llist mylist) { char name, address, telno, input; int yearofbirth, choice, records; yearofbirth = 0;
0
10459
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.