Re: saxon-help Digest, Vol 109, Issue 4

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: saxon-help Digest, Vol 109, Issue 4

Hans-Juergen Rennau
It might be interesting also to consider a passage in XSD1.0, 3.4.2, which deals with the case of an empty choice quite explicitly, distinguishing it from the case of empty sequence and all group, making a @minOccurs=0 the condition of an empty choice group being equivalent to empty content:

2.1 If one of the following is true
2.1.1 There is no <group>, <all>, <choide> or <sequence> among the [children]
2.1.2 There is an <all> or <sequence> among the [children] with no [children] of its own excluding [annotation]
2.1.3 There is a <choide> among the [children] with no [children] of its own excluding <annotation> whose minOccurs [attribute] has the actual value 0
then .... (equivalent to empty content)




"[hidden email]" <[hidden email]> schrieb am 17:06 Dienstag, 2.Juni 2015:


Send saxon-help mailing list submissions to
    [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
    https://lists.sourceforge.net/lists/listinfo/saxon-help
or, via email, send a message with subject or body 'help' to
    [hidden email]

You can reach the person managing the list at
    [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of saxon-help digest..."


Today's Topics:

  1. Re: Validation errors during XsltTransformer.Run (on    .NET)    -
      can we capture them in code rather than on stdout/stderr?
      (Emanuel Wlaschitz)
  2. Bug in Saxon - it accepts as valid an element with a content
      model that is an empty choice (Costello, Roger L.)
  3. Re: Bug in Saxon - it accepts as valid an element with a
      content model that is an empty choice (Michael Kay)


----------------------------------------------------------------------

Message: 1
Date: Tue, 2 Jun 2015 13:22:26 +0000
From: Emanuel Wlaschitz <[hidden email]>
Subject: Re: [saxon] Validation errors during XsltTransformer.Run (on
    .NET)    - can we capture them in code rather than on stdout/stderr?
To: Mailing list for the SAXON XSLT and XQuery processor
    <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Nice, that looks like something I can work with. Thanks again!

Regarding the message being off; this is actually my own fault - that particular case prints all XsltCompiler.ErrorList entries (which contain the warning) and DynamicError.ToString (which, actually, is just the message) leading to some confusion on where the output came from. That's something I need to change on my end, sorry for that.

- Emanuel

From: Michael Kay [mailto:[hidden email]]
Sent: Dienstag, 02. Juni 2015 13:53
To: Mailing list for the SAXON XSLT and XQuery processor
Subject: Re: [saxon] Validation errors during XsltTransformer.Run (on .NET) - can we capture them in code rather than on stdout/stderr?


On 2 Jun 2015, at 12:06, Emanuel Wlaschitz <[hidden email]<mailto:[hidden email]>> wrote:

I already tried messing around with the controller, but the ErrorListener interface only provides a warning/error/fatalError method with a TransformerException parameter - none of which seem to expose an XPathContext.

The TransformerException will usually be castable to XPathException, and Saxon?s XPathException has a getXPathContext(). Like most getters on XPathException, be aware that it may return null.


But thanks anyways, I'll be patient and see what the future brings.

DynamicError does include the file name and line number; but my error message was off since there was a warning in front of the actual message (hiding the correct location).
That's a different thing tho; and if I find the time to make a small repro-case, I'll throw it at the bug tracker directly.



Always happy to have bugs on bad diagnostics, however trivial they might seem, it?s the only way we can improve them.

Michael Kay
Saxonica

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 2
Date: Tue, 2 Jun 2015 14:11:16 +0000
From: "Costello, Roger L." <[hidden email]>
Subject: [saxon] Bug in Saxon - it accepts as valid an element with a
    content model that is an empty choice
To: Mailing list for the SAXON XSLT and XQuery processor
    <[hidden email]>
Message-ID:
    <[hidden email]>
   
Content-Type: text/plain; charset="us-ascii"

Hi Michael,

Per the discussion on the xml-dev list:

Consider this XML Schema, it declares an element with a content model that is a complex type that is an empty choice:

    <xs:element name="Test3">
        <xs:complexType>
            <xs:choice/>
        </xs:complexType>
    </xs:element>

I created an XML instance document containing <Test3>:

    <Test3></Test3>

and validated it against the schema. It validated, which you stated is not correct.

/Roger
-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

Message: 3
Date: Tue, 2 Jun 2015 16:05:43 +0100
From: Michael Kay <[hidden email]>
Subject: Re: [saxon] Bug in Saxon - it accepts as valid an element
    with a    content model that is an empty choice
To: Mailing list for the SAXON XSLT and XQuery processor
    <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="utf-8"

Thanks, I?ve already logged this here

https://saxonica.plan.io/issues/2388 <https://saxonica.plan.io/issues/2388>

and I?m in the middle of investigating it.

I?ve traced the problem to a bug in the spec, where it defines an empty choice as being ?emptiable?; Saxon concludes that if it is ?emptiable? then the empty sequence is a valid instance.

Michael Kay
Saxonica


> On 2 Jun 2015, at 15:11, Costello, Roger L. <[hidden email]> wrote:
>
> Hi Michael,

> Per the discussion on the xml-dev list:

> Consider this XML Schema, it declares an element with a content model that is a complex type that is an empty choice:
>   
>    <xs:element name="Test3">
>        <xs:complexType>
>            <xs:choice/>
>        </xs:complexType>
>    </xs:element>

> I created an XML instance document containing <Test3>:
>
>    <Test3></Test3>

> and validated it against the schema. It validated, which you stated is not correct.

> /Roger
> ------------------------------------------------------------------------------
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help

-------------- next part --------------
An HTML attachment was scrubbed...

------------------------------

------------------------------------------------------------------------------


------------------------------

_______________________________________________
saxon-help mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help
The saxon-help list is archived at http://saxon.markmail.org/

End of saxon-help Digest, Vol 109, Issue 4
******************************************



------------------------------------------------------------------------------

_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help