Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7172549
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:38:16+00:00 2026-05-28T15:38:16+00:00

i have the following xml (which i can not edit): <?xml version=1.0 encoding=UTF-8?> <ns0:prices

  • 0

i have the following xml (which i can not edit):

<?xml version="1.0" encoding="UTF-8"?>

<ns0:prices xmlns:ns0="http://schemas.some.com/sadas/Output">
  <pricepoint>
    <esid>
      ENG.GPL.DAY_AHEAD.PROMPT.PH.M
    </esid>
    <observationdate>20120123</observationdate>
    <observationtime>0000</observationtime>
    <price>22.1250</price>
    <quote>Q</quote>
  </pricepoint>
  <pricepoint>
    <esid>
      ENG.NBP.DAY_AHEAD.PROMPT.PH.M
    </esid>
    <observationdate>20120123</observationdate>
    <observationtime>0000</observationtime>
    <price>53.8500</price>
    <quote>Q</quote>
  </pricepoint>
  <pricepoint>
    <esid>
      ENG.NCG.DAY_AHEAD.PROMPT.PH.M
    </esid>
    <observationdate>20120123</observationdate>
    <observationtime>0000</observationtime>
    <price>22.0750</price>
    <quote>Q</quote>
  </pricepoint>
  <pricepoint>
    <esid>
      ENG.TTF.DAY_AHEAD.PROMPT.PH.M
    </esid>
    <observationdate>20120123</observationdate>
    <observationtime>0000</observationtime>
    <price>21.9500</price>
    <quote>Q</quote>
  </pricepoint>
  <pricepoint>
    <esid>
      ENG.ZEEBRUGGE.DAY_AHEAD.PROMPT.PH.M
    </esid>
    <observationdate>20120123</observationdate>
    <observationtime>0000</observationtime>
    <price>53.6500</price>
    <quote>Q</quote>
  </pricepoint>
</ns0:prices>

and the following object i want to map it to:

[Serializable]
public class Prices 
{

    public List<Pricepoint> prices { get; set; }
}

[Serializable]
public class Pricepoint
{

    public string Esid { get; set; }

    public DateTime Observationdate { get; set; }

    public int Observationtime { get; set; }

    public double Price { get; set; }

    public string Quote { get; set; }

}

Using the following method:

    public static object Deserialize(Type typeToDeserialize,byte[] bytes)
    {
        var mem = new MemoryStream(bytes);
        var ser = new XmlSerializer(typeToDeserialize);
        return ser.Deserialize(mem);
    }

which is invoed by Deserialize(typeof(Prices), byteArrayofXMLfile);

I do however get an error regarding the namespace line of the xml:

There is an error in XML document (3, 2)

I cant figure out what i am doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:38:17+00:00Added an answer on May 28, 2026 at 3:38 pm

    resolved the problem by letting visual studio generating the classes for me:

    C:\>xsd latest.xml
    Microsoft (R) Xml Schemas/DataTypes support utility
    [Microsoft (R) .NET Framework, Version 4.0.30319.1]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Writing file 'C:\latest.xsd'.
    
    C:\>xsd latest.xsd /classes
    Microsoft (R) Xml Schemas/DataTypes support utility
    [Microsoft (R) .NET Framework, Version 4.0.30319.1]
    Copyright (C) Microsoft Corporation. All rights reserved.
    Writing file 'C:\latest.cs'.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following start of an XSD: <?xml version=1.0 encoding=UTF-8?> <xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema xmlns:no=http://www.sychophants.com>
I have XML shaped like the following: <?xml version=1.0 encoding=UTF-8?> <feed xmlns=http://www.w3.org/2005/Atom xmlns:openSearch=http://a9.com/-/spec/opensearch/1.1/ xmlns:docs=http://schemas.google.com/docs/2007
I have the following snippet in my pom.xml (Full pom attached below which can
I have the following in my XSL which adds a xmlns to my XML.
I have an xml document which consists of a number of the following: -
I have an XML document which contains nodes like following:- <a class=custom>test</a> <a class=xyz></a>
I have a large XML file which in the middle contains the following: <ArticleName>Article
I have the following output (via link) which displays the var_dump of some XML
I have XML in the following format which I want to reformat: <blocks> <!--
I have a class which loads an xml file using the following: Path.Combine( AppDomain.CurrentDomain.BaseDirectory,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.