[MarkLogic Dev General] Quirks of generating xhtml with xquery
Dominic Mitchell
dom at semantico.com
Thu Aug 28 02:17:03 PDT 2008
On 27 Aug 2008, at 22:53, Eric Palmitesta wrote:
> One such quirk: Childless elements with no internal nodes and an
> explicit closing tag are automatically folded into elements with no
> closing tag. <div></div>, which is valid xhtml, will become <div />
> after being processed by MarkLogic (breaks visual representation).
> Some better examples are <script ...></script> and <textarea></
> textarea>, which are expected to contain no internal nodes in xhtml.
>
> I've taken to writing things like
>
> <script ... >{" "}</script>
>
> or
>
> <textarea> </textarea>
>
> which successfully preserves the explicit closing tag, keeping xhtml
> happy. Is there a more elegant way to do this?
>
> Are there other banana-peels I should watch out for when generating
> xhtml with xquery? Is creating an entire website by generating
> xhtml with xquery generally frowned upon, or accepted? Admittedly,
> it seems less flexible than a <web language>-based site, however the
> xdmp namespace seems to provide sufficient functionality, and
> transforming xml data into xhtml is incredibly easy with xquery.
Though it's not relevant to your particular problem, this is the
reason that we've stopped generating XHTML and gone back to outputting
HTML4. Trying to do XHTML in a text/html environment is fraught with
troubles like these.
Some more details:
http://hixie.ch/advocacy/xhtml
-Dom
More information about the General
mailing list