XMLTextReader reading too many characters

I'm stumped though I have an idea of what might be happening.  I would 
appreciate any help someone might give/suggest.

I have a well formed XML document.  Here is an example below.  The real 
thing (a file) is almost a gig in size.

<?xml version="1.0" encoding="UTF-8"?><VoterView 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><DistrictPrecinctParts><DistrictPrecinctPart>
        <key_district>182496</key_district><key_precinctpart>447484</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
        <key_district>71</key_district><key_precinctpart>181435</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
        <key_district>182431</key_district><key_precinctpart>181435</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
        <key_district>182520</key_district><key_precinctpart>181523</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
        <key_district>3</key_district><key_precinctpart>181011</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
        <key_district>3</key_district><key_precinctpart>181012</key_precinctpart></DistrictPrecinctPart>
    </DistrictPrecinctParts></VoterView>

Okay, the document is big, this is just a small sample.  Anyway, the problem 
is that I go through and read the file, parsing out the elements into 
strings using ReadString but it gets to about the sample section of the file 
and throws an exception every time.  Darned if I know why, though again I 
have my suspicions.  Here is the exception information I'm getting.

"System.Xml.XmlException: The 'key_precinctpart' start tag on line '79' does 
not match the end tag of 'key_precinctpart<'. Line 79, position 65.
   at System.Xml.XmlTextReader.ParseTag()
   at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
   at System.Xml.XmlTextReader.Read()
   at System.Xml.XmlReader.GetTextContent()
   at System.Xml.XmlReader.ReadString()
   at VoterXMLDataLoad.Module1.Main() in D:\VS Net 
Projects\VOTERXMLDataLoad\Module1.vb:line 293"

Looking at the XML at line 79, position 65, it's all well formed and there 
is nothing in the data that would indicate a problem.  Any clues would be 
helpful, I'm out of ideas.  My one idea was that the stream needs to be 
flushed, but since I'm not flushing it for other sections of the document 
which work, why would I need to in this section?

thanks

John 


0
8/6/2007 4:16:58 PM
dotnet.xml 7266 articles. 0 followers. Follow

13 Replies
809 Views

Similar Articles

[PageSpeed] 44

JohnB wrote:

> "System.Xml.XmlException: The 'key_precinctpart' start tag on line '79' does 
> not match the end tag of 'key_precinctpart<'. Line 79, position 65.
                                           ^^^
A less-than sign in an element name looks very odd to me, not sure how 
that could happen. Can you put a minimal XML document online somewhere 
and post the URL?



-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
8/6/2007 5:27:21 PM
I did that in my original message.  Before the error message is a short 
example of the document.

John

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:OrY$M8E2HHA.728@TK2MSFTNGP05.phx.gbl...
> JohnB wrote:
>
>> "System.Xml.XmlException: The 'key_precinctpart' start tag on line '79' 
>> does not match the end tag of 'key_precinctpart<'. Line 79, position 65.
>                                           ^^^
> A less-than sign in an element name looks very odd to me, not sure how 
> that could happen. Can you put a minimal XML document online somewhere and 
> post the URL?
>
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
8/6/2007 6:08:33 PM
Just wanted to follow up on this.  Still not finding the problem.  See the 
end of this message for a copy of the XML document from the previous 
message.  In this message I'm going to post a code snippet which I hope 
might spark something in someone's mind about the problem I'm having. 
Actually, this could run as a full blown command/console program but it's 
only about an eight or so of the full code.  What I left out is code for 
other entities besides DistrictPrecinctParts.

Anyhow, thanks for any input.

John

--------------------------------------------------------

Option Explicit On
Option Strict On



Imports System.Data.SqlClient
Imports System.Configuration.ConfigurationSettings


Module Module1
 Private numErrors As Int32
 Private tw As IO.TextWriter
 Private numErrorLineNumber As Int64
 Private blnAdvanceLine As Boolean

 Sub Main()
  Dim myS As IO.Stream
  Dim strFilePath, strName, strValue, strMode, strPath As String
  Dim blnContinue As Boolean = True
  Dim trans As SqlTransaction
  Dim cmd As SqlCommand = New SqlCommand
  Dim conn As SqlClient.SqlConnection

  strMode = AppSettings("mode").ToString
  If strMode = "test" Then
   conn = New SqlClient.SqlConnection(AppSettings("testconnection"))
   strPath = AppSettings("testXMLFilePath").ToString
  Else    'prod
   conn = New SqlClient.SqlConnection(AppSettings("prodconnection"))
   strPath = AppSettings("prodXMLFilePath").ToString
  End If
  Dim key_district, key_precinctpart As String


  If IO.File.Exists(strPath & "VoterViewImportErrors.Log") Then
   IO.File.Delete(strPath & "VoterViewImportErrors.Log")
  End If
  tw = IO.File.CreateText(strPath & "VoterViewImportErrors.Log")
  strFilePath = strPath & AppSettings("XMLFileName")

  Try
   myS = IO.File.OpenRead(strFilePath)
  Catch err As SystemException
   tw.WriteLine(Now.ToString & vbTab & err.Message)
   GoTo ExitRoutine
  End Try

  Dim xr As Xml.XmlTextReader = New Xml.XmlTextReader(myS)

  Try
   myS.Position = 0
   conn.Open()
   trans = conn.BeginTransaction("LoadXML")
   cmd.Transaction = trans
   cmd.Connection = conn
   cmd.CommandTimeout = 1800
  Catch err As SystemException
   tw.WriteLine(Now.ToString & vbTab & err.Message)
  End Try

  blnAdvanceLine = False
  numErrors = 0
  numErrorLineNumber = -1

  xr.Read()
  Do Until Not blnContinue
   strName = xr.Name.ToLower
   Select Case strName
    Case "xml"
     xr.Read()
     GoTo skipNext
    Case "voterview"
     xr.Read()
     GoTo skipNext
    Case "districtprecinctparts"
     Try
      xr.Read()
      Do While Trim(xr.Name) = "" And Not xr.EOF
       xr.Read()
      Loop
      If xr.Name.ToLower <> "districtprecinctpart" Then
       GoTo skipNext
      End If
nextDPP:
      xr.Read()
      Do While Trim(xr.Name) = "" And Not xr.EOF
       xr.Read()
      Loop
      key_district = xr.ReadString
      If key_district = "" Then key_district = "null"
      xr.Read()
      key_precinctpart = xr.ReadString
      If key_precinctpart = "" Then key_precinctpart = "null"

      cmd.CommandText = "insert into district_precinct_part_new values(" & _
         key_district & ", " & _
         key_precinctpart & ", getDate(), null, null" & _
         ")"

      cmd.ExecuteNonQuery()
contDPP:
      xr.Read()
      Do Until xr.Name.ToLower = "districtprecinctpart" And Not xr.EOF
       xr.Read()
      Loop
      xr.Read()
      Do Until xr.Name.ToLower <> "" And Not xr.EOF
       xr.Read()
      Loop
      If xr.Name.ToLower = "districtprecinctpart" Then GoTo nextDPP
      tw.WriteLine(Now.ToString & vbTab & "districtprecinctpart done")
     Catch err As SystemException
      If blnAdvanceLine Then
       errMessage(xr.Name, xr.ReadString, xr.LineNumber, xr.LinePosition, 
myS.Position, err, cmd.CommandText)
       tw.WriteLine(Now.ToString & vbTab & "Errors report limited to 100 on 
single line.")
       GoTo skipNext
      Else
       errMessage(xr.Name, xr.ReadString, xr.LineNumber, xr.LinePosition, 
myS.Position, err, cmd.CommandText)
       GoTo contDPP
      End If
     End Try
    Case Else
     Try
      xr.Read()
     Catch err As SystemException
      tw.WriteLine(Now.ToString & vbTab & err.Message)
     End Try
    End Case
skipNext:
   If xr.EOF Then blnContinue = False
   tw.Flush()
  Loop

myCommit:
  Try
   trans.Commit()
   tw.WriteLine(Now.ToString & vbTab & "transaction committed!")
  Catch err As SystemException
   tw.WriteLine(Now.ToString & vbTab & "commit failed!")
  End Try

ExitRoutine:
  If xr.ReadState <> Xml.ReadState.Closed Then xr.Close()
  Try
   myS.Close()
  Catch
  End Try
  Try
   tw.Close()
  Catch
  End Try
  trans.Dispose()
  If conn.State = ConnectionState.Open Then conn.Close()
  conn.Dispose()
  xr = Nothing
  myS = Nothing
  tw = Nothing
 End Sub

 Private Sub errMessage(ByVal strName As String, ByVal strValue As String, 
ByVal ln As Int64, ByVal lp As Int64, ByVal pos As Int64, ByVal err As 
SystemException, Optional ByVal ct As String = "")
  Dim strMsg As String

  strMsg = Now.ToString & vbTab & "LOAD ERROR -- Name:  " & strName & vbTab 
& "Value:  " & strValue & vbTab & "Line Number:  " & ln.ToString & _
     vbTab & "Line Position:  " & lp.ToString & vbTab & "Stream Position:  " 
& pos.ToString & vbTab & _
     "Err: " & Replace(Replace(err.Message, Chr(10), " "), Chr(13), "")
  If ct = "" Then
   tw.WriteLine(strMsg)
  Else
   tw.WriteLine(strMsg)
   tw.WriteLine(Now.ToString & vbTab & "LOAD ERROR -- " & ct)
  End If

  If ln = numErrorLineNumber Then
   If numErrors > 100 Then    'arbritrary choice of 100, seems to be enough
    'need to set a flag indicating that the line needs to be advance in the 
file
    blnAdvanceLine = True
    numErrors = 0      'reset the count
    numErrorLineNumber = -1
   Else
    numErrors += 1
    'should only need to set flag once, but this is an easy method
    blnAdvanceLine = False
   End If
  Else
   numErrorLineNumber = ln
  End If

 End Sub

End Module



"JohnB" <do_not_spam_me_john.bidondo@jocogov.org> wrote in message 
news:%23D1m3UE2HHA.5980@TK2MSFTNGP04.phx.gbl...
> I'm stumped though I have an idea of what might be happening.  I would 
> appreciate any help someone might give/suggest.
>
> I have a well formed XML document.  Here is an example below.  The real 
> thing (a file) is almost a gig in size.
>
> <?xml version="1.0" encoding="UTF-8"?><VoterView 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><DistrictPrecinctParts><DistrictPrecinctPart>
> 
> <key_district>182496</key_district><key_precinctpart>447484</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> <key_district>71</key_district><key_precinctpart>181435</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> <key_district>182431</key_district><key_precinctpart>181435</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> <key_district>182520</key_district><key_precinctpart>181523</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> <key_district>3</key_district><key_precinctpart>181011</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> <key_district>3</key_district><key_precinctpart>181012</key_precinctpart></DistrictPrecinctPart>
>    </DistrictPrecinctParts></VoterView>
>
> Okay, the document is big, this is just a small sample.  Anyway, the 
> problem is that I go through and read the file, parsing out the elements 
> into strings using ReadString but it gets to about the sample section of 
> the file and throws an exception every time.  Darned if I know why, though 
> again I have my suspicions.  Here is the exception information I'm 
> getting.
>
> "System.Xml.XmlException: The 'key_precinctpart' start tag on line '79' 
> does not match the end tag of 'key_precinctpart<'. Line 79, position 65.
>   at System.Xml.XmlTextReader.ParseTag()
>   at System.Xml.XmlTextReader.ParseBeginTagExpandCharEntities()
>   at System.Xml.XmlTextReader.Read()
>   at System.Xml.XmlReader.GetTextContent()
>   at System.Xml.XmlReader.ReadString()
>   at VoterXMLDataLoad.Module1.Main() in D:\VS Net 
> Projects\VOTERXMLDataLoad\Module1.vb:line 293"
>
> Looking at the XML at line 79, position 65, it's all well formed and there 
> is nothing in the data that would indicate a problem.  Any clues would be 
> helpful, I'm out of ideas.  My one idea was that the stream needs to be 
> flushed, but since I'm not flushing it for other sections of the document 
> which work, why would I need to in this section?
>
> thanks
>
> John
> 


0
8/7/2007 1:51:25 PM
JohnB wrote:
> I did that in my original message.  Before the error message is a short 
> example of the document.

I need a sample that allows me to reproduce the problem. When I save 
that short sample to a file and parse it with XmlReader or XmlTextReader 
then I don't have any problems, the document is parsed without problems.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
8/7/2007 2:06:35 PM
Martin

Thanks for doing that, I appreciate it.  I posted some code from the console 
app we wrote which parses through the document.  Maybe there's a logic error 
in there I'm not seeing.  It doesn't matter how much actual data is in the 
document, it always comes to line 78, 79, or 80 and has the problem, every 
time.

John

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:OUk0rwP2HHA.5980@TK2MSFTNGP04.phx.gbl...
> JohnB wrote:
>> I did that in my original message.  Before the error message is a short 
>> example of the document.
>
> I need a sample that allows me to reproduce the problem. When I save that 
> short sample to a file and parse it with XmlReader or XmlTextReader then I 
> don't have any problems, the document is parsed without problems.
>
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
8/7/2007 2:11:38 PM
JohnB wrote:

> Thanks for doing that, I appreciate it.  I posted some code from the console 
> app we wrote which parses through the document.  Maybe there's a logic error 
> in there I'm not seeing.  It doesn't matter how much actual data is in the 
> document, it always comes to line 78, 79, or 80 and has the problem, every 
> time.

Can you please provide a 90 line XML sample that allows us to reproduce 
the problem? And tell us which version of the .NET framework you are using.


-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
8/7/2007 3:29:33 PM
Martin

Thanks again.  I'm including a sample of the file below with all white 
spaces preserved.  In my previous sample, I took out white spaces.  It 
shouldn't matter, but who knows?

This sample will have 100 + lines.  It's long, I apologize for the length, 
again mostly due to white spaces.  Speaking of length, is there a file 
length limitation to XMLTextReader that might be causing the weirdness?

John

file follows...make sure you get all tags...
----------------------------------------

<?xml version="1.0" encoding="UTF-8"?><VoterView 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><DistrictPrecinctParts><DistrictPrecinctPart>










       <key_district>3</key_district><key_precinctpart>181380</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>3</key_district><key_precinctpart>181381</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>3</key_district><key_precinctpart>181382</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181360</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181361</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181363</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181364</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181365</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181366</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181367</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181368</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181375</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181030</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181033</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181034</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181035</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181036</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181037</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181038</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181039</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181045</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181046</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181047</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181053</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181054</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181055</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181056</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181057</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181059</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181060</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181068</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181069</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181071</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181072</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181073</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


    </DistrictPrecinctParts>














</VoterView> 


0
8/7/2007 3:46:41 PM
JohnB wrote:

> This sample will have 100 + lines.  It's long, I apologize for the length, 
> again mostly due to white spaces.  Speaking of length, is there a file 
> length limitation to XMLTextReader that might be causing the weirdness?

That sample is _not_ well-formed, it has a start tag 
DistrictPrecinctPart on line 115 and an end tag DistrictPrecinctParts on 
line 118, see below:


>         <key_district>13</key_district><key_precinctpart>181073</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
> 
> 
>     </DistrictPrecinctParts>

That is what .NET reports and what a Java implementation of an XML 
parser reports too.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
8/7/2007 5:02:27 PM
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

"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:OdgK%23SR2HHA.748@TK2MSFTNGP04.phx.gbl...
> JohnB wrote:
>
>> This sample will have 100 + lines.  It's long, I apologize for the 
>> length, again mostly due to white spaces.  Speaking of length, is there a 
>> file length limitation to XMLTextReader that might be causing the 
>> weirdness?
>
> That sample is _not_ well-formed, it has a start tag DistrictPrecinctPart 
> on line 115 and an end tag DistrictPrecinctParts on line 118, see below:
>
>
>> 
>> <key_district>13</key_district><key_precinctpart>181073</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>
>>
>>
>>     </DistrictPrecinctParts>
>
> That is what .NET reports and what a Java implementation of an XML parser 
> reports too.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
8/7/2007 5:37:45 PM
JohnB wrote:

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

Sorry, you are wasting our time, please provide a minimal sample that 
allows us to reproduce the error you get.

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1778)
8/8/2007 12:19:40 PM
Martin

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.

John

edited document follows
---------------------------

<?xml version="1.0" encoding="UTF-8"?><VoterView
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><DistrictPrecinctParts><DistrictPrecinctPart>










       <key_district>3</key_district><key_precinctpart>181380</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>3</key_district><key_precinctpart>181381</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>3</key_district><key_precinctpart>181382</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181360</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181361</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181363</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181364</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181365</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181366</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181367</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181368</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>12</key_district><key_precinctpart>181375</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181030</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181033</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181034</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181035</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181036</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181037</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181038</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181039</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181045</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181046</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181047</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181053</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181054</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181055</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181056</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181057</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181059</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181060</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181068</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181069</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181071</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181072</key_precinctpart></DistrictPrecinctPart><DistrictPrecinctPart>


        <key_district>13</key_district><key_precinctpart>181073</key_precinctpart></DistrictPrecinctPart>


    </DistrictPrecinctParts>














</VoterView>


"Martin Honnen" <mahotrash@yahoo.de> wrote in message 
news:%2340LnZb2HHA.4476@TK2MSFTNGP06.phx.gbl...
> JohnB wrote:
>
>> 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.
>
> Sorry, you are wasting our time, please provide a minimal sample that 
> allows us to reproduce the error you get.
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
8/8/2007 2:52:31 PM
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/
0
mahotrash (1778)
8/8/2007 3:22:28 PM
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@yahoo.de> wrote in message 
news:exZRx$c2HHA.4584@TK2MSFTNGP03.phx.gbl...
> 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/ 


0
8/8/2007 4:31:38 PM
Reply:

Similar Artilces:

Read receipts
I need to do two things 1. Disable the ability of some users to request read reciepts on a user by user basis. 2. Over ride user/client settings that deny read reciepts when the message comes from certain users. For example mail from an administrator or owner would always get a read receipt if they had requested it, even if the client was set to deny all receipts. We are using Exchange 2000 and will be upgrading to 2003 in the next few months. Thanks in advance On Wed, 7 Dec 2005 15:56:02 -0800, "Mark" <Mark@discussions.microsoft.com> wrote: >I need to do two th...

How do I get rid of strange special characters?
I had a word article that I was going to insert into sql server in a text field. So I replaced every occurrence of apostrophe by two apostrophes (sql server doesn't like seeing single apostrophes in the middle of a text field). What I didn't notice was that this replace doesn't work the way you would expect (in Word). When you try and replace one apostrophe by two, you get a reverse slanted character followed by an apostrophe. Since I didn't notice this, I went ahead and inserted the word as text into a sql field, and now my sql database is full of these charac...

Read-Only Compatibility Mode
I wrote an application in Excel 2003 for a client with a four computer network. The application is on a shared network drive, and it seems to work correctly (Read/Write) for two of the machines. However, with no other users accessing the application, the other two machines present Read-Only versions of the application. One of these machines uses Windows 2000 and Excel 2003 and displays [Read-Only] behind the file name. The other machine uses Vista and Excel 2007 and displays [Read-Only] [Compatibility Mode]. Both of the machines that work correctly use Windows XP Professiona...

XmlTextReader Help!!!
Hi, Ok, so here's my problem. I'm trying to read an xml file using an XmlTextReader. The file itself is simple. What I'd like to do is compare each node's value attribute to another string. If they are the same, I'll retrieve the text of the node and do some mumbo-jumbo with it. Here's what my xml file looks like (note that it contains lots more nodes): <Fruits> <fruit value="007">Mango</fruit> <fruit value="010">Pineapple</fruit> <fruit value="489">Tangerine</fruit> <fruit value...

character that is ignored when averaging
Hello: I have several cells to average. In some of those cells, I have invalid values, so I have an if statement that replaces the cells with #N/A is the values are invalid. This is good because it allows me to graph the values and the #N/A are ignored (in an X-Y scatter plot) However, if I try to average and the range includes one of those cells, I get a value of #N/A. I want to be able to average those values ignoring the #N/A. If I replace the #N/A with '' or something similar, then the average works but the graph doesn't (it gets turned into a line plot). If there something tat...

Reading Excel Checkboxes in Access
Hi All I created a spreadsheet with checkboxes (controls) on it for reporting purposes. I now need to import the data contained on the spreadsheets into Access. The data is not laid out in neat columns or rows, it was formated to be a stand alone report originally. My problem is not in reading cells within the spreadsheet, I'm able to do that. My issue is that I can't tell if a checkbox is checked or not. What I've done: If I execute the following code in Excel I return a boolean partAM = CheckBox15.Value I return true or false Here is my access code: Set xlapp = New Excel....

Integration Script to look for a specific character
Can someone provide me with a script in integration manager that will look for a specific character in a data field and if it finds that character, updates the currentfield one way and if it does not find it updates the currentfield another way. Thank you, Amy Dim SearchString dim SearchChar dim StartPosition dim TextCompare SearchString = SourceFields("QueryName.FieldName") SearchChar = "A" StartPosition = 1 textcompare = 1 If InStr(StartPosition , SearchString, SearchChar, TextCompare) > 0 then currentField = "someValue" Else CurrentField = &qu...

Read Only #6
Using Microsoft Excel 2000. How do I set up a file to be read-only and display the Read-only message when the file is openned. Also if the save is saved as something new will the read only carry over?? Thanks File|SaveAs (you can use the same name if you want) There's a tools button somewhere in that dialog (top right corner in xl2003, but it seems to move around in different versions). Then click Options (or General Options???). Give it a password to Modify (and only share that password with people who should update the file). And if anyone knows how to get to that dialog, then t...

XmlTextReader Question
I have the following XML i do the following to extract the name information XmlTextReader Reader = new XmlTextReader("C:\\names.xml"); while(tempReader.Read() ) { if(tempReader.Name.ToLower() == "name ") { //My problem here how to get firstname and last for the current name node by other words get the childs information from parent node } } <family> <name gender="Male"> <firstname>Tom</firstname> <lastname>Smith</lastname> </name> <name gender="Female"&g...

Forms Read Only Problem
I think I inadvertently set a form to read only on my personal computer. I would like to disable the read only restriction. The properties Allow Edits, Allow Deletions, and Allow Additions are all set to Yes. The records are not locked. Does anyone have any suggestions? John 134 Here are some possible things to check: http://allenbrowne.com/ser-61.html -- Bob Larson Access World Forums Super Moderator Utter Access VIP Tutorials at http://www.btabdevelopment.com If my post was helpful to you, please rate the post. __________________________________ "John134" wrote: > ...

Turn off "Subject: Not read" notification
My spam gets routed to a special directory by Cloudmark SpamNet - so far so good. I run through and delete it all after scanning for false negatives. But, some of the spam has the request read notification turned on. Outlooks sends a message to the sender with the subject line saying "Not Read" and a winmail.dat attachment. How can I turn this off? I don't want to be confirming my address to spammers, no have any unauthorized messages leaving my system. Please send your reply to my e-mail account - thanks! Bruce What version of Outlook are you using? Note: this...

Reading Exchange Logs
Hi Group, I am able to read the exchange logs in 2003, but it is really tough at times. Is there an add-on program to make reading of these logs easier or something I could adjust in the exchange systems manager? Thanks - Ron I assume you are talking about the Transaction Logs in the MDBDATA directory?, why do you need to read them, and there is no utility that will enable you to read them. -- Mark Fugatt Exchange MVP http://www.exchangetrainer.com http://www.msexchange.org "R. Brown" <rbrown_nospam@rbnetworking.net> wrote in message news:OhFv2bY0DHA.3496@TK2MSFTNGP11.ph...

Read only for all other users besides myself
I have an excel workbook (office 2000) that i need to put on a shared server for other departments to have access to, but they are all only to have "read only" access and are not allowed to make any kind of changes to the workbook. I need to be the only person to have exclusive rights to make any kind of modifications or updates to the workbook. I have no idea how to set this up so that they can not change their access rights and go in and change the workbook without me knowing. Thank you in advance for your help. Gail The best way may be to put the file in a folder on t...

how do i save my exel document so that i can read it
what is the correct way to save excel worksheets, and word documents when i open either one i get unreadable characters Save as Excel workbook and Word document. How are you currently saving? How are you opening them that gives you unreadable characters? Gord Dibben MS Excel MVP On Mon, 20 Aug 2007 13:42:03 -0700, smokey <smokey@discussions.microsoft.com> wrote: >what is the correct way to save excel worksheets, and word documents >when i open either one i get unreadable characters ...

OWA 2003 Reading Pane
I am unable to see the message body in the reading pane through OWA 2003. It shows the To: cc: etc information, but not the message body. Any ideas on what would cause this? I have tested this on multiple user accounts and from multiple workstations and they are all having the problem Thank you try cleaning out the C:\WINDOWS\IIS Temporary Compressed Files\ folder.. it seems to work for me.. "Lexiter" <anonymous@discussions.microsoft.com> wrote in message news:B30CC916-4E89-4218-B328-926C7B51C61F@microsoft.com... > I am unable to see the message body in the reading pa...

read the message please
Your previous transaction-level posting session has not finished processing. please allow time for it to finishg. if you believe it has faild, log out of dynamics and log back in to recover transactions. i do it but nothing, i run check link and nothing i restart the server but nothing last i delete the transacctions in dynamics but nothing. who want to help me. ...

Read PDF into XLS
Hi NG! Is it possible to convert PDF Files to XLS Files. Thanx for Posting Richie ...

After running a macro the first character, entered, is swallowed
Hello, after running of any macro sometimes the first character, entered, is swallowed in Word 2000 (on Windows XP SP3). Unfortunately I connot reproduce the exact circumstances for this strange behaviour - therefore the expression 'sometimes', but I can reproduce it on different computers. What may be the reason for this strange behaviour; how can this problem be resolved? Thomas Wiedmann We would have to see the code of the macro(s) to have any chance of helping you. It sounds like perhaps the document does not have the focus after the macro is run. -- ...

Hide many rows without loop?
Hi, I need to check the A:A cell in rows 778:876, 884:982, 989:1087 to see if it is empty ( "" ). If cells A:A are empty, I want its row to be hidden when I open the sheet. Now, with a new PC it takes 30 seconds to make a loop with a Worksheet_Activate event. Can someone help me do this fast, without using a loop? /Regards Gunnar Hi Do you mean really emty or do you have formulas that that evaluates to "" -- Regards Ron de Bruin http://www.rondebruin.nl "T. Skogstrom" <tskogstrom@hotmail.com> wrote in message news:2814a102.0406080549.282fc84b@posti...

Input position of current Node in XmlTextReader
Hello, Perhaps it's obvious, but I don't find any property in XmlTextReader to obtain the position of the current node. I know that I can obtain the position of the node in the current line (LinePosition) and the line number, but I need to know the position relative to the whole document. Thanks :-) alessnet@gmail.com wrote: > Perhaps it's obvious, but I don't find any property in XmlTextReader > to obtain the position of the current node. > I know that I can obtain the position of the node in the current line > (LinePosition) and the line number, but I need to ...

Formatting & Checking Text in a cell to ensure a minimum length of 30 characters
Hi, Can anyone help me please as I'm trying to join three cells of tex together A1 + A2 + A3 with the output in cell A4 e.g. "Help" & "Me" & "Please" = Help Me Please (in cell 4 whic works fine using the &) However, for formatting purposes I need to ensure that the text in A has a minimum of 30 characters so "Help Me Please" would have to b shown as "Help Me Please plus 15 spaces then an "!� mark e.g. "Help Me Please !" How do I check the text in A4 is less than 30 characters adding any a necessar...

Reading Last Row of Data
Is this possible? I have an excel document with two worksheets in it. Worksheet #2 is just a bunch of data sorted by date. Worksheet #1 displays data from the last row of worksheet #2. Is it possible to have excel detect the last row of data on Worksheet #2 and display it on Worksheet #1? Right now I am manually changing the cell references on worksheet #1 as I add data in worksheet #2. Any help would be greatly appreciated! -- sslack ------------------------------------------------------------------------ sslack's Profile: http://www.excelforum.com/member.php?action=getinfo&...

XMLTextWriter and XMLTextReader
I am looking for a way to open an xmltextwriter to append to an existing document. Currently I rename the existing document, then I created new one and copy over all the existing documents nodes. I would rather avoid renaming the files. These files can become quite large so I need to avoid loading an xmldocument as well. Does anyone have a pointer for me to review? Thanks in advance. I think I am going to go with this concept http://www.tkachenko.com/blog/archives/000053.html, I think it will suit my needs just fine. "amdrit" <amdrit@hotmail.com> wrote in messa...

How can I import from many Word Forms into one Excel Spreadsheet
What I ultimately need to do is take information from 100's of Word forms (completed electronically), and compile it all in to one Excel database. I have tried to save the MS Word form (.dot) to a .txt file and then open the .txt file in Excel. I have also tried to do a query to import the .txt file, but I don't know to compile from many different forms into one database. I am running in circles trying to use the help files included with the software. Can anyone help? Very grateful. Julie 1. Save all the completed Word forms as text (in Word, choose Tools>Options, and...

Reading Pane
Hi, Is there any option to controll reading pane for all OWA 2003 users ? I would like to configure the same reading pane view to all my usres Thanks Idan wrote: > Hi, > > Is there any option to controll reading pane for all OWA 2003 users ? > I would like to configure the same reading pane view to all my usres > > Thanks Not that I know of (and I have to wonder why you'd want to do this anyway), but you may get more help in microsoft.public.exchange.clients and/or microsoft.public.outlook. On Sun, 13 Mar 2005 03:53:01 -0800, "Idan" <Idan@discussions.m...