An element that has an attribute will never be valid against a simple type such as xs:hexBinary, because simple types do not allow attributes (it needs a complex type with simple content). The xsi:type attribute defines the type of the element, not the type of its content. If MySQL is generating this XML file, then I think it has a bug (or has been incorrectly configured).

Michael Kay

On 12/03/2012 06:40, Todd Gochenour wrote:
I'm learning how to use the XSL 2.1 streaming functions this weekend, working with really big data. 
I have this line:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.1"

<xsl:template match="/">




where the input XML document possesses a child element of <table_data/> with the line:

<field name="cmp_blob" xsi:type="xs:hexBinary">57656C636F6D6521</field>

and the Saxon-EE transformation as implemented in oXygen throws the error:

System ID: C:\Users\servicelogix\slx\test6ba.xml
Severity: fatal
Description: Attribute @name is not allowed on element <field>
Start location: 20:50

and the spec for XTTE1515 reads:

[ERR XTTE1515] If the validation attribute of an xsl:element, xsl:attribute, xsl:copy, xsl:copy-of, or xsl:result-document instruction, or the xsl:validation attribute of a literal result element, has the effective value lax, and schema validity assessment concludes that the element or attribute is invalid, a type error occurs. As with other type errors, the error may be signaled statically if it can be detected statically.

The source of the input XML document is an MySQL export XML file.  Can this error be corrected?

Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!

saxon-help mailing list archived at