Quantcast

A less-than-helpful error message

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

A less-than-helpful error message

Costello, Roger L.
Hi Michael,

I am validating an XML Schema document using Oxygen.

Upon validation, I got this error message:

        [SAXON] Failed to parse schema document

There was no indication of what the problem might be or where the problem might be located.

It's not a very helpful error message.

In a large XML Schema document, it can take a considerable effort to find the problem.

Is there any way to replace this error message with something more helpful?

By the way, after much effort I was able to find the problem:

  <xs:element name="Palette_Entries"">

See the problem? I accidentally added a second quote after the element name.

/Roger

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Michael Kay
If we run this from the com.saxonica.Validate command line with -t, we get

Saxon-EE 9.7.0.5J from Saxonica
Java version 1.8.0_76-ea
Using license serial number V000006
Loading schema document file:/Users/mike/Desktop/temp/test.xsd
Error on line 18 column 48 of test.xsd:
  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
  either attribute specifications, ">" or "/>".
Schema processing failed: Failed to parse schema document

Without -t, we get

Error on line 18 column 48 of test.xsd:
  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
  either attribute specifications, ">" or "/>".
Schema processing failed: Failed to parse schema document

So Saxon is providing the error information, but someone is dropping it before you get to see it.

I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.

Michael Kay


> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>
> Hi Michael,
>
> I am validating an XML Schema document using Oxygen.
>
> Upon validation, I got this error message:
>
> [SAXON] Failed to parse schema document
>
> There was no indication of what the problem might be or where the problem might be located.
>
> It's not a very helpful error message.
>
> In a large XML Schema document, it can take a considerable effort to find the problem.
>
> Is there any way to replace this error message with something more helpful?
>
> By the way, after much effort I was able to find the problem:
>
> <xs:element name="Palette_Entries"">
>
> See the problem? I accidentally added a second quote after the element name.
>
> /Roger
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Radu Coravu
Hi Michael,

So Oxygen receives this exception from Saxon when it attempts to create
the schema:

> org.xml.sax.SAXParseException; Failed to parse schema document
> at com.saxonica.ee.jaxp.SchemaFactoryImpl.toSAXException(SchemaFactoryImpl.java:407)
> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:292)
> at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)
> at ro.sync.customscanners.SaxonSAErrorScanner.getSchemaValidator(SaxonSAErrorScanner.java:509)
> at ro.sync.customscanners.SaxonSAErrorScanner.pluggableValidateScanInternal(SaxonSAErrorScanner.java:340)
> at ro.sync.customscanners.PluggableErrorScanner.scanInternal(PluggableErrorScanner.java:259)
> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:181)
> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:1)
> at ro.sync.exml.validate.AbstractErrorScanner.scan(AbstractErrorScanner.java:193)
> at ro.sync.exml.editor.validate.ValidationAssistant.applyErrorScanner(ValidationAssistant.java:382)
> at ro.sync.exml.editor.validate.ValidationAssistant$1.appRun(ValidationAssistant.java:313)
> at ro.sync.ui.application.ApplicationThread.run(ApplicationThread.java:135)
> Caused by: net.sf.saxon.type.SchemaException: Failed to parse schema document
> at com.saxonica.ee.schema.sdoc.SchemaReader.buildSchemaDocument(SchemaReader.java:289)
> at com.saxonica.ee.schema.sdoc.SchemaReader.read(SchemaReader.java:141)
> at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:500)
> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:289)
> ... 10 more

The received SAXParseException has the line and column numbers set to
"-1". Indeed the console output contains the information (probably Saxon
uses System.err to output them) but using Java API we cannot access the
line and column information.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/15/2016 7:18 PM, Michael Kay wrote:

> If we run this from the com.saxonica.Validate command line with -t, we get
>
> Saxon-EE 9.7.0.5J from Saxonica
> Java version 1.8.0_76-ea
> Using license serial number V000006
> Loading schema document file:/Users/mike/Desktop/temp/test.xsd
> Error on line 18 column 48 of test.xsd:
>   SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>   either attribute specifications, ">" or "/>".
> Schema processing failed: Failed to parse schema document
>
> Without -t, we get
>
> Error on line 18 column 48 of test.xsd:
>   SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>   either attribute specifications, ">" or "/>".
> Schema processing failed: Failed to parse schema document
>
> So Saxon is providing the error information, but someone is dropping it before you get to see it.
>
> I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.
>
> Michael Kay
>
>
>> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>>
>> Hi Michael,
>>
>> I am validating an XML Schema document using Oxygen.
>>
>> Upon validation, I got this error message:
>>
>> [SAXON] Failed to parse schema document
>>
>> There was no indication of what the problem might be or where the problem might be located.
>>
>> It's not a very helpful error message.
>>
>> In a large XML Schema document, it can take a considerable effort to find the problem.
>>
>> Is there any way to replace this error message with something more helpful?
>>
>> By the way, after much effort I was able to find the problem:
>>
>> <xs:element name="Palette_Entries"">
>>
>> See the problem? I accidentally added a second quote after the element name.
>>
>> /Roger
>>
>> ------------------------------------------------------------------------------
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Michael Kay
Saxon will have notified all the parse errors to the registered ErrorHandler / ErrorListener. It's up to the ErrorListener to decide what to do with them.

Michael Kay
Saxonica


> On 16 Jun 2016, at 06:14, Radu Coravu <[hidden email]> wrote:
>
> Hi Michael,
>
> So Oxygen receives this exception from Saxon when it attempts to create
> the schema:
>
>> org.xml.sax.SAXParseException; Failed to parse schema document
>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.toSAXException(SchemaFactoryImpl.java:407)
>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:292)
>> at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)
>> at ro.sync.customscanners.SaxonSAErrorScanner.getSchemaValidator(SaxonSAErrorScanner.java:509)
>> at ro.sync.customscanners.SaxonSAErrorScanner.pluggableValidateScanInternal(SaxonSAErrorScanner.java:340)
>> at ro.sync.customscanners.PluggableErrorScanner.scanInternal(PluggableErrorScanner.java:259)
>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:181)
>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:1)
>> at ro.sync.exml.validate.AbstractErrorScanner.scan(AbstractErrorScanner.java:193)
>> at ro.sync.exml.editor.validate.ValidationAssistant.applyErrorScanner(ValidationAssistant.java:382)
>> at ro.sync.exml.editor.validate.ValidationAssistant$1.appRun(ValidationAssistant.java:313)
>> at ro.sync.ui.application.ApplicationThread.run(ApplicationThread.java:135)
>> Caused by: net.sf.saxon.type.SchemaException: Failed to parse schema document
>> at com.saxonica.ee.schema.sdoc.SchemaReader.buildSchemaDocument(SchemaReader.java:289)
>> at com.saxonica.ee.schema.sdoc.SchemaReader.read(SchemaReader.java:141)
>> at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:500)
>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:289)
>> ... 10 more
>
> The received SAXParseException has the line and column numbers set to
> "-1". Indeed the console output contains the information (probably Saxon
> uses System.err to output them) but using Java API we cannot access the
> line and column information.
>
> Regards,
> Radu
>
> Radu Coravu
> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
> On 6/15/2016 7:18 PM, Michael Kay wrote:
>> If we run this from the com.saxonica.Validate command line with -t, we get
>>
>> Saxon-EE 9.7.0.5J from Saxonica
>> Java version 1.8.0_76-ea
>> Using license serial number V000006
>> Loading schema document file:/Users/mike/Desktop/temp/test.xsd
>> Error on line 18 column 48 of test.xsd:
>>  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>  either attribute specifications, ">" or "/>".
>> Schema processing failed: Failed to parse schema document
>>
>> Without -t, we get
>>
>> Error on line 18 column 48 of test.xsd:
>>  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>  either attribute specifications, ">" or "/>".
>> Schema processing failed: Failed to parse schema document
>>
>> So Saxon is providing the error information, but someone is dropping it before you get to see it.
>>
>> I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.
>>
>> Michael Kay
>>
>>
>>> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>>>
>>> Hi Michael,
>>>
>>> I am validating an XML Schema document using Oxygen.
>>>
>>> Upon validation, I got this error message:
>>>
>>> [SAXON] Failed to parse schema document
>>>
>>> There was no indication of what the problem might be or where the problem might be located.
>>>
>>> It's not a very helpful error message.
>>>
>>> In a large XML Schema document, it can take a considerable effort to find the problem.
>>>
>>> Is there any way to replace this error message with something more helpful?
>>>
>>> By the way, after much effort I was able to find the problem:
>>>
>>> <xs:element name="Palette_Entries"">
>>>
>>> See the problem? I accidentally added a second quote after the element name.
>>>
>>> /Roger
>>>
>>> ------------------------------------------------------------------------------
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>>
>> ------------------------------------------------------------------------------
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Radu Coravu
Hi Michael,

Actually we set the error handler
"javax.xml.validation.SchemaFactory.setErrorHandler(ErrorHandler)"
before calling "SchemaFactory.newSchema" but nothing is reported on the
error handler.
This using Saxon 9.6.0.7.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/16/2016 10:36 AM, Michael Kay wrote:

> Saxon will have notified all the parse errors to the registered ErrorHandler / ErrorListener. It's up to the ErrorListener to decide what to do with them.
>
> Michael Kay
> Saxonica
>
>
>> On 16 Jun 2016, at 06:14, Radu Coravu <[hidden email]> wrote:
>>
>> Hi Michael,
>>
>> So Oxygen receives this exception from Saxon when it attempts to create
>> the schema:
>>
>>> org.xml.sax.SAXParseException; Failed to parse schema document
>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.toSAXException(SchemaFactoryImpl.java:407)
>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:292)
>>> at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)
>>> at ro.sync.customscanners.SaxonSAErrorScanner.getSchemaValidator(SaxonSAErrorScanner.java:509)
>>> at ro.sync.customscanners.SaxonSAErrorScanner.pluggableValidateScanInternal(SaxonSAErrorScanner.java:340)
>>> at ro.sync.customscanners.PluggableErrorScanner.scanInternal(PluggableErrorScanner.java:259)
>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:181)
>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:1)
>>> at ro.sync.exml.validate.AbstractErrorScanner.scan(AbstractErrorScanner.java:193)
>>> at ro.sync.exml.editor.validate.ValidationAssistant.applyErrorScanner(ValidationAssistant.java:382)
>>> at ro.sync.exml.editor.validate.ValidationAssistant$1.appRun(ValidationAssistant.java:313)
>>> at ro.sync.ui.application.ApplicationThread.run(ApplicationThread.java:135)
>>> Caused by: net.sf.saxon.type.SchemaException: Failed to parse schema document
>>> at com.saxonica.ee.schema.sdoc.SchemaReader.buildSchemaDocument(SchemaReader.java:289)
>>> at com.saxonica.ee.schema.sdoc.SchemaReader.read(SchemaReader.java:141)
>>> at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:500)
>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:289)
>>> ... 10 more
>>
>> The received SAXParseException has the line and column numbers set to
>> "-1". Indeed the console output contains the information (probably Saxon
>> uses System.err to output them) but using Java API we cannot access the
>> line and column information.
>>
>> Regards,
>> Radu
>>
>> Radu Coravu
>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>> On 6/15/2016 7:18 PM, Michael Kay wrote:
>>> If we run this from the com.saxonica.Validate command line with -t, we get
>>>
>>> Saxon-EE 9.7.0.5J from Saxonica
>>> Java version 1.8.0_76-ea
>>> Using license serial number V000006
>>> Loading schema document file:/Users/mike/Desktop/temp/test.xsd
>>> Error on line 18 column 48 of test.xsd:
>>>  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>  either attribute specifications, ">" or "/>".
>>> Schema processing failed: Failed to parse schema document
>>>
>>> Without -t, we get
>>>
>>> Error on line 18 column 48 of test.xsd:
>>>  SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>  either attribute specifications, ">" or "/>".
>>> Schema processing failed: Failed to parse schema document
>>>
>>> So Saxon is providing the error information, but someone is dropping it before you get to see it.
>>>
>>> I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.
>>>
>>> Michael Kay
>>>
>>>
>>>> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>>>>
>>>> Hi Michael,
>>>>
>>>> I am validating an XML Schema document using Oxygen.
>>>>
>>>> Upon validation, I got this error message:
>>>>
>>>> [SAXON] Failed to parse schema document
>>>>
>>>> There was no indication of what the problem might be or where the problem might be located.
>>>>
>>>> It's not a very helpful error message.
>>>>
>>>> In a large XML Schema document, it can take a considerable effort to find the problem.
>>>>
>>>> Is there any way to replace this error message with something more helpful?
>>>>
>>>> By the way, after much effort I was able to find the problem:
>>>>
>>>> <xs:element name="Palette_Entries"">
>>>>
>>>> See the problem? I accidentally added a second quote after the element name.
>>>>
>>>> /Roger
>>>>
>>>> ------------------------------------------------------------------------------
>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Michael Kay
What kind of Source object do you supply?

For well-formedness errors, I'm not sure how the ErrorHandler on the SchemaFactory relates to any SAXSource.XMLReader.ErrorHandler. As usual, JAXP doesn't have much to say on this.

But it looks as if we're using the ErrorHandler on SchemaFactory only to report errors detected by the schema processor, not to report errors detected by the XML parser. The latter are going to the ErrorHandler on the XMLReader object when a SAXSource is supplied, or to the default system error handler otherwise - which by default  will list them to System.err.

Michael Kay
Saxonica

> On 16 Jun 2016, at 08:50, Radu Coravu <[hidden email]> wrote:
>
> Hi Michael,
>
> Actually we set the error handler
> "javax.xml.validation.SchemaFactory.setErrorHandler(ErrorHandler)"
> before calling "SchemaFactory.newSchema" but nothing is reported on the
> error handler.
> This using Saxon 9.6.0.7.
>
> Regards,
> Radu
>
> Radu Coravu
> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
> http://www.oxygenxml.com
>
> On 6/16/2016 10:36 AM, Michael Kay wrote:
>> Saxon will have notified all the parse errors to the registered ErrorHandler / ErrorListener. It's up to the ErrorListener to decide what to do with them.
>>
>> Michael Kay
>> Saxonica
>>
>>
>>> On 16 Jun 2016, at 06:14, Radu Coravu <[hidden email]> wrote:
>>>
>>> Hi Michael,
>>>
>>> So Oxygen receives this exception from Saxon when it attempts to create
>>> the schema:
>>>
>>>> org.xml.sax.SAXParseException; Failed to parse schema document
>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.toSAXException(SchemaFactoryImpl.java:407)
>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:292)
>>>> at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)
>>>> at ro.sync.customscanners.SaxonSAErrorScanner.getSchemaValidator(SaxonSAErrorScanner.java:509)
>>>> at ro.sync.customscanners.SaxonSAErrorScanner.pluggableValidateScanInternal(SaxonSAErrorScanner.java:340)
>>>> at ro.sync.customscanners.PluggableErrorScanner.scanInternal(PluggableErrorScanner.java:259)
>>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:181)
>>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:1)
>>>> at ro.sync.exml.validate.AbstractErrorScanner.scan(AbstractErrorScanner.java:193)
>>>> at ro.sync.exml.editor.validate.ValidationAssistant.applyErrorScanner(ValidationAssistant.java:382)
>>>> at ro.sync.exml.editor.validate.ValidationAssistant$1.appRun(ValidationAssistant.java:313)
>>>> at ro.sync.ui.application.ApplicationThread.run(ApplicationThread.java:135)
>>>> Caused by: net.sf.saxon.type.SchemaException: Failed to parse schema document
>>>> at com.saxonica.ee.schema.sdoc.SchemaReader.buildSchemaDocument(SchemaReader.java:289)
>>>> at com.saxonica.ee.schema.sdoc.SchemaReader.read(SchemaReader.java:141)
>>>> at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:500)
>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:289)
>>>> ... 10 more
>>>
>>> The received SAXParseException has the line and column numbers set to
>>> "-1". Indeed the console output contains the information (probably Saxon
>>> uses System.err to output them) but using Java API we cannot access the
>>> line and column information.
>>>
>>> Regards,
>>> Radu
>>>
>>> Radu Coravu
>>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>>> http://www.oxygenxml.com
>>>
>>> On 6/15/2016 7:18 PM, Michael Kay wrote:
>>>> If we run this from the com.saxonica.Validate command line with -t, we get
>>>>
>>>> Saxon-EE 9.7.0.5J from Saxonica
>>>> Java version 1.8.0_76-ea
>>>> Using license serial number V000006
>>>> Loading schema document file:/Users/mike/Desktop/temp/test.xsd
>>>> Error on line 18 column 48 of test.xsd:
>>>> SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>> either attribute specifications, ">" or "/>".
>>>> Schema processing failed: Failed to parse schema document
>>>>
>>>> Without -t, we get
>>>>
>>>> Error on line 18 column 48 of test.xsd:
>>>> SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>> either attribute specifications, ">" or "/>".
>>>> Schema processing failed: Failed to parse schema document
>>>>
>>>> So Saxon is providing the error information, but someone is dropping it before you get to see it.
>>>>
>>>> I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.
>>>>
>>>> Michael Kay
>>>>
>>>>
>>>>> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>>>>>
>>>>> Hi Michael,
>>>>>
>>>>> I am validating an XML Schema document using Oxygen.
>>>>>
>>>>> Upon validation, I got this error message:
>>>>>
>>>>> [SAXON] Failed to parse schema document
>>>>>
>>>>> There was no indication of what the problem might be or where the problem might be located.
>>>>>
>>>>> It's not a very helpful error message.
>>>>>
>>>>> In a large XML Schema document, it can take a considerable effort to find the problem.
>>>>>
>>>>> Is there any way to replace this error message with something more helpful?
>>>>>
>>>>> By the way, after much effort I was able to find the problem:
>>>>>
>>>>> <xs:element name="Palette_Entries"">
>>>>>
>>>>> See the problem? I accidentally added a second quote after the element name.
>>>>>
>>>>> /Roger
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>>> _______________________________________________
>>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>>
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>>
>> ------------------------------------------------------------------------------
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
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: A less-than-helpful error message

Radu Coravu
Hi Michael,

Good catch, the Source is an XMLReader over the schema location and it
did not have an error handler set to it. I did and it seems that the
exception is now coming through. So we'll probably have a fix for this
in Oxygen 18.1.

Regards,
Radu

Radu Coravu
<oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

On 6/16/2016 12:55 PM, Michael Kay wrote:

> What kind of Source object do you supply?
>
> For well-formedness errors, I'm not sure how the ErrorHandler on the SchemaFactory relates to any SAXSource.XMLReader.ErrorHandler. As usual, JAXP doesn't have much to say on this.
>
> But it looks as if we're using the ErrorHandler on SchemaFactory only to report errors detected by the schema processor, not to report errors detected by the XML parser. The latter are going to the ErrorHandler on the XMLReader object when a SAXSource is supplied, or to the default system error handler otherwise - which by default  will list them to System.err.
>
> Michael Kay
> Saxonica
>
>> On 16 Jun 2016, at 08:50, Radu Coravu <[hidden email]> wrote:
>>
>> Hi Michael,
>>
>> Actually we set the error handler
>> "javax.xml.validation.SchemaFactory.setErrorHandler(ErrorHandler)"
>> before calling "SchemaFactory.newSchema" but nothing is reported on the
>> error handler.
>> This using Saxon 9.6.0.7.
>>
>> Regards,
>> Radu
>>
>> Radu Coravu
>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>> http://www.oxygenxml.com
>>
>> On 6/16/2016 10:36 AM, Michael Kay wrote:
>>> Saxon will have notified all the parse errors to the registered ErrorHandler / ErrorListener. It's up to the ErrorListener to decide what to do with them.
>>>
>>> Michael Kay
>>> Saxonica
>>>
>>>
>>>> On 16 Jun 2016, at 06:14, Radu Coravu <[hidden email]> wrote:
>>>>
>>>> Hi Michael,
>>>>
>>>> So Oxygen receives this exception from Saxon when it attempts to create
>>>> the schema:
>>>>
>>>>> org.xml.sax.SAXParseException; Failed to parse schema document
>>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.toSAXException(SchemaFactoryImpl.java:407)
>>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:292)
>>>>> at javax.xml.validation.SchemaFactory.newSchema(Unknown Source)
>>>>> at ro.sync.customscanners.SaxonSAErrorScanner.getSchemaValidator(SaxonSAErrorScanner.java:509)
>>>>> at ro.sync.customscanners.SaxonSAErrorScanner.pluggableValidateScanInternal(SaxonSAErrorScanner.java:340)
>>>>> at ro.sync.customscanners.PluggableErrorScanner.scanInternal(PluggableErrorScanner.java:259)
>>>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:181)
>>>>> at ro.sync.exml.validate.AbstractErrorScanner$1.run(AbstractErrorScanner.java:1)
>>>>> at ro.sync.exml.validate.AbstractErrorScanner.scan(AbstractErrorScanner.java:193)
>>>>> at ro.sync.exml.editor.validate.ValidationAssistant.applyErrorScanner(ValidationAssistant.java:382)
>>>>> at ro.sync.exml.editor.validate.ValidationAssistant$1.appRun(ValidationAssistant.java:313)
>>>>> at ro.sync.ui.application.ApplicationThread.run(ApplicationThread.java:135)
>>>>> Caused by: net.sf.saxon.type.SchemaException: Failed to parse schema document
>>>>> at com.saxonica.ee.schema.sdoc.SchemaReader.buildSchemaDocument(SchemaReader.java:289)
>>>>> at com.saxonica.ee.schema.sdoc.SchemaReader.read(SchemaReader.java:141)
>>>>> at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:500)
>>>>> at com.saxonica.ee.jaxp.SchemaFactoryImpl.newSchema(SchemaFactoryImpl.java:289)
>>>>> ... 10 more
>>>>
>>>> The received SAXParseException has the line and column numbers set to
>>>> "-1". Indeed the console output contains the information (probably Saxon
>>>> uses System.err to output them) but using Java API we cannot access the
>>>> line and column information.
>>>>
>>>> Regards,
>>>> Radu
>>>>
>>>> Radu Coravu
>>>> <oXygen/>  XML Editor, Schema Editor and XSLT Editor/Debugger
>>>> http://www.oxygenxml.com
>>>>
>>>> On 6/15/2016 7:18 PM, Michael Kay wrote:
>>>>> If we run this from the com.saxonica.Validate command line with -t, we get
>>>>>
>>>>> Saxon-EE 9.7.0.5J from Saxonica
>>>>> Java version 1.8.0_76-ea
>>>>> Using license serial number V000006
>>>>> Loading schema document file:/Users/mike/Desktop/temp/test.xsd
>>>>> Error on line 18 column 48 of test.xsd:
>>>>> SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>>> either attribute specifications, ">" or "/>".
>>>>> Schema processing failed: Failed to parse schema document
>>>>>
>>>>> Without -t, we get
>>>>>
>>>>> Error on line 18 column 48 of test.xsd:
>>>>> SXXP0003: Error reported by XML parser: Element type "xs:element" must be followed by
>>>>> either attribute specifications, ">" or "/>".
>>>>> Schema processing failed: Failed to parse schema document
>>>>>
>>>>> So Saxon is providing the error information, but someone is dropping it before you get to see it.
>>>>>
>>>>> I guess oXygen are relying on the fact that when you open the schema document in oXygen, you get red squiggly lines where the XML parser errors are, and the Xerces error message at the bottom of the screen.
>>>>>
>>>>> Michael Kay
>>>>>
>>>>>
>>>>>> On 15 Jun 2016, at 16:31, Costello, Roger L. <[hidden email]> wrote:
>>>>>>
>>>>>> Hi Michael,
>>>>>>
>>>>>> I am validating an XML Schema document using Oxygen.
>>>>>>
>>>>>> Upon validation, I got this error message:
>>>>>>
>>>>>> [SAXON] Failed to parse schema document
>>>>>>
>>>>>> There was no indication of what the problem might be or where the problem might be located.
>>>>>>
>>>>>> It's not a very helpful error message.
>>>>>>
>>>>>> In a large XML Schema document, it can take a considerable effort to find the problem.
>>>>>>
>>>>>> Is there any way to replace this error message with something more helpful?
>>>>>>
>>>>>> By the way, after much effort I was able to find the problem:
>>>>>>
>>>>>> <xs:element name="Palette_Entries"">
>>>>>>
>>>>>> See the problem? I accidentally added a second quote after the element name.
>>>>>>
>>>>>> /Roger
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>>>> _______________________________________________
>>>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>>>> [hidden email]
>>>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>>> _______________________________________________
>>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>>> [hidden email]
>>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>>> patterns at an interface-level. Reveals which users, apps, and protocols are
>>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
>> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help
>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...