Warnings from SAXON are not displayed
Posted: Sat Apr 26, 2014 8:12 am
Hi,
lets say i have an xsd-Schema which defines Element e with one child element a of type xs:string. I have an xslt script which imports this schema. In this script there is a template which matches schema-element(e). The value of the child element is assigned to a variable v. I will validate this script with the schema-aware SAXON-EE 9.5.1.3 Engine in Oxygen 15.2.
Question is: what happens when i accidently refer to a non-existing child of e, maybe because of a typo?
If the variable v is defined as mandatory, i will get both an error and a warning.
Im am using the german language, Fehlerlevel is error-level. So this works as expected.
However, if variable v is optional, validation thells me that my script is valid.
It is ok that the fatal error disappered because an empty sequence is now allowed as a value of $v, but i would expect the warning which tells me that the complex type of element e does not allow a child element named c. But this is not displayed. Everything seems to be ok, since the warning is supressed.
Is this a bug, or did i miss something in the configuration of oxygen or saxon?
Sincerely,
Frank
lets say i have an xsd-Schema which defines Element e with one child element a of type xs:string. I have an xslt script which imports this schema. In this script there is a template which matches schema-element(e). The value of the child element is assigned to a variable v. I will validate this script with the schema-aware SAXON-EE 9.5.1.3 Engine in Oxygen 15.2.
Question is: what happens when i accidently refer to a non-existing child of e, maybe because of a typo?
If the variable v is defined as mandatory, i will get both an error and a warning.
Code: Select all
<xsl:variable name="v" as="xs:string" select="c"/>
Failed to compile stylesheet. 1 error detected.
Fehlerlevel: warning
The complex type of element e does not allow a child element named c
Fehlerlevel: fatal
XTTE0570: An empty sequence is not allowed as the value of variable $v
However, if variable v is optional, validation thells me that my script is valid.
Code: Select all
<xsl:variable name="v" as="xs:string?" select="c"/>
Is this a bug, or did i miss something in the configuration of oxygen or saxon?
Sincerely,
Frank