xml

Is DTD or XML schema better?

What are the pros / cons in DTD and XML Schemas (I'm not even sure what the official name of the latter is!)? Which is better? Why do we need two ways to do the same thing? Seems dumb, IMHO. :) Thanks, LES Edit: I found this in an article I was reading, which is what prompted me to ask the question: Why W3C XML Schema Language? ...

What's the easiest way in VB.NET to parse this XML into objects?

What's the easiest way in VB.NET to parse this XML? Here's an example of the full source: View Source XML I believe that the XML can be read directly into a class structure that matches the XML's structure. Let's take a bit of the XML from the above example, <?xml version="1.0" encoding="UTF-8" ?> - <kml xmlns="http://earth.goog...

Retrieve data from xml file and insert into database table

I am using c# .net 1.1 and SQL Server 2000.... I want to retrive data from an xml file and store that data into the database table. XML file: <information> <data> <id="1"></id> <name>peter</name> <age>25</age> </data> </information> My databse table is id int, name varchar(100), age int ...

C# Linq query Descendants method using variables

I am trying to use the C# Linq query Descendants method using variables. Here is part of the XML <CourseList> <course id="EM220" name="Fundamentals of Mechanics"/> <course id="EM305" name="Engineering Tools Seminar"/> <course id="EM320" name="Dynamics"/> </CourseList> Here is the query: static void GetAllCourseIds(XEleme...

XML Vs Annotations: Analytical approach

I intend to use the Pugh Decision Matrix to analytically reach a decision on this long running debate about the best approach (only with an academic interest though, it will be difficult to take sides). I invite you to suggest appropriate criteria for the comparison between these two approaches. ...

Parsing Google Earth XML data using VB.NET

Here is a simplified version of the XML returned. <?xml version="1.0" encoding="UTF-8" ?> <kml xmlns="http://earth.google.com/kml/2.0"&gt; <Response> <name>1321 herbert street, Warren, MI</name> <Status> <code>200</code> <request>geocode</request> </Status> <Placemark id="p1"> <a...

WCF service, response in SOAP or plain XML, how?

Hello guys. I am struggling few hours with this and can't find a solution to the communication problem. My service need to communicate with clients via SOAP or plain XML My service will be written based on WCF framework, however my clients not. Could you show me step by step how to change my service code and configuration in a way th...

XML node format (add new line/tab)?

How to format XML node to match the following format? How to add new line / tab? <Note description = "Dear Sir /Madam, **(insert new line)** **(insert tab)** This is to inform you ..." /> Output: Dear Sir /Madam, This is to inform your that the below mentioned vehicle[s] have attracted ... ...

LINQ to XML query in c#

How can query below document so it would give me value of "id" (the one in the root after status) ? this gives an error (Object reference not set to an instance of an object.) using (WebResponse response = request.GetResponse()) { using (StreamReader reader = new StreamReader(response.GetResponseStream()...

In rails, how to visit url with post method and submit some xml data?

For example, in rails, I want to vist the url "http://127.0.0.1:8080/solr/update" with the http method "post", and submit a xml data, how can I achieve that? ...

need to remove xml nodes in a string and leave the text

i have the string which is a part of an xml. a<b>b</b>c<i>d</i>e<b>f</b>g the problem is that i want to extract from the string the parts that are not inside any tags. so i need to extract the string"aceg" from this string and leave the characters "bdf" how can this be done? Edit: this was a part of an xml let asume its <div>a<b>b<...

How do I populate a WPF Combobox with XPath queries stored in a file?

I have two files -- the first (data) is an XML document, and the second (queries) contains XPath queries I would like to run on the first document. I would like to populate a combobox in WPF to the queries, so that it displays the names of the XPath queries. When the user selects an item in the combobox, it should populate a listbox wit...

ASP.NET website problem while requesting XML data from remote server

Hi , I am writing code in asp.net to get XML data from external webserver. *.cs Code connection string: URL of external(third party) server for XML data WebRequest req = WebRequest.Create(connectionString); req.Proxy = WebProxy.GetDefaultProxy(); req.Proxy.Credentials = CredentialCache.DefaultCredenti...

Java+DOM: How do I set the base namespace of an (already created) Document?

Hello! I am dealing with an already created Document object. I have to be able to set it's base namespace (attribute name "xmlns") to certain value. My input is DOM and is something like: <root>...some content...</root> What I need is DOM which is something like: <root xmlns="myNamespace">...some content...</root> That's it. Easy,...

Programmatically creating an XML Document using an XSD

Hi I need to create XML documents using built-in java org.w3c.dom or jdom packages conforming to a set of XSD files. The XSD files are similar but not the same. In essence, I need to create the XML file as per the XSD given to me dynamically. What is the best way to do it. I have checked the Validator package, it does not have any fea...

imsmanifest.xml should be utf-8 or not (Scorm 1.2)

Should I save imsmanifest.xml in UTF-8 or ANSI ? ADL test suite 1.2 seem to fail with UTF8 header, but on otherhand some LMSes will fail if its not UTF8. ...

WCF REST service - DataContract stops constructor?

Hi, I have a strange problem that's happening with my WCF REST service. For an operation where it accepts data, let's say it accepts the Foo class: [WebInvoke(Method = "PUT", UriTemplate = "users/{username}")] [OperationContract] public void UpdateLoginUser(string username, LoginUser userUpdated) { [...] } Now my LoginUser class inh...

Represent script source code in XML

Are there any resources on how to represent (script) code in XML? Libraries, XML schema definitions for this? What I want to try is to generate a XML representation of (at first) simple script code (such as Bash shell scripts). So I would need support for variables, if/else, loops. Later on I want to be able to write language-independen...

Noob is parsing Google Earth XML data using VB.NET, part III

I have this XML that I am trying to read into an object hierarchy: <?xml version="1.0" encoding="utf-8"?> <kml xmlns="http://earth.google.com/kml/2.0"&gt; <Response> <name>1321 herbert street, Warren, MI</name> <Status> <code>200</code> <request>geocode</request> </Status> <Placemark id="p1"> <address...

Is there any Python XML parser that was designed with humans in mind?

I like Python, but I don't want to write 10 lines just to get an attribute from an element. Maybe it's just me, but minidom isn't that mini. The code I have to write in order to parse something using it looks a lot like Java code. Is there something that is more user-friendly ? Something with overloaded operators, and which maps element...