@xsl:validation with cta

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

@xsl:validation with cta

Patrik.Stellmann
Hi,

when using the xsl:validation="strict" on an element with a conditional type alternative I get an error (XTTE1510). When using it on the parent element it works fine.

Example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
   
   
<xsl:import-schema>
       
<xs:schema>
           
<xs:element name="list">
               
<xs:complexType>
                   
<xs:sequence>
                       
<xs:element ref="element" minOccurs="0" maxOccurs="unbounded"/>
                   
</xs:sequence>
               
</xs:complexType>
           
</xs:element>
           
           
<xs:element name="element" type="type1">
               
<xs:alternative test="@type = 'type2'" type="type2"/>
           
</xs:element>
           
           
<xs:complexType name="type1">
               
<xs:sequence>
                   
<xs:element name="child1"/>
               
</xs:sequence>
               
<xs:attribute name="type" type="xs:string"/>
           
</xs:complexType>
           
           
<xs:complexType name="type2">
               
<xs:complexContent>
                   
<xs:extension base="type1">
                       
<xs:sequence>
                           
<xs:element name="child2"/>
                       
</xs:sequence>
                   
</xs:extension>
               
</xs:complexContent>
           
</xs:complexType>
       
</xs:schema>
   
</xsl:import-schema>
   
   
<xsl:template match="/">
       
<list xsl:validation="strict"> <!-- strict validation here works -->
           
<element xsl:validation="strict"> <!-- strict validation here causes error -->
               
<xsl:attribute name="type" select="'type2'"/>
               
<child1/>
               
<child2/>
           
</element>
       
</list>
   
</xsl:template>
   
</xsl:transform>


Running this with Saxon-EE 9.5.1.5 (out of Oxygen) I get the folloing errors:
    XTTE1510: In content of element <element>: The content model does not allow element <child2> to appear immediately after element <child1>. No further elements are allowed at this point.
    XTTE1510: One or more validation errors were reported
When removing the @xsl:validation on "element" it works.

Is this a known or even wanted limitation or a bug?

Thanks ans regards


Patrik

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
Volker Sonnenburg
Heiko Beermann

------------------------------------------------------------------
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: @xsl:validation with cta

Michael Kay
Yes, I can confirm there's a bug here: Saxon is allocating a validator against type1 at stylesheet compile time without considering that the governing type can't be determined until run-time. Thanks for reporting it; we'll look into it.

Michael Kay
Saxonica
+44 (0) 118 946 5893




On 18 Feb 2015, at 07:09, [hidden email] wrote:

Hi,

when using the xsl:validation="strict" on an element with a conditional type alternative I get an error (XTTE1510). When using it on the parent element it works fine.

Example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
   
   
<xsl:import-schema>
       
<xs:schema>
           
<xs:element name="list">
               
<xs:complexType>
                   
<xs:sequence>
                       
<xs:element ref="element" minOccurs="0" maxOccurs="unbounded"/>
                   
</xs:sequence>
               
</xs:complexType>
           
</xs:element>
           
           
<xs:element name="element" type="type1">
               
<xs:alternative test="@type = 'type2'" type="type2"/>
           
</xs:element>
           
           
<xs:complexType name="type1">
               
<xs:sequence>
                   
<xs:element name="child1"/>
               
</xs:sequence>
               
<xs:attribute name="type" type="xs:string"/>
           
</xs:complexType>
           
           
<xs:complexType name="type2">
               
<xs:complexContent>
                   
<xs:extension base="type1">
                       
<xs:sequence>
                           
<xs:element name="child2"/>
                       
</xs:sequence>
                   
</xs:extension>
               
</xs:complexContent>
           
</xs:complexType>
       
</xs:schema>
   
</xsl:import-schema>
   
   
<xsl:template match="/">
       
<list xsl:validation="strict"> <!-- strict validation here works -->
           
<element xsl:validation="strict"> <!-- strict validation here causes error -->
               
<xsl:attribute name="type" select="'type2'"/>
               
<child1/>
               
<child2/>
           
</element>
       
</list>
   
</xsl:template>
   
</xsl:transform>


Running this with Saxon-EE 9.5.1.5 (out of Oxygen) I get the folloing errors:
    XTTE1510: In content of element <element>: The content model does not allow element <child2> to appear immediately after element <child1>. No further elements are allowed at this point.
    XTTE1510: One or more validation errors were reported
When removing the @xsl:validation on "element" it works.

Is this a known or even wanted limitation or a bug?

Thanks ans regards


Patrik

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
Volker Sonnenburg
Heiko Beermann

------------------------------------------------------------------
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|

Re: @xsl:validation with cta

Michael Kay
In reply to this post by Patrik.Stellmann
The problem can be tracked here:


Michael Kay
Saxonica
+44 (0) 118 946 5893




On 18 Feb 2015, at 07:09, [hidden email] wrote:

Hi,

when using the xsl:validation="strict" on an element with a conditional type alternative I get an error (XTTE1510). When using it on the parent element it works fine.

Example:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs" version="2.0">
   
   
<xsl:import-schema>
       
<xs:schema>
           
<xs:element name="list">
               
<xs:complexType>
                   
<xs:sequence>
                       
<xs:element ref="element" minOccurs="0" maxOccurs="unbounded"/>
                   
</xs:sequence>
               
</xs:complexType>
           
</xs:element>
           
           
<xs:element name="element" type="type1">
               
<xs:alternative test="@type = 'type2'" type="type2"/>
           
</xs:element>
           
           
<xs:complexType name="type1">
               
<xs:sequence>
                   
<xs:element name="child1"/>
               
</xs:sequence>
               
<xs:attribute name="type" type="xs:string"/>
           
</xs:complexType>
           
           
<xs:complexType name="type2">
               
<xs:complexContent>
                   
<xs:extension base="type1">
                       
<xs:sequence>
                           
<xs:element name="child2"/>
                       
</xs:sequence>
                   
</xs:extension>
               
</xs:complexContent>
           
</xs:complexType>
       
</xs:schema>
   
</xsl:import-schema>
   
   
<xsl:template match="/">
       
<list xsl:validation="strict"> <!-- strict validation here works -->
           
<element xsl:validation="strict"> <!-- strict validation here causes error -->
               
<xsl:attribute name="type" select="'type2'"/>
               
<child1/>
               
<child2/>
           
</element>
       
</list>
   
</xsl:template>
   
</xsl:transform>


Running this with Saxon-EE 9.5.1.5 (out of Oxygen) I get the folloing errors:
    XTTE1510: In content of element <element>: The content model does not allow element <child2> to appear immediately after element <child1>. No further elements are allowed at this point.
    XTTE1510: One or more validation errors were reported
When removing the @xsl:validation on "element" it works.

Is this a known or even wanted limitation or a bug?

Thanks ans regards


Patrik

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
www.gdv-dl.de

Sitz und Registergericht: Hamburg
HRA 93 894
USt.-IdNr : DE 205183123

Komplementärin:
GDV Beteiligungsgesellschaft mbH
Sitz und Registergericht: Hamburg
HRB 71 153

Geschäftsführer:
Volker Sonnenburg
Heiko Beermann

------------------------------------------------------------------
Diese E-Mail und alle Anhänge enthalten vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese E-Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe der E-Mail ist nicht gestattet.

This e-mail and any attached files may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distributionof the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help