RE: [xsl] replace &lt; and &gt; with < and >

Subject: RE: [xsl] replace &lt; and &gt; with < and >
From: "bryan" <bry@xxxxxxxxxx>
Date: Fri, 20 Sep 2002 12:10:32 +0200
>> The xml file is returned from a method is in a string format, 
>> and the xml 
>> file seems to encode all < and > using &lt; and &gt;. So, 
>> what I need to do 
>> is to convert that xml file from a string to a xml nodelist 
>> so I can access 
>> all the elements.

>No, you need to correct the program that is generating the XML so that
>it does it properly.

Funny enough I'm dealing with the same problem, the problem in my case
is caused by msxml's screwy philosophy of extension functions, i.e that
the function can only return text, thus if you have an extension
function that returns an rtf, for example if you wrote an improved
document() with some decent error handling you're screwed cause your xml
is gonna be text with a lot of &lt;&gt;.

So basically one can do the following <xsl:value-of
select="myfunc:func('http://www.example.com/example.xml')"
disable-output-escaping="yes"/> to get the xml out of the extension
function. Can one then do the following:
<xsl:variable name="nodeset"><result><xsl:value-of
select="myfunc:func('http://www.example.com/example.xml')"
disable-output-escaping="yes"/> </result></xsl:variable>

<xsl:apply-templates select="msxsl:node-set($nodeset)/result"/>?

nope. 

If I want the xml processed, or you want the xml processed as far as I
have found, I suppose one will have to do the processing inside the
extension function, by perhaps loading in myfunc_func.xsl and processing
that xml inside the extension function, returning an rtf to the function
which then converts the whole thing to text and then going ahead and
converting it back to xml via <xsl:value-of
select="myfunc:func('http://www.example.com/example.xml')"
disable-output-escaping="yes"/>.

Anyway this is what I was thinking about doing to solve my particular
problem, if I still feel like solving it, not sure if it's worth it.

By the way, If anyone else has a better solution for getting an rtf out
of an msxml extension function please tell me.


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread