xml

Pretty printing XML files on Emacs

I use emacs to edit my xml files (nxml-mode) and the files were generated by machine don't have any pretty formatting of the tags. I have searched for pretty printing the entire file with indentation and saving it, but wasn't able to find an automatic way. Is there a way? Or atleast some editor on linux which can do it. ...

Why Are People Still Creating RSS Feeds?

...instead of using the Atom syndication format? Atom is a well-defined, general-purpose XML syndication format. RSS is fractured into four different versions. All the major feed readers have supported Atom for as long as I can remember, so why isn't its use more prevalent? Worst of all are sites that provide feeds in both formats - wh...

Using an XML catalog with Python's lxml?

Is there a way, when I parse an XML document using lxml, to validate that document against its DTD using an external catalog file? I need to be able to work the fixed attributes defined in a document’s DTD. ...

Does System.Xml use MSXML?

I'm developing a C# application that uses a handful of XML files and some classes in System.Xml. A coworker insists on adding the MSXML6 redistributable to our install, along with the .NET framework but I don't think the .NET framework uses or needs MSXML in anyway. I am well aware that using MSXML from .NET is not supported but I supp...

Load an XmlNodeList into an XmlDocument without looping?

I originally asked this question on RefactorMyCode, but got no responses there... Basically I'm just try to load an XmlNodeList into an XmlDocument and I was wondering if there's a more efficient method than looping. Private Function GetPreviousMonthsXml(ByVal months As Integer, ByVal startDate As Date, ByVal xDoc As XmlDocument, ByVa...

What's the best way to validate an XML file against an XSD file?

I'm generating xml files that need to conform to an xsd that was given to me. What's the best way to do this? ...

How do I validate xml against a DTD file in Python

I need to validate an XML string (and not a file) against a DTD description file. How can that be done in python? ...

insert/replace XML tag in XmlDocument

I have a XmlDocument in java, created with the Weblogic XmlDocument parser. I want to replace the content of a tag in this xmldocument with my own data, or insert the tag if it isnt there. <customdata> <tag1 /> <tag2>mfkdslmlfkm</tag2> <location /> <tag3 /> </customdata> I for example want to insert some url in the locati...

What's the best (most comprehensive) book on XML?

I have only a handful of books for each of Perl, Python, and SQL. I have around a dozen books on C and C++ combined. My stack of Java books outweighs me. After perusing the bookstore shelves I can see that I could easily make a Java-like investment in XML books. So I'm asking, is there one book that anyone can recommend that will tel...

Validation Patterns for Custom XML Documents

I have a web application that generates a medium sized XML dataset to be consumed by a third party. I thought it would be a good idea to provide some form of schema document for the XML that I generate so I pasted the XML into Visual Studio and got it to generate an XSD. The annoying thing is that my XML doesn't validate to the XSD that ...

Escaping XML tag contents

I have a simple CAML query like <Where><Eq><Field="FieldName"><Value Type="Text">Value text</Value></Field></Eq></Where> And I have a variable to substitute for "Value text". What's the best way to validate/escape the text that is substituted here in the .NET framework? I've done a quick web search on this problem but all what I found...

How to generate sample XML documents from their DTD or XSD?

We are developing an application that involves a substantial amount of XML transformations. We do not have any proper input test data per se, only DTD or XSD files. We'd like to generate our test data ourselves from these files. Is there an easy/free way to do that? Edit There are apparently no free tools for this, and I agree that Oxy...

Large, Complex Objects as a Web Service Result

Hello again ladies and gents! OK, following on from my other question on ASP.NET Web Service Results, Proxy Classes and Type Conversion. I've come to a part in my project where I need to get my thinking cap on. Basically, we have a large, complex custom object that needs to be returned from a Web Service and consumed in the client appl...

Mac iWork/Pages Automation

There is a rich scripting model for Microsoft Office, but not so with Apple iWork, and specifically the word processor Pages. While there are some AppleScript hooks, it looks like the best approach is to manipulate the underlying XML data. This turns out to be pretty ugly because (for example) page breaks are stored in XML. So for examp...

Best Practices for AS3 XML Parsing

I've been having some trouble parsing various types of XML within flash (specifically FeedBurner RSS files and YouTube Data API responses). I'm using a URLLoader to load a XML file, and upon Event.COMPLETE creating a new XML object. 75% of the time this work fine, and every now and again I get this type of exception: TypeError: Error #1...

cURL adding whitespace to post content?

I am attempting to POST against a vendor's server using PHP 5.2 with cURL. I'm reading in an XML document to post against their server and then reading in a response: $request = trim(file_get_contents('test.xml')); $curlHandle = curl_init($servletURL); curl_setopt($curlHandle, CURLOPT_POST, TRUE); curl_setopt($curlHandle, CURLOPT_POSTFI...

Enforce Attribute Decoration of Classes/Methods

Following on from my recent question on Large, Complex Objects as a Web Service Result. I have been thinking about how I can ensure all future child classes are serializable to XML. Now, obviously I could implement the IXmlSerializable interface and then chuck a reader/writer to it but I would like to avoid that since it then means I ne...

Loading System.ServiceModel configuration section using ConfigurationManager

Using C# .NET 3.5 and WCF, I'm trying to write out some of the WCF configuration in a client application (the name of the server the client is connecting to). The obvious way is to use ConfigurationManager to load the configuration section and write out the data I need. var serviceModelSection = ConfigurationManager.GetSection("sys...

How do you embed binary data in XML?

I have two applications written in Java that communicate with each other using XML messages over the network. I'm using a SAX parser at the receiving end to get the data back out of the messages. One of the requirements is to embed binary data in an XML message, but SAX doesn't like this. Does anyone know how to do this? UPDATE: I g...

XML Serialization and Inherited Types

Hi Guys, following on from my previous question I have been working on getting my object model to serialize to XML. But I have now run into a problem (quelle surprise!). The problem I have is that I have a collection, which is of a abstract base class type, which is populated by the concrete derived types. I thought it would be fine to...