![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | Re: Error while reading XML file having DOCTYPE Still getting the same error for line 1 Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "'>' is an unexpected token. The expected token is '"' or '''. Line 1, position 58." At line:1 char:28 + [xml]$FileContents <<<< = Get-Content -read 10kb "C:\test.xml" "Jean" <repondre@groupe.svp> wrote in message news:mn.6b527d73069f0c24.56820@windows... >> It is not parsing the <!DOCTYPE QXML PUBLIC '-//ABC//DTD XML QBD >> 2.0//EN'> line. If I remove this then the XML is properly read. > > doctype *must be* the first line > > regards, > > -- > Jean - JMST > Belgium > > |
My System Specs![]() |
| | #2 (permalink) |
| Guest | Error while reading XML file having DOCTYPE I am getting following error while reading a XML file. PS> [xml]$FileContents = Get-Content -read 10kb "C:\test.xml" Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". Error: "'>' is an unexpected token. The expected token is '"' or '''. Line 2, position 58."At line:1 char:28 + [xml]$FileContents <<<< = Get-Content -read 10kb "C:\test.xml" Here are the contents of my test.xml file <?xml version="1.0" ?> <!DOCTYPE QXML PUBLIC '-//ABC//DTD XML QBD 2.0//EN'> <QXML> <XMLMsgsRq onError="continueOnError"> <Rq requestID="11002_Add"> <Add> <Name>Cust1</Name> <FirstName>First</FirstName> <OpenBalance>456.12</OpenBalance> </Add> </Rq> </XMLMsgsRq> </QXML> It is not parsing the <!DOCTYPE QXML PUBLIC '-//ABC//DTD XML QBD 2.0//EN'> line. If I remove this then the XML is properly read. Is this the way the XML should be read? Or there is some problem with PowerShell cmdlet? Thanks, Nikhil |
My System Specs![]() |
| | #3 (permalink) |
| Guest | Re: Error while reading XML file having DOCTYPE > It is not parsing the <!DOCTYPE QXML PUBLIC '-//ABC//DTD XML QBD 2.0//EN'> > line. If I remove this then the XML is properly read. doctype *must be* the first line regards, -- Jean - JMST Belgium |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: Error while reading XML file having DOCTYPE "Nikhil R. Bhandari" <nikhilbhandari@hotmail.com> wrote in message news:%23w4Au2WZHHA.2436@TK2MSFTNGP06.phx.gbl... >I am getting following error while reading a XML file. You might want to view this thready from March 5th: "System.Net.WebClient and XML" Marco |
My System Specs![]() |
| | #5 (permalink) |
| Guest | Re: Error while reading XML file having DOCTYPE On 13 Mar, 12:35, "Nikhil R. Bhandari" <nikhilbhand...@hotmail.com> wrote: > Still getting the same error for line 1 > > Cannot convert value "System.Object[]" to type "System.Xml.XmlDocument". > Error: "'>' is an unexpected token. The expected token is '"' or '''. Line > 1, position 58." At line:1 char:28 > + [xml]$FileContents <<<< = Get-Content -read 10kb "C:\test.xml" > > "Jean" <repon...@groupe.svp> wrote in message > > news:mn.6b527d73069f0c24.56820@windows... > > > > >> It is not parsing the <!DOCTYPE QXML PUBLIC '-//ABC//DTD XML QBD > >> 2.0//EN'> line. If I remove this then the XML is properly read. > > > doctype *must be* the first line > > > regards, > > > -- > > Jean - JMST > > Belgium- Hide quoted text - > > - Show quoted text - Should you use " rather than ' in Doctype? Try <!DOCTYPE QXML PUBLIC "-//ABC//DTD XML QBD 2.0//EN"> |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to bypass DOCTYPE when loading xml document | Garios | PowerShell | 2 | 08-20-2008 03:27 PM |
| reading coma seperated text file error | Daz | VB Script | 2 | 06-11-2008 07:08 AM |
| error reading file | Richard Bell | Vista music pictures video | 0 | 04-15-2008 04:57 PM |
| RE: Reading XML Patch File for ESX in PowerShell | RichS | PowerShell | 8 | 02-01-2008 05:49 PM |
| Doctype in XmlTextWriter | Arto Viitanen | PowerShell | 2 | 02-21-2007 01:41 AM |