Solved

how do I fix a xml error?

Posted on 2011-09-29
7
232 Views
Last Modified: 2012-05-12
I inherited a console app that reads in an xml file. However, when I run the app, I get an error: "There is an error in XML document (2, 2)." The inner exception error is {"<ArrayOfQF_DOW_Weight xmlns=''> was not expected."}. I am attaching the xml file for viewing. I am a xml newbie so not real familiar.

thanks. WeightsAndAdders.xml
0
Comment
Question by:bschave2
  • 4
  • 3
7 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36817695
If this is strictly XML related can I move this to more appropriate zones?
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36817702
The XML file looks correct.  What is throwing that error?
0
 

Author Comment

by:bschave2
ID: 36817750
public class QfDowWeights
      {
            public List<QfDowWeight> DayOfWeekWeights { get; set; }
            public QfDowWeights()
            {
                  var dataFilePath = Environment.CurrentDirectory + "\\WeightsAndAdders.xml";
                  var serializer = new XmlSerializer(typeof(List<QfDowWeight>));

                  using (var fs = new FileStream(dataFilePath, FileMode.Open, FileAccess.Read))
                  {
                try
                {

                    DayOfWeekWeights = serializer.Deserialize(fs) as List<QfDowWeight>;
                }
                catch (Exception ex)
                {
                    throw (ex);
                }
                        fs.Close();
                  }
            }
      }
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:bschave2
ID: 36817766
List<QfDowWeight> has the three properties. dayofweek, lookbackday and weight....taking the xml data and putting it into list of the QfDowWeight object.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36817773
I would like to move this to more appropriate zones.  It does not appear to be Oracle or ASP (the zone you selected is straight ASP not ASP.Net) related.
0
 

Accepted Solution

by:
bschave2 earned 0 total points
ID: 36931546
i fixed this by using xml reader.
0
 

Author Closing Comment

by:bschave2
ID: 36954269
nobody commented, so I figured it out for myself.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now