Re: XMLTextReader reading too many characters



Martin

There was no guesswork involved in how the sample should look or be
corrected. I provided that answer in your query about it. I quote:

Martin

That's just a typo from when I cut and pasted the sample document
together.
Remove/delete the extra tag <DistrictPrecinctPart> to make the
correction.

John

It was a very simple process to delete the extra tag. If you were still
unsure of which tag, a 10 second validation using an XML validator would
have quickly and easily resolved that confusion. You do know about XML
validators, being a Microsoft MVP XML, right? That's immaterial at this
point, the valid document was provided in my last response.

The process I have to parse the document uses 1.1 not 2.0. If there is an
issue with the XMLTextReader, it would be in 1.1. However, since this
avenue of investigation is bearing little fruit, I surrender and will not
continue with you down this path.

Thanks for taking a look at it, despite the recent poor communication.

John


"Martin Honnen" <mahotrash@xxxxxxxx> wrote in message
news:exZRx$c2HHA.4584@xxxxxxxxxxxxxxxxxxxxxxx
JohnB wrote:

I don't know for certain if it was your intention, but the tone of your
message is hostile. I am not wasting your time. I had presumed that you
had the knowledge of how to delete a tag from an XML document, though
perhaps I over estimated your abilities. Maybe a Microsoft MVP XML
status isn't indicative of being capable of editing an XML document.
Here again is the XML document sample with the offending tag removed.

If you claim there is a problem with XmlTextReader and an allegedly
well-formed XML document but then provide an XML sample that is not
well-formed then it does not help that I edit the document. You need to
provide a sample that allows us to reproduce the problem. I am not able to
guess how your sample looks that allegedly has the problem.

With the sample you have no provided I have no problems to read it with
XmlReader or XmlTextReader, it parses through the sample without giving
the error you claim it produces.

Simple test code is

using (XmlTextReader xmlTextReader = new
XmlTextReader(@"test2007080702.xml"))
{
while (xmlTextReader.Read())
{
Console.WriteLine("{0}: {1}.", xmlTextReader.NodeType,
xmlTextReader.Name);
}
}

Tested with .NET 2.0.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/


.



Relevant Pages

  • RE: XML documentation file name
    ... MSDN document on VB.NET Project Designer says "The Generate XML document ... XML documentation is automatically emitted into an XML ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.languages.vb)
  • Re: FoxPro and XML
    ... tables to hold tag names, fields used to populate the tags, any calculations ... enough to make changes should I need to add stuff to my XML document. ... But how do you get foxpro to show this? ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Storing hierarchies from XML into relational tables
    ... You haven't made clear what sort of relational tables you plan to use to store the data from your hierarchy. ... Parent VARCHAR ... Given an xml document that represents a heirarchy: ...
    (microsoft.public.sqlserver.xml)
  • XPathNavigator SetValue wipes out XmlType
    ... I have an xml document that I want to go through and set the values on ... I can iterate the document and get my XmlType and XmlBaseType values just ... Xml and Program.cs to recreate the problem. ...
    (microsoft.public.dotnet.languages.csharp)
  • ANN: generateDS.py 8a available
    ... ``generateDS.py`` generates Python data structures (for example, ... class definitions) from an XML Schema document. ... structures represent the elements in an XML document described by ...
    (comp.lang.python)