best way to deserialize xml
I'm at a quandry as to what's the best/fastest way to deserialize an
incoming xml stream?
I ran a small test on xmlserializer and on a small file it performed 10
times worse then when I used the XMLDocument and deserialized the values
myself. Is the xmlserializer really that slow?
I'm expecting a file about 1 MB in length and if it's that slow on a 2 K
file then I can't phantom how it's going to behave on a 1 MB file.
Should I just skip the xmlserializer and XML Dom and go straight to
xmlreader and do the deserialization myself?
This has been discussed a few times...Validating XML with XSD's
I have written a small app that uses the XmlValidationReader and a customer
ValidationEventHandler function. When I validate the XML I get detail
structured information like child is not defined or structure is invalid but
now I am getting into facets. I am working with data lengths and I have
found that I get the following message when a value is the incorrect length:
"The 'elementname' element has an invalid value according to its data type.
The real error is that the data value is longer than allowed. In XML Spy I
receive the follwing error for this scenario: "Value Doe...How can I use XML in Excel 2003 Student edition?
AFAIK you can't as this feature is not available in this version
"jim22" <firstname.lastname@example.org> schrieb im Newsbeitrag
...XML Root Info
OK, I am not any closer than I was yesterday.
I have an XML doc that need to have this info.
How do I get it in there. I have read all through the attirbute class and
even posted a post on here where the person told me I was doing something
wrong. How do I change the xmlns and add the xsi: info inthe stream. I have
classes set up that I desearialize. Do I just have to copy the...load hierarchically related data from xml
I am researching some options for loading hierarchically related data
from xml into an sql server database. I do not have the primary keys in the
source xml files. The primary keys are identity fields in the tables, and
are auto generated integers. I have about 40 tables that are related, and
the data is contained in a single xml file that will be hierarchical and
I am using the following technology/tools:
SQL Server 2000 sp3a
..Net framework on the servers, latest updates
The product requirements include using C#, .Net framework on the
servers, xml, an...Imports System.Xml In VS 2010
OK, I tried the web forums, but since the real gurus hang out here...
This has to be me, but I'm stumped :-(
I'm setting up a simple XML read-write demo (VB Winforms) in Visual Studio
2010 Premium (tried in both the RC and RTM) and added:
Result: Error Namespace or type doesn't contain any public members or cannot
VS 2008 equivalent example recognizes the Imports statement fine.
Note: I tried this with the app targeting both .Net 3.5 and 4.0. Same result
(two different PC's).
Any advice much appreciated (and, I'll ac...Stop and Resume parsing of large XML file
Currently I am using XmlReader (but I am open to other options) to parse an
XML file, and I would like to be able to stop/break the current parse
(simple enough) and then resume it later (say after a reboot). Is there any
way to get the current location in the file that the XmlReader has reached
so as to be able to restore that and start from that point later?
Brian Cryer wrote:
> Currently I am using XmlReader (but I am open to other options) to parse
> an XML file, and I would like to be able to stop/break the current parse
> (simple enough) and then resume it later (...Converting XML > Dataset
Here's my problem in english :-)
I want to convert the mssecure.xml file from Microsoft into an dataset to
store it in an SQL-Database.
My code in VB looks like this :
Dim ds As New DataSet
Dim doc As New Xml.XmlDocument
Dim sReader As New StringReader(doc.InnerXml)
The problem is : At the ds.readxml(sreader) command i get an error which
told me, that there is an problem whith a relationship in "ProductFamilies"
I hope my english is good enough to explain...
Please help !
C...convert a custom config file to XML
I need to convert a home made config file to an XML one.
My config file looks like this (it's an app that display some text in
function of time):
I don't know how to do it, maybe something like this but don't know if it's
possible to do this:
<Date = "241104">
<Lab...XML Instance from XML Schema
How do I create an instance of XML from XML Schema (xsd to be specific) and
instantiate its elements in C#?
> How do I create an instance of XML from XML Schema (xsd to be specific) and
> instantiate its elements in C#?
What you can do is getting Schema-information from the SchemaObjectModel
and build some XML for this. But as there is not "the one" XML-file that
matches the schema, there is no easy way (consider XHTML).
Can I create a cs file from schema using XSD tool and then create new
instance and instantiate it a...Import of XML on Virtual Machine
We are attempting to import an xml schema into a Virtual Machine (sbs server
o/s) but in the past this has worked effectivly in order to test client
customizations and create crystal reports in test environment.
This instance we are recieving errors (up to 8-10) during the import of the
schema onto the virtual machine.
Any help greatly appreciated!
Is this the same XML file as imported previously?
Are the errors all similar? Could you post an error here please. Import
aren't always anything to be concerned with, it may just be the...Trying to read XML file into dataset
Developing a web site in VS2005, SP1, VB, .NET 2.0, ASP.NET 2.0 on XP Pro,
I eventually want to use a gridview table to view xml data, but right now i
can't seem to get my xml data into a dataset so that i can use it.
I have an XML file and can open it in IE. There is no XSD or XSL file to go
I can't seem to get the XML data into a dataset. I tried using the
following code, but it just does nothing. It doesn't give an error. It
just executes the code and does nothing.
Dim dataSet As DataSet = New DataSet
dataSet.ReadXml("...Question regarding Linq to XML query
This is my first foray into Linq for XML, so I'm probably doing something
relatively easy to correct. First off, I have some XML similar to below:
time="2009-04-28T19:04:02+0000" priority="0" ...Mapping dataset tables to XML output
I'm really stuck with this one. I have a dataset with two tables. One table
is company data, and the other is contacts. I populate these by using a SP in
SQL Server which returns the two tables in one call. I'm using Microsoft
EnterpriseLibrary for Data to get the data from SP. It works fine and I get
two tables in the dataset, "Table1" and "Table2".
I then have an XML-file, which will serve as a template to generate the
XML-schema, which I load into the dataset with the InferXmlSchema method.
This gives me a perfectly good looking XML-Schema of how I w...XML errors in webservice call
I am creating some code that runs in Excel using VSTO. I am trying to get
some xml from a webservice, using the following code:
GBWPipeline.PipelineService pipeline = new GBWPipeline.PipelineService();
string xml = pipeline.GetOfferSale(OfferSheetId, CustomerId).GetXml();
I get a "There is an error in XML document. (1, 220)" message. If I execute
the same method from WebServiceStudio, it works fine (using the same values
for the parameters) and returns the xml that I expect (and doesn't complain
about any errors). It also works in a normal WinForms application. It is
only insid...Scanning website files on the fly
One of my websites got infected with a virus and was blocked by Google.
I stumbled across this page and it really helped me getting the problem
solved very quickly without having to reupload my website from my
I can't paste the whole method here because it's explained in pictures.
I hope this will help someone.
Their are many well known and known to be good sites, that will help others
with malware and virus infection, I wouldn't click on any link inclu...Newbie in XML with C# question
I am learning how to using XML documents to store data.
I get this error:
Access to the path "c:\inetpub\wwwroot\Info.xml" is denied.
I have tried with the full path of the file, with / infront of the file.
How do I get the data in too the xml document
Here is the code below:
...VB.NET: Writing attribute and Elements to Xml
Say i have this Xml file
how to create another automatic set of IDs and datas for the Xml tag so that
when i type in another set of data...
The content of the Xml file will become:
<...XML Guru Needed!
In converting a VB6 app using MSXML2 to a VB.NET app using System.xml, I'm
looking a cross-reference. What would the equivalent .NET XML command be to
Steve Covert wrote:
> In converting a VB6 app using MSXML2 to a VB.NET app using System.xml, I'm
> looking a cross-reference. What would the equivalent .NET XML command be to
If you want to do an XSLT transformation in .NET 1.0 or 1.1 look at
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpre...Getting XML back to the server.
I generate some XML and then load it into the XML web control so that I can
Assuming I add a new node to the XML data, is there a way to easily get it
back to the server. I can always set the value of a textbox to the XML data
and then reload the XML Webcontrol on postback, but I thought there might be
a better way.
Thanks in advance.
Well, consider a hidden form control rather than a textbox as a textbox has
size limits that a hidden form field does not.
You might also take a look at using XML Data Island the DataSourceObject
[DSO] (IE O...Problems validating an xml file without specifying the default namespace.
I'm trying to validate an xml document. I'm having trouble setting the
default namespace of the xml document. If I hard encode the namespace
in the xml file then everything works fine. But I can't do this
because it breaks our old tools which validate the xml to a dtd (error
saying the dtd doens't allow xmlns attribute on the root element). So
I'm trying to add the default namespace to the xml file by code. As
string DefaultNameSpace = "http://www.mydefaultnamespace.com";
NameTable nt = new NameTable();
XmlNamespaceManager nsmgr = new XmlName...Open and Save XML
I am using Excel 2000 and want to open and save files in XML.
1. Is there anyway to do this?
2. Do you know of any converters to install so that it can be done?
Somebody please tell me what is the matter with the
I don't seem to be able to access no matter how I try...
Do you have any namespaced attributes on the element?
This posting is provided "AS IS" with no warranties, and confers no rights.
"Rein Petersen" <email@example.com> wrote in message
> Somebody please tell me what is the matter with the
> System.Xml.Schema.XmlSchemaElement.UnhandledAttributes property.
> I do...Complex XML transformation in a better performance way?
The problem is how to achieve the transformation as below:
The source xml contains tons of repeating structure like below, each item
node contains a person element and a insurance element that correlate to the
Person element with the person id.
<Person id=”p123” name=”someone1”>
<Insurance ref=”p123” detail=”blabla1”>
<Person id=”p123” name=”someone1”>
<Insurance ref=”p456” detail=”blabla2”>
<Person id=”p456” name=”someone1”>
<Insurance ref=”p123” detail=”blabla3”>
Th...xml schema: elements with unique attribute values.
I�m a bit newbie writing xml schemas.
Is it possible to define xml element that must have unique attribute
values in same level. For example if i have a xml - document:
<!-- subsection contents -->
<subsection name="first"> <!-- ERRROR!!! -->
<!-- subsection contents -->
<!-- subsection contents -->