You are not logged in.

#1 2007-05-26 20:25:14

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

XSLT - forcing ultimate HTML processing of open tags

I wish to process a sidemenu I have, composed of UL and LI elements, using XSLT. My problem is that I need unclosed tags in the XSL stylesheet as part of my processing, since UL and LI elements can be nested (so immediately closing each UL/LI element would be useless). So for example, I might have this in my XSL stylesheet:

<xsl:when test="node_name">
    <ul>
</xsl:when>

Obviously this isn't acceptable to the XML compiler in the browser or on the server, so instead I actually have to do this:

<xsl:when test="node_name">
    <![CDATA[<ul>]]>
</xsl:when>

or alternatively use ampersand notation (< >).

This allows the browser to process the XSL spreadsheet without issue, but of course produces the XHTML elements as text output, rather than processed instructions.

Is there any way to get the effect I want? I have tried many elements, like xsl:processing-instruction for example, to achieve the effect I want... nothing has worked though, and I don't think it logically can.

I was thinking that if I process the XML into XHTML on the server, then when this XHTML is rendered client-side the instructions would be processed, yes?

Advice is much appreciated.

- Dave

Offline

#2 2007-05-27 00:20:57

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: XSLT - forcing ultimate HTML processing of open tags

It does work. Cool! It's now processing the XSLT server-side, and then communicating the resulting XML to the client.

- Dave

Offline

Board footer

Powered by FluxBB