xml
Unit testing XML Generation [closed]
First, as pretty much everyone is saying, validate the XML if there’s a schema defined for it. (If there’s not, define one.) But you can build tests that are a lot more granular than that by executing XPath queries against the document, e.g.: string xml=”Your xml string here” ; XmlDocument doc = new XmlDocument(); doc.LoadXml(xml); … Read more
Use of XSL-FO, CSS3 instead of CSS2 to create Paginated documents like PDF?
Thanks all comments and answers! Now, 2014, passed over 1.5 years of my post (May 17 ’12), is time to consolidate: no answer was, for me, a “full answer”, but all answers (see Nenotlep’s and Alex’s) contributed to form a big picture. My main motivation now, to consolidate, is the @mzjn’s news (here) of 2013-11. … Read more
Empty namespace using Linq Xml
The “more correct way” would be: XDocument xdoc = new XDocument(new XDeclaration(“1.0”, “utf-8”, “true”), new XElement(ns + “urlset”, new XElement(ns + “url”, new XElement(ns + “loc”, “http://www.example.com/page”), new XElement(ns + “lastmod”, “2008-09-14″)))); Same as your code, but with the “ns +” before every element name that needs to be in the sitemap namespace. It’s smart … Read more
XML Schema to C++ Classes [closed]
Sounds to me like CodeSynthesis is exactly what you are looking for. It’s open source and c++.
How to convert XElement to XDocument
Just pass the XElement to the constructor of XDocument: var xdoc = new XDocument(new XElement(“a”, “b”));
Error ‘failed to load external entity’ when using Python lxml
In concert with what mzjn said, if you do want to pass a string to etree.parse(), just wrap it in a StringIO object. Example: from lxml import etree from StringIO import StringIO myString = “<html><p>blah blah blah</p></html>” tree = etree.parse(StringIO(myString)) This method is used in the lxml documentation.
Is there a better XML parser than XML::LibXML for Perl on Windows?
I think you are using a pretty good one. XML::LibXML, Matt Sergeant and Christian Glahn’s Perl interface to Daniel Velliard’s libxml2 is one of the faster XML Parsers that I know of.
How can I check for the existence of an element with Groovy’s XmlSlurper?
The API is a little screwy, but I think that there are a couple of better ways to look for children. What you’re getting when you ask for “xml.bar” (which exists) or “xml.quux” which doesn’t, is a groovy.util.slurpersupport.NodeChildren object. Basically a collection of nodes meeting the criteria that you asked for. One way to see … Read more