[xslt] Parsing an incorrect xml string doesn't lead to an error



Hello,
        

I've got a problem with the processing of an xml string.

I am using libxslt to transform some xsl/xml files.

But I encounter a crash in my code when I pass an incorrect value in my xml string because 
xsltapplystylesheet returns ok and the result is not the correct result (because of the incorrect xml string).

In my xsl string I've used these tags

<xsl:when test="@type='toto'">
    <xsl:call-template name="mpeg2tsCapture"/>
</xsl:when>
<xsl:otherwise>
    <xsl:message terminate="yes">
    </xsl:message>
</xsl:otherwise>

I thought that if the type were different from toto in the xml, xsltapplystylesheet would exit with an error, 
but it doesn't.

I checked the source (transform.c) and it seems that if xslt encounter a terminate=yes, it just skip the 
element.

That's not good for me. Is there a way to stop the processing and exit with an error ?

Thanks for your help.

Charles.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]