XML writing error  
Author Message
MAYDAY





PostPosted: Mon Jan 26 05:08:09 CST 2004 Top

Visual C#.Net >> 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.

DotNet426  
 
 
Jon





PostPosted: Mon Jan 26 05:08:09 CST 2004 Top

Visual C#.Net >> XML writing error Abdessamad Belangour <EMail@HideDomain.com> 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 - <EMail@HideDomain.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
 
Abdessamad





PostPosted: Tue Jan 27 08:35:47 CST 2004 Top

Visual C#.Net >> XML writing error 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.generatePropertyId(pr).ToString(
));
writer.WriteAttributeString("name",pr.Name);
writer.WriteAttributeString("visibility","public");
writer.WriteAttributeString("isSpecification","false");
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.type");
writeTypeIDREF(pr.PropertyType);//id reference
writer.WriteEndElement();
writer.WriteEndElement();
}

Thanks !

"Jon Skeet [C# MVP]" <EMail@HideDomain.com> a écrit dans le message de
news:EMail@HideDomain.com...
> Abdessamad Belangour <EMail@HideDomain.com> 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 - <EMail@HideDomain.com>
> http://www.pobox.com/~skeet
> If replying to the group, please do not mail me too


 
 
Jon





PostPosted: Tue Jan 27 11:14:57 CST 2004 Top

Visual C#.Net >> XML writing error Abdessamad Belangour <EMail@HideDomain.com> 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 - <EMail@HideDomain.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too