XmlWriter

September 21st, 2002 by Hen

I’ve had my first run in with SourceForge. The XmlWriter code I wrote my first real article on, and then committed to Jakarta Commons Util is going to just decay in there as Util is a bit of a dead end at the moment.

Equally, xml.apache.org isn’t really after that kind of thing, so I’ve started a project at SourceForge named XmlWriter.

Things still to do:

Learn how to release a 1.0 release.
Make a Logo for the home page.
Join the Java Foundry. Look for an XML Foundry.

Start figuring out features for 2.0. The biggest one that springs to mind is hooking up an XML Schema and verifying output at runtime. Anyone who knows if an XML Schema library exists out there, would be nice. Same for DTD. Else XmlWriter may have to spawn those projects.

4 Responses to “XmlWriter”

  1. moatas Says:

    Dude,
    Most XML parses these days will do schema validation. Xerces definitely will.

    Jim

  2. bayard Says:

    Yeah I know. But I want to parse the XML as I write it out. Pumping it into an XML parser seems a poor way to do it.

    What I want to do is have a Schema or DTD passed in, then as I write each tag I will check with the [generic?] schema to make sure that tag is allowed to be written out.

    I need to see if Xerces et al allow the Schema/DTD to be handled separately from the actual XML as I want to control/drive the schema checking without parsing. Failing that I can always suck the code out and genericise it.

  3. moatas Says:

    I understand the concept better now, but I think it will be very difficult to accomplish. The complexity of schema rules will be the major factor. When writing out a tag ‘name’ for instance, if it is in the context of a ‘person’, maybe it can be written, but in the context of ‘place’, it can’t. It wil be interesting to see what you(or others) will come up wuth, but that simple concept looks to be a fairly daunting challenge.

  4. jstrachan Says:

    Have you tried out the JARV API as part of Sun’s MSV? It allows you to perform schema validation via a SAX event stream. You can process the SAX events however you wish and capture the schema failures however you wish.

    Works with DTDs, XML Schema, RelaxNG etc.

    Its used in Jelly in the jelly:validate library.

    http://jakarta.apache.org/commons/sandbox/jelly/tags.html#jelly:validate