473,327 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

XML writing error

Hi all,
I have developped an application that generate XML documents.
At most time it works fine, but sometimes (when the size of data to export
is big) i got the error message :
<< The StartElement token in the Epilog state will generate a nonvalid XML
document :
at System.XML.XMLTextWriter.AutoComplete(Token token)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns) at.....etc.>>
I have reviewed well formedness of my XML instructions but i have found no
error in them.
Please, give me any idea to track and solve the problem.
Thanks in advance.
Nov 15 '05 #1
3 1712
Abdessamad Belangour <be*******@irin.univ-nantes.fr> wrote:
I have developped an application that generate XML documents.
At most time it works fine, but sometimes (when the size of data to export
is big) i got the error message :
<< The StartElement token in the Epilog state will generate a nonvalid XML
document :
at System.XML.XMLTextWriter.AutoComplete(Token token)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns) at.....etc.>>
I have reviewed well formedness of my XML instructions but i have found no
error in them.
Please, give me any idea to track and solve the problem.


The stack trace should show where in your code it's complaining -
please post that section of code, and what the data is like at the
time.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #2
Jon,
The stack trace indicate that the problem is in the first line of the method
below, but the problem could be outside. Anyway all the methods calls in
this method are safe.

private void serializeProperty(PropertyInfo pr)
{
writer.WriteStartElement("UML:Attribute");

writer.WriteAttributeString("xmi.id",IdsGen.genera tePropertyId(pr).ToString(
));
writer.WriteAttributeString("name",pr.Name);
writer.WriteAttributeString("visibility","public") ;
writer.WriteAttributeString("isSpecification","fal se");
writer.WriteAttributeString("ownerScope","instance ");
//streotype of property accessiblility
if ((pr.CanRead)&&(pr.CanWrite)) serializeRefToStereotype("ReadWrite");
else
i f (pr.CanRead) serializeRefToStereotype("Read");
else serializeRefToStereotype("Write");

//property type
writer.WriteStartElement("UML:StructuralFeature.ty pe");
writeTypeIDREF(pr.PropertyType);//id reference
writer.WriteEndElement();
writer.WriteEndElement();
}

Thanks !

"Jon Skeet [C# MVP]" <sk***@pobox.com> a écrit dans le message de
news:MP************************@msnews.microsoft.c om...
Abdessamad Belangour <be*******@irin.univ-nantes.fr> wrote:
I have developped an application that generate XML documents.
At most time it works fine, but sometimes (when the size of data to export is big) i got the error message :
<< The StartElement token in the Epilog state will generate a nonvalid XML document :
at System.XML.XMLTextWriter.AutoComplete(Token token)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns)
at System.XML.XMLTextWriter.WriteStartElement(String prefix, String
localName,String ns) at.....etc.>>
I have reviewed well formedness of my XML instructions but i have found no error in them.
Please, give me any idea to track and solve the problem.


The stack trace should show where in your code it's complaining -
please post that section of code, and what the data is like at the
time.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 15 '05 #3
Abdessamad Belangour <be*******@irin.univ-nantes.fr> wrote:
The stack trace indicate that the problem is in the first line of the method
below, but the problem could be outside. Anyway all the methods calls in
this method are safe.

private void serializeProperty(PropertyInfo pr)
{
writer.WriteStartElement("UML:Attribute");


If the exception is occurring here, then it should occur every time.
Have you tried stepping through to see whether it really is every time?

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4

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

Similar topics

0
by: JC | last post by:
I am using Mysql version: 4.0.18-max-log and trying to populate a database from a text file using source option from inside the mysql environment. The population run OK but when creating the...
2
by: Paul P | last post by:
I am having a problem writing errors to the application log on a Windows 2003 server running IIS 6 The error message is "InvalidOperationException: Cannot open log for source {0}." I have created...
5
by: zambak | last post by:
Hi I have assignment for some wierd compression alghoritam that will read in from a file convert characters to 5 bit codes and then write out compressed version of the original file. For...
4
by: HNguyen | last post by:
Hi, I have a Web application in ASP.NET. My Application allows the users upload files into the server after checking their user names and passwords. For each transaction, the Web program will...
6
by: arne.muller | last post by:
Hello, I've come across some problems reading strucutres from binary files. Basically I've some strutures typedef struct { int i; double x; int n; double *mz;
0
by: riggor | last post by:
I have been searching for answers to this question ... but all I have found is other people asking the same question..but I have not found an answer... I am trying to install Oracle 10g on...
1
by: projectVBA | last post by:
Hi , I wrote some add in for PowerPoint and i'm trying to find an automatic way to load it every time PowerPoint starts. I found Microsoft Code example (see below ) BUT the problem is : I can't...
0
by: mcc99 | last post by:
Amazing, I surfed around to find a simple utility that could list files recursively from a given top folder down through it, writing out the path and filename in simple \path\file_name form, without...
89
by: Skybuck Flying | last post by:
Hello, This morning I had an idea how to write Scalable Software in general. Unfortunately with Delphi 2007 it can't be done because it does not support operating overloading for classes, or...
3
by: koutoo | last post by:
I have a code that writes to 2 seperate files. I keep getting a "list index out of range" error. The strange part is that when checking the files that I'm writing too, the script has already...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.