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
Saxonica

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"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>

<xsl:template match="/">

<xsl:for-each

select="saxon:stream(doc('test6ba.xml')/*/*/table_data)">

...

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 9.2.0.5 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
URL: http://www.w3.org/TR/xslt20/#err-XTTE1515

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!
http://p.sf.net/sfu/learndevnow-dev2


_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help