xsl-list
[Top] [All Lists]

Re: [xsl] Simple Question

2007-01-31 09:41:13
Punnoose, Roshan wrote:
Thanks for the replies. I'm better understanding how XSLT works and with
a little help able to get this to work:

<xsl:if test="$a != $times">
                <xsl:text
disable-output-espacing="yes">&lt;xqx:orOp&gt;</xsl:text>
                        ...
        </xsl:if>

Of course, there are problems in this too, but I'm working them out.

The reason I had to do it this way is because I'm working on a recursive
loop that prints out a binary node tree, which I sort of needed this
for. (Though there probably is a way to do it a little cleaner.)

Regardless of your original problem, this is not the way to do it, and it won't work the way you intend either. There are ways to output non-xml text in an xml serialized output stream, and the preferred way with XSLT 2 is character-maps (but still, you can't output characters that cannot be represented in XML).

If you really have no need for <xqx:orOp>... </xqx:orOp> (nodes) but instead <xqx:orOp>...<xqx:otherOp> (text) you should consider another solution, like using output-method 'text'. This also prevents you from falling into the trap of creating nodes, when you mean the text (which looks like nodes when serialized, but really aren't), because nodes are not serialized in with the text-method (only the 'value-of' value of the nodes).

Please inform us a bit deeper of the target format that you are creating. If it is XML, you must choose another way, if it is text that resembles XML, you may want to use XSLT in text-mode or another language.

-- Abel


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>