I'm in a real pickle. I've inherited a project with major problems. It
receives encrypted XML files from a website not under my control (so I can't
modify the web app) for insertion into a database. I'm under intense
pressure to get the data into the database NOW. I can decrypt the files
alright and they look like xml, they'll import into Access 2K3 with no
problem, but VB.Net will not read them. It's complaining about no root
element, and it's right there is no root element. I've tried manually
adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file.
<dsFullStudentD ataNew xmlns="NetFrame Work">
<student_tabl e>
<ssn>00000000 0</ssn>
<first_name>rus hmi</first_name>
<middle_initial >p</middle_initial>
<last_name>john </last_name>
<dob>11/12/1978</dob>
<gender>Femal e</gender>
<present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True)
Dim fout As FileStream = DecryptFile(sIn file)
Try
Dim xmlRdr As New XmlTextReader(f out)
xmlRdr.XmlResol ver = Nothing
dsXML.ReadXml(x mlRdr) <------------error here
Catch e As Exception
Console.WriteLi ne(e.ToString() )
End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem
with missing root element.
What can I do to get this abomination running?
Thanks. 5 8062
Have you tried using dsXML.Read() instead?
Max
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. .. I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root element, and it's right there is no root element. I've tried manually adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file. <dsFullStudentD ataNew xmlns="NetFrame Work"> <student_tabl e> <ssn>00000000 0</ssn> <first_name>rus hmi</first_name> <middle_initial >p</middle_initial> <last_name>john </last_name> <dob>11/12/1978</dob> <gender>Femal e</gender> <present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True) Dim fout As FileStream = DecryptFile(sIn file) Try Dim xmlRdr As New XmlTextReader(f out) xmlRdr.XmlResol ver = Nothing dsXML.ReadXml(x mlRdr) <------------error here Catch e As Exception Console.WriteLi ne(e.ToString() ) End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem with missing root element.
What can I do to get this abomination running?
Thanks.
If the file is smallish you could read it all into a "string" using
StreamReader.Re adToEnd() then do this:
Dim reader as New StreamReader(fo ut); ' do you know the encoding? If so
pass it to the constructor here
Dim fixedXml = "<root>" + reader.ReadToEn d() + "</root>"
Dim xmlRdr As New XmlTextReader(n ew StringReader(fi xedXml))
....
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message
news:%2******** ********@tk2msf tngp13.phx.gbl. .. I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root element, and it's right there is no root element. I've tried manually adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file. <dsFullStudentD ataNew xmlns="NetFrame Work"> <student_tabl e> <ssn>00000000 0</ssn> <first_name>rus hmi</first_name> <middle_initial >p</middle_initial> <last_name>john </last_name> <dob>11/12/1978</dob> <gender>Femal e</gender> <present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True) Dim fout As FileStream = DecryptFile(sIn file) Try Dim xmlRdr As New XmlTextReader(f out) xmlRdr.XmlResol ver = Nothing dsXML.ReadXml(x mlRdr) <------------error here Catch e As Exception Console.WriteLi ne(e.ToString() ) End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem with missing root element.
What can I do to get this abomination running?
Thanks.
dataset.read()
does not seem to be a method of the dataset object.
Thanks anyway.
"Max Schneider, Image Innovation" <ma*@imageinnov a-takethisout.com > wrote in
message news:Xs******** ***********@fe0 4.lga... Have you tried using dsXML.Read() instead?
Max
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. .. I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root element, and it's right there is no root element. I've tried manually adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file. <dsFullStudentD ataNew xmlns="NetFrame Work"> <student_tabl e> <ssn>00000000 0</ssn> <first_name>rus hmi</first_name> <middle_initial >p</middle_initial> <last_name>john </last_name> <dob>11/12/1978</dob> <gender>Femal e</gender> <present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True) Dim fout As FileStream = DecryptFile(sIn file) Try Dim xmlRdr As New XmlTextReader(f out) xmlRdr.XmlResol ver = Nothing dsXML.ReadXml(x mlRdr) <------------error here Catch e As Exception Console.WriteLi ne(e.ToString() ) End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem with missing root element.
What can I do to get this abomination running?
Thanks.
That seems to have done it. All my files are small < 65K (so far). So I
should be able to use this for the remainder of the scholarship application
season. I'll need to redo the website and - well the entire system needs to
be scrapped and rewritten.
Thanks so much. The students will never know who helped them get their
scholarships.
Thanks.
"Chris Lovett" <so*****@nospam .please> wrote in message
news:we******** ************@co mcast.com... If the file is smallish you could read it all into a "string" using StreamReader.Re adToEnd() then do this:
Dim reader as New StreamReader(fo ut); ' do you know the encoding? If so pass it to the constructor here Dim fixedXml = "<root>" + reader.ReadToEn d() + "</root>" Dim xmlRdr As New XmlTextReader(n ew StringReader(fi xedXml))
...
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. .. I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root element, and it's right there is no root element. I've tried manually adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file. <dsFullStudentD ataNew xmlns="NetFrame Work"> <student_tabl e> <ssn>00000000 0</ssn> <first_name>rus hmi</first_name> <middle_initial >p</middle_initial> <last_name>john </last_name> <dob>11/12/1978</dob> <gender>Femal e</gender> <present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True) Dim fout As FileStream = DecryptFile(sIn file) Try Dim xmlRdr As New XmlTextReader(f out) xmlRdr.XmlResol ver = Nothing dsXML.ReadXml(x mlRdr) <------------error here Catch e As Exception Console.WriteLi ne(e.ToString() ) End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem with missing root element.
What can I do to get this abomination running?
Thanks.
I see from another post that you found another way around the problem. I
also see that you mentioned dataset.read(); case is important in C++, and I
know that you're coding in VB...did you try dataset.Read()? I see it listed
as a method of XmlTextReader.
Regards,
Max
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message
news:uO******** ******@tk2msftn gp13.phx.gbl... dataset.read()
does not seem to be a method of the dataset object.
Thanks anyway.
"Max Schneider, Image Innovation" <ma*@imageinnov a-takethisout.com > wrote in message news:Xs******** ***********@fe0 4.lga... Have you tried using dsXML.Read() instead?
Max
"Paul Nations" <pa***@adhe.ark net.nospam.edu> wrote in message news:%2******** ********@tk2msf tngp13.phx.gbl. .. I'm in a real pickle. I've inherited a project with major problems. It receives encrypted XML files from a website not under my control (so I can't modify the web app) for insertion into a database. I'm under intense pressure to get the data into the database NOW. I can decrypt the files alright and they look like xml, they'll import into Access 2K3 with no problem, but VB.Net will not read them. It's complaining about no root element, and it's right there is no root element. I've tried manually adding a root to the decrypted file but the remainder winds up unreadable.
Here is the top few lines of the decrypted file. <dsFullStudentD ataNew xmlns="NetFrame Work"> <student_tabl e> <ssn>00000000 0</ssn> <first_name>rus hmi</first_name> <middle_initial >p</middle_initial> <last_name>john </last_name> <dob>11/12/1978</dob> <gender>Femal e</gender> <present_addres s>16 kavanaugh</present_address >
The code I'm using to try to read this is:
dim sInfile as String = OpenFile(True) Dim fout As FileStream = DecryptFile(sIn file) Try Dim xmlRdr As New XmlTextReader(f out) xmlRdr.XmlResol ver = Nothing dsXML.ReadXml(x mlRdr) <------------error here Catch e As Exception Console.WriteLi ne(e.ToString() ) End Try
The error I'm getting is The root element is missing.
But, there has to be a way tor read this file. Access 2k3 has no problem with missing root element.
What can I do to get this abomination running?
Thanks.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Cheryl Gilbert |
last post by:
I'm sending xml to a web service by building a string dynamically.
When my web service tries to validate the xml with a schema, I'm
getting the error "the root element is missing". If I use an xml file
saved to disk, I don't get an error.
Does anyone know what the problem could be?
- Cheryl
Public Function ValidateXML(ByVal sXML As String) As String
|
by: Samem N via DotNetMonster.com |
last post by:
Does anyone know how to solve this error? I dont know where it went wrong.
Any help would be appreciated .Thanks
ERROR
______
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information about
the error and where it originated in the code.
|
by: cordata5 |
last post by:
Hi I'm using the example posted on Ron Howard's site for encryting the
body of an xml file located at http://www.gotdotnet.com/team/rhoward/
I'm running into trouble where i'm getting an error of this type:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.Xml.XmlException: The root element is
missing. at System.Xml.XmlTextReader.Read() at
System.Xml.XmlReader.MoveToContent() at...
|
by: Scott Emick |
last post by:
I am still having issues with getting Root Element Missing instead of the
actual error that the webservice call is supposed to be returning. I'm
using VB .Net 2003.
Has anyone else been able to get around what seems like a bug in the
dotnet framework?
Scott Emick
|
by: VK |
last post by:
Can be multiple instances of element used as the root element?
That's a curly way of asking, but I did not come up with a better
sentence, sorry. What I mean is with a document like:
<?xml version="1.0" encoding="UTF-8"?>
<root>
<element>Content</element>
<root><element>Content</element></root>
<element>Content</element>
| |
by: Tomas |
last post by:
When I try to load my xslt i get an xml exception with the message "Root
element is missing". The stylesheet works when I preview it in stylus
studio, but apparently not in my application. Any ideas what may be wrong?
The stylesheet:
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output indent="yes"/>
|
by: Dave Hill |
last post by:
Forgive a newbie question. I'm learning the .NET XML environment.
In the walkthrough on using XML designer to create an xsd, there is no
discussion of the root element of the target xml document. I realize that the
namespace specifying the xsd is an attribute of the root element of an xml
document conforming to the xsd, so is logically outside the xsd.
I built a simple schema, then added an XML document, added a root element to
the...
|
by: hvs69 |
last post by:
I am writing a little application in c# which requires application of XSL transform on a RSS feed from YouTube. Here is the relevant code
HttpWebRequest myreq = (HttpWebRequest)WebRequest.Create(UrlList);
HttpWebResponse myrep = (HttpWebResponse)myreq.GetResponse();
MemoryStream RSSOut = new MemoryStream();
StreamReader mystream = new StreamReader(myrep.GetResponseStream(), Encoding.UTF8);
...
|
by: Lalitha Yadav |
last post by:
getting an error as root element missing while reading and xml doucement
string path = Server.MapPath("~/App_Data/use1.xml");
DataSet DS = new DataSet();
DataTable dt = new DataTable("Test");
dt.Columns.Add("totalvolume", typeof(string));
dt.Columns.Add("totalvalue", typeof(string));
dt.Columns.Add("totaloi", typeof(string));
dt.Columns.Add("totaltrades", typeof(string));
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |