Adrien de Sentenac wrote:
Hello,
I want to transform a Xerces DOM tree using Xalan.
It generally works fine, except when i have nodes with empty strings in the tree. These nodes are created with createTextNode(0), and i need that for my application. When my tree has such 'empty' node, it fails in XSLTEngineImpl::cloneToResultTree on the assert that 0 != length(data)


That's because the XPath data model does not allow for empty text nodes.

That looks like this bug : https://issues.apache.org/jira/browse/XALANJ-1888 <https://issues.apache.org/jira/browse/XALANJ-1888> for XalanJ but i found nothing for this problem on XalanC.

That's a completely different bug, because that one is related to building the source tree, not transforming it.

Is it a wanted behaviour ? Is there a workaround ? and if not should i fill a bug report for XalanC ?

As I noted previously, this is not really a bug. Since the data model does not allow for empty text nodes, the code is asserting that what it gets complies with the data model.

If you really need to transform something that doesn't comply with the data model, then you might consider just removing the assert from the source code and rebuilding. I'm not sure if there are any other places where you'll have problems, but you can certainly give it a try.

Dave

Reply via email to