xml

refactor this dictionary-to-xml converter in python

It's a small thing, really: I have this function that converts dict objects to xml. Here's the function: def dictToXml(d): from xml.sax.saxutils import escape def unicodify(o): if o is None: return u''; return unicode(o) lines = [] def addDict(node, offset): for name, value in node....

XML with Cocoa Touch

I am a new learner at the area of Objective-C. I would like to retrieve data from XML page on the iPhone. Is it possible? It would be more helpful to me if I get an appropriate suggestion or code. ...

Comparing XMLs using XMLUnit RecursiveElementNameAndTextQualifier

Hi, I am trying to compare 2 XML files using XMLUnit 1.2. I am using the RecursiveElementNameAndTextQualifier() qualifier. When changing the order of some entities order in my XML, it causes XMLUnit to pass on some cases and fail on other cases. My XML file looks like this, and I'm comparing it to a similar copy with a simple locat...

Returning XML natively in a .NET (C#) webservice?

I realize that SOAP webservices in .NET return XML representation of whatever object the web method returns, but if I want to return data formatting in XML what is the best object to store it in? I am using the answer to this question to write my XML, here is the code: XmlWriter writer = XmlWriter.Create(pathToOutput); writer.WriteStar...

How to tell whether an XML document validates against a DTD or XSD?

In Java, I can validate an XML document against an XSD schema using javax.xml.validation.Validator, or against a DTD by simply parsing the document using org.xml.sax.XMLReader. What I need though is a way of programmatically determining whether the document itself validates against a DTD (i.e. it contains a <!DOCTYPE ...> statement) or ...

XML sorting

I have the following XML <fields> <field position="4" tablename="Students" headername="First Name" fieldreference="FirstName" orderbydirection="ASC" /> <field position="2" tablename="Students" headername="Last Name" fieldreference="LastName" orderbydirection="ASC" /> <field position="3" tablename="Students" headername="Race" field...

Flex Tree Node Naming question...

I have a tree in flex built from an XML document into an XMLlist In the XML the tags are all different and have a bunch of attributes each, and are not consistent. When I publish the file I want the name of the folders in the tree to be the tag. It is easy with attributes.. "@id" or something similar, but I can't find what it could be...

Logging causing XML Parsing to break?!

I'm seeing something very very strange happening in a Flex app I'm maintaining. I've been going through it removing all calls to trace() and replacing it with calls into the logging framework (using the built in mx.logging stuff). After doing so some XML parsing code suddenly broke, and I can't for the life of me figure out why. here'...

Format a date in XML via XSLT

When I use the XML serializer to serialize a DateTime, it is written in the following format: 2007-11-14T12:01:00 When passing this through an XSLT stylesheet to output HTML, how can I format this? In most cases I just need the date, and when I need the time I of course don't want the "funny T" in there. ...

jump to matching XML tags in VIM

Vim's % operator jumps to matching parentheses, comment ends and a few other things. It doesn't, however, match XML tags (or any other tag, to the best of my knowledge). What's the best way to jump to the matching XML tag using vim? Note: What I really want to do is duplicate a section in an XML file without manually looking for the ...

dynamically concatenating xml files with ant and xslt

Question We have a large number of xml configuration files that we want merged into one master version at build time. Smaller config files are easier to maintain and one large file loads faster so I imagined this to be a popular build transformation process that I would find lots of good examples of on the net. I was able to find some...

No Nodes Selected from Atom XML document using XPath?

I'm trying to parse an Atom feed programmatically. I have the atom XML downloaded as a string. I can load the XML into an XmlDocument. However, I can't traverse the document using XPath. Whenever I try, I get null. I've been using this Atom feed as a test: http://steve-yegge.blogspot.com/feeds/posts/default Calling SelectSingleNode()...

How to easily load a XML-based Config File into a Java Class?

I've got a simple java class that looks something like this: public class Skin implements Serializable { public String scoreFontName = "TahomaBold"; ... public int scoreFontHeight = 20; ... public int blockSize = 16; ... public int[] nextBlockX = {205, 205, 205, 205}; ... public String backgroundFile = "...

Reading the StackOverflow RSS feed

I'm trying to get a list of unanswered questions from the feed but am having trouble reading it. const string RECENT_QUESTIONS = "http://stackoverflow.com/feeds"; XmlTextReader reader; XmlDocument doc; // Load the feed in reader = new XmlTextReader(RECENT_QUESTIONS); //reader.MoveToContent(); // Add the feed to the document doc = new...

Partially loaded XML in Flash

In Flash it is possible to read XML data as the XML File loads? i.e. reading the partially downloaded XML string as the rest downloads, so we can process it as quickly as possible. Do you get an event that fires everytime small chunks of data downloads? like with URLLoader? Do you get access to the raw string since partial XML cannot b...

Storing base64 data in XML?

How I can store base64 strings in XML? Do you use CDATA to store base64 strings in XML? Would it help as it allows use of < > within the strings? Is base64 configurable where you tell it not to use certain chars if they conflict with XML? ...

Use CDATA to store raw binary streams?

Instead of the overhead with saving binary as Base64, I was wondering if you could directly store double-byte binary streams into XML files, using CDATA, or commenting it out, or something? ...

Flash - Change the CDATA end character?

Since I want to store raw binary streams in CDATA Sections of XML files, the 3 character CDEnd code might mistakenly match my binary. Any way to change the CDEnd code for Flash? I'd like it 10 char just for reliability. ...

Why xslt creats a new table but not uses the one of the template

I have a xml file like this <Root> ... <x></x> <node> ... <x></x> <y></y> </node> </Root> My xslt is <xsl:template match="/"> <!-- proceed the treatment of the statement before x--> <tr> <xsl:apply-templates match="Root/x"/> </tr> <tr> <xsl:apply-templates match="Root"/> </tr> </xsl:template> <xsl:template match=...

Why are null char disallowed even in CDATA sections?

XML, Why are null char disallowed even in CDATA sections? It seems to terminate the file right there. Any solution? Base64? ...