Tag Archives: xml

To XHTML or not to XHTML?

Today, we had a conversation about HTML 4 vs XHTML 1.0. For me, the matter was neatly settled they very first time I saw an XML system produce XHTML like this: <p>An article with an <em/> empty emphasis tag.</p> <p>An article with an <em/> empty emphasis tag.</p> Perfectly legal XML, perfectly legal XHTML. But — […]

SAX EntityResolver

I was trying to resolve entities (&weirdChar;) in an XML file. Easy enough, use a validating parser. But here’s the tricky bit: get the entity definitions from the classpath. This should still be easy, as SAX provides an EntityResolver. Unfortunately, the interactions between JAXP and SAX make life complicated. I found that you have to […]

Writing XML in Java

Last night, I was looking at generating SAMS XML from Java objects. It made me realise two things: Java sucks badly at creating XML (by default). I should really be looking at XML Binding. I’m interested in point 1. I’ve done it before, trying to write XML using DOM (as there doesn’t appear to be […]

Dynamic JUnit

Recently, I wanted to do something slightly unusual with JUnit. I’m working on a cocoon project, so there are squillions of little XML files floating around. These need to be all well-formed. So I want a test that parses each one. Then, CruiseControl can let us know when they get broken. First, I gave the […]

Cocoon

Surprising as it may seem if you only read this blog, I don’t do much Perl or Ruby or Rails. I try to in my spare time, but it’s not what I’m doing at $WORK. That’s mostly concerned with pushing around XML using Java. Right now, I’m trying to learn Cocoon. Cocoon is a framework […]

The year of XQuery?

Apparently, it’s the year of xquery. I’ve just started a large project at $WORK, of which XQuery is a fundamental piece. And I have to say I’m not so sure. From what I’ve seen so far, there are good and bad bits to XQuery. The good bits are that it’s really flexible and very easy […]

XML::Genx Plans

I was talking to Mark Fowler yesterday and XML::Genx came up. He had a couple of good points: It’s not absolutely clear in the documentation that any valid Perl string will work correctly (be it UTF-8 encoded or not). I need to double check the tests for this and amend the docs. The API is […]

XML::Filter::Normalize 0.1

A couple of days ago, I released

new XML::Genx

XML::Genx 0.19 is now out. Changes include: Allow namespace objects to be passed in to StartElementLiteral() and AddAttributeLiteral(). This makes it much easier to put things into the default namespace. Add a missing “static” declaration to some XS helper functions. Allow multiple different default namespaces inside XML::Genx::SAXWriter. Previously you would get a “Duplicate Prefix” error. […]

XML::Genx

Aristotle Pagaltzis has mentioned XML::Genx. Yay, it needs all the publicity that it can get. He highlighted some issues in XML::Genx::SAXWriter, which I need to address, although getting some consensus from the list first would be good. He also mentions a problem with default namespaces a little further on. I’ll have to look into that […]