Note that the XML mixed content and whitespace design was inherited from SGML, 
where DTDs were required, and so a parser always knew for sure whether a given 
context was or was not mixed content.

It’s been a couple decades, but my memory is that anything we did in XML to 
address this in the face of not requiring any kind of grammar would have been 
even more disruptive, such as not allowing mixed content at all and having some 
special syntax just for identifying text nodes.

So it wasn’t really a decision so much as there not really being a better 
solution in the context of SGML as our starting point.

Cheers,

E.

_____________________________________________
Eliot Kimber
Sr Staff Content Engineer
O: 512 554 9368
M: 512 554 9368
servicenow.com<https://www.servicenow.com>
LinkedIn<https://www.linkedin.com/company/servicenow> | 
Twitter<https://twitter.com/servicenow> | 
YouTube<https://www.youtube.com/user/servicenowinc> | 
Facebook<https://www.facebook.com/servicenow>

From: BaseX-Talk <[email protected]> on behalf of 
Christian Grün <[email protected]>
Date: Thursday, November 17, 2022 at 11:01 AM
To: Jonathan Robie <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: [basex-talk] Pretty print
[External Email]

________________________________
But the indentation is quite different from what I see in Saxon or oXygen 
output when I indent.  You see this with more complex examples.

That’s true, every query processor uses custom indentation algorithms; the 
specification gives much freedom here [1]. If indentation is important, it’s 
always recommendable to either preserve the original formatting or use 
xml:space='preserve' for mixed-context sections.

I’ll never be happy with the decision in XML to lump together indentation of 
structure and content.

[1] 
https://www.w3.org/TR/xslt-xquery-serialization-31/#xml-indent<https://www.w3.org/TR/xslt-xquery-serialization-31/#xml-indent>

Reply via email to