Re: Custom XML formatting?

Tony Rogers <tony@gonk.net> writes:
> And @xml:space, strip-space, and preserve-space. But hasn’t anyone
> ever put a lot of time into really, REALLY using these everywhere
> possible, and then looked at the generated XML and thought “God,
> that’s just hideous!” ? I mean, it’s not uncommon for me to find
> that generated markup is irritating as hell to read.

That's certainly true.

I think there are two competing requirements here.

1. Sometimes I want to make the XML easy to read. I don't care about
the semantics of the elements.

2. In all other cases, I care very deeply about the semantics.
Whitespace is significant *everywhere* except "element only" content.
That is, elements that can only contain other elements, not any text.

If you don't validate, or you don't have a schema, *all* whitespace is
significant.

It's hard to balance those two requirements.

Better pretty printing of elements and attributes would be nice, though.

I guess it might be interesting to think about a spec for better
serialization. I'd certainly entertain the prospect of writing a Saxon
serializer that supported it...

                                        Be seeing you,
                                          norm

-- 
Norman Walsh
Lead Engineer
MarkLogic Corporation
www.marklogic.com

Received on Monday, 20 December 2010 22:45:42 UTC