Anas EL HAJJAJI wrote:
Hi,

My problem is :

In a XSL file I make a call to an external function :

*<xsl:value-of select="external:ListToXML()"/>*

The function ListToXML() is like thatt :

*XObjectPtr NGATranslatorXSLFunctionListToXML::execute(
        XPathExecutionContext&       io__executionContext,
        XalanNode*                   io__context,
        const XObjectArgVectorType&  i__args,
        const LocatorType*           i__locator) const
{
    string l__xml;
l__xml = "<exemple>exemple1</exemple><exemple>exemple2</exemple>"; return io__executionContext.getXObjectFactory().createString(
                                                    XalanDOMString(
                                                            l__xml.c_str())
                                                            );
}
*

What I get in output (after transformation) is a XML part like that :

*& l t ; exemple & g t ;exemple1** **& l t ; **/exemple**& g t ; **& l t ;**exemple**& g t ;**exemple2**& l t ;**/exemple**& g t ;*

It's encode the < to *& l t ;*
and *> *to* **& g t ;*
Yes, because you're returning a string.


How can I get a correct XML part ?
Take a look at the document() function and how it works. The implementation is in src/xalanc/XSLT/FunctionDocument.hpp. You essentially want to parse the markup into a document, and return the node in a node-set.

Dave

Reply via email to