Hi again,

I still don't have it:

How can I in Xalan 1.8.0 pass an xml node to an external C++ function and
get the whole node xml-chars in that function?

xmlInput:
---------
<?xml...>
<Main>
...
 <Foo>
  <SubFoo>
   <Value>
    blah
   </Value>
  </SubFoo>
 </Foo>
...
</Main>

xslt:
---------
...
 <xsl:template match="/">
 ...
  <xsl:variable name="foo" select="//Foo[1]"/>
  <xsl:variable name="result" select="ext:doIt($foo/SubFoo)"/>
 ...

C++:
---------
XObjectPtr FunctionDoIt::execute(XPathExecutionContext& executionContext,
XalanNode* context,
            const XObjectPtr arg1, const LocatorType* locator) const
{
...
 std::vector<char> charVek = arg1->str().transcode();
 char* chars = &charVek[0];

 doSthWith(chars);
...
 return executionContext.getXObjectFactory().createBoolean(result);
}

When I use this code the "chars" only contains all the element values but
not the tags themselves:
chars =>"


    blah


         "

instead of

chars =>
 "<Foo>
  <SubFoo>
   <Value>
    blah
   </Value>
  </SubFoo>
 <Foo>"


Thanks, Ulf

Reply via email to