XPathCompiler not schema-aware by configuration

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

XPathCompiler not schema-aware by configuration

Patrik.Stellmann

Hi,

 

I have some java code like this:

 

      final Processor         processor   = new Processor(configuration);

      final DocumentBuilder   builder     = processor.newDocumentBuilder();

      final XdmNode           context     = builder.build(xmlSource);

      final XPathCompiler     compiler    = processor.newXPathCompiler();

 

The configuration is loaded from file:

<configuration edition="EE" xmlns="http://saxon.sf.net/ns/configuration">
     
<global
            expandAttributeDefaults = "true"
            schemaValidation        = "lax"
            xInclude                = "false"
            dtdValidation           = "true"
            allowExternalFunctions  = "true"
            stripSpace              = "none"/>
     
<xslt
            schemaAware             = "true">
           
<extensionElement/>
     
</xslt>
</configuration>

 

When executing an xpath expression with the context I get an error message complaining that the xpath was compiled without schema-awareness.

 

I could fix this by adding this code:

 

      compiler.setSchemaAware(configuration.getDefaultXsltCompilerInfo().isSchemaAware());

 

But I’m still surprised that the schema-awareness was not set by the configuration!?

Is this intended behavior or should I have done something different?

 

Thanks and regards,

Patrik


------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: [hidden email]


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:
Dr. Jens Bartenwerfer
Michael Bathke
Volker Sonnenburg

------------------------------------------------------------------
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 distribution of the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
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
|  
Report Content as Inappropriate

Re: XPathCompiler not schema-aware by configuration

Emanuel Wlaschitz
Have you tried <xquery schemaAware="true"/> yet? I'm assuming the XSLT Configuration applies to the XsltCompiler, not the XPathCompiler.
If not, I expect Mike to chime in anyways should this be a bug or something ☺

- Emanuel

From: Dr. Patrik Stellmann [mailto:[hidden email]]
Sent: Friday, April 15, 2016 06:30
To: Mailing list for the SAXON XSLT and XQuery processor <[hidden email]>
Subject: [saxon] XPathCompiler not schema-aware by configuration

Hi,

I have some java code like this:

      final Processor         processor   = new Processor(configuration);
      final DocumentBuilder   builder     = processor.newDocumentBuilder();
      final XdmNode           context     = builder.build(xmlSource);
      final XPathCompiler     compiler    = processor.newXPathCompiler();

The configuration is loaded from file:
<configuration edition="EE" xmlns="http://saxon.sf.net/ns/configuration">
      <global
            expandAttributeDefaults = "true"
            schemaValidation        = "lax"
            xInclude                = "false"
            dtdValidation           = "true"
            allowExternalFunctions  = "true"
            stripSpace              = "none"/>
      <xslt
            schemaAware             = "true">
            <extensionElement/>
      </xslt>
</configuration>

When executing an xpath expression with the context I get an error message complaining that the xpath was compiled without schema-awareness.

I could fix this by adding this code:

      compiler.setSchemaAware(configuration.getDefaultXsltCompilerInfo().isSchemaAware());

But I’m still surprised that the schema-awareness was not set by the configuration!?
Is this intended behavior or should I have done something different?

Thanks and regards,
Patrik

------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: mailto:[hidden email]

GDV Dienstleistungs-GmbH & Co. KG
Glockengießerwall 1
D-20095 Hamburg
http://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:
Dr. Jens Bartenwerfer
Michael Bathke
Volker Sonnenburg
------------------------------------------------------------------
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 distribution of the material in this e-mail is strictly forbidden.
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
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
|  
Report Content as Inappropriate

Re: XPathCompiler not schema-aware by configuration

Michael Kay
In reply to this post by Patrik.Stellmann
The <xslt> part of the configuration isn't going to affect free-standing XPath expressions, and neither is the <xquery> part. And there isn't a section in the configuration file for free-standing XPath expressions, which means the only way to set properties like this is via the API. Sorry!

Michael Kay
Saxonica


On 15 Apr 2016, at 05:30, Dr. Patrik Stellmann <[hidden email]> wrote:

Hi,

 

I have some java code like this:

 

      final Processor         processor   = new Processor(configuration);

      final DocumentBuilder   builder     = processor.newDocumentBuilder();

      final XdmNode           context     = builder.build(xmlSource);

      final XPathCompiler     compiler    = processor.newXPathCompiler();

 

The configuration is loaded from file:

<configuration edition="EE" xmlns="http://saxon.sf.net/ns/configuration">
     
<global
            expandAttributeDefaults = "true"
            schemaValidation        = "lax"
            xInclude                = "false"
            dtdValidation           = "true"
            allowExternalFunctions  = "true"
            stripSpace              = "none"/>
     
<xslt
            schemaAware             = "true">
           
<extensionElement/>
     
</xslt>
</configuration>

 

When executing an xpath expression with the context I get an error message complaining that the xpath was compiled without schema-awareness.

 

I could fix this by adding this code:

 

      compiler.setSchemaAware(configuration.getDefaultXsltCompilerInfo().isSchemaAware());

 

But I’m still surprised that the schema-awareness was not set by the configuration!?

Is this intended behavior or should I have done something different?

 

Thanks and regards,

Patrik


------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: [hidden email]



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:
Dr. Jens Bartenwerfer
Michael Bathke
Volker Sonnenburg

------------------------------------------------------------------
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 distribution of the material in this e-mail is strictly forbidden.

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
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
|  
Report Content as Inappropriate

Re: XPathCompiler not schema-aware by configuration

Patrik.Stellmann

Ok, Thanks for the approval.

 

Patrik

 


------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: [hidden email]


Von: Michael Kay [mailto:[hidden email]]
Gesendet: Freitag, 15. April 2016 09:58
An: Mailing list for the SAXON XSLT and XQuery processor
Betreff: Re: [saxon] XPathCompiler not schema-aware by configuration

 

The <xslt> part of the configuration isn't going to affect free-standing XPath expressions, and neither is the <xquery> part. And there isn't a section in the configuration file for free-standing XPath expressions, which means the only way to set properties like this is via the API. Sorry!

 

Michael Kay

Saxonica

 

 

On 15 Apr 2016, at 05:30, Dr. Patrik Stellmann <[hidden email]> wrote:

 

Hi,

 

I have some java code like this:

 

      final Processor         processor   = new Processor(configuration);

      final DocumentBuilder   builder     = processor.newDocumentBuilder();

      final XdmNode           context     = builder.build(xmlSource);

      final XPathCompiler     compiler    = processor.newXPathCompiler();

 

The configuration is loaded from file:

<configuration edition="EE" xmlns="http://saxon.sf.net/ns/configuration">
      <global
            expandAttributeDefaults = "true"
            schemaValidation        = "lax"
            xInclude                = "false"
            dtdValidation           = "true"
            allowExternalFunctions  = "true"
            stripSpace              = "none"/>
      <xslt
            schemaAware             = "true">
            <extensionElement/>
      </xslt>
</configuration>

 

When executing an xpath expression with the context I get an error message complaining that the xpath was compiled without schema-awareness.

 

I could fix this by adding this code:

 

      compiler.setSchemaAware(configuration.getDefaultXsltCompilerInfo().isSchemaAware());

 

But I’m still surprised that the schema-awareness was not set by the configuration!?

Is this intended behavior or should I have done something different?

 

Thanks and regards,

Patrik


------------------------------------------------------------------
Systemarchitektur & IT-Projekte
Tel: +49 40 33449-1142
Fax: +49 40 33449-1400
E-Mail: [hidden email]

 

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:
Dr. Jens Bartenwerfer
Michael Bathke
Volker Sonnenburg

------------------------------------------------------------------
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 distribution of the material in this e-mail is strictly forbidden.


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...