https://saxonica.plan.io/https://saxonica.plan.io/favicon.ico2019-08-23T09:23:42ZSaxonica Developer CommunitySaxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=140452019-08-23T09:23:42ZMichael Kaymike@saxonica.com
<ul></ul><p>Note also <code>XPathSelector</code> and <code>XQueryEvaluator</code> both have the capability to return an <code>IEnumerator</code> (should be <code>IEnumerator<XdmItem></code> perhaps?), rather than XdmEnumerator. I suggest we move towards returning <code>XdmEnumerator</code>, while accepting <code>IEnumerator<XdmItem></code>. But we should probably review more carefully all the usages of these classes.</p> Saxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=141432019-09-02T15:28:32ZMichael Kaymike@saxonica.com
<ul></ul><p>This whole area looks very messy. I've spent some time looking at it, and I'm inclined to do the following:</p>
<p>(a) Wind back some of the changes we made in 9.9 to generify things. That is, get rid of the generified <code>IXdmEnumerator<XdmItem></code>, as well as <code>IXdmEnumerable</code>. Make <code>XdmValue.GetEnumerator()</code> return non-generic <code> IEnumerator</code> as it did in 9.8. Having <code>XdmValue.GetEnumerator()</code> return <code>IXdmEnumerator<XdmItem></code> rather than the non-generic <code>IXdmEnumerator</code> doesn't add value, given that we're not overriding it with methods that return a more specific type, e.g. <code>XdmAtomicValue.GetEnumerator()</code> isn't declared to return <code>IXdmEnumerator<XdmAtomicValue></code>.</p>
<p>(b) In 10.0, get rid of <code>IXdmEnumerator</code> entirely. It's only used in <code>ExtensionFunctionCall</code>. Have its implementing classes implement <code>IEnumerator<XdmItem></code> instead; and make <code>GetEnumerator()</code> on subtypes return a more specific type, e.g. <code>IEnumerator<XdmAtomicValue></code>. Change the <code>ExtensionFunctionCall.Call()</code> method to accept and return <code>IEnumerable<XdmItem></code>.</p>
<p>(c) For 9.9 as well as 10.0, ensure that an implementation of <code>ExtensionFunctionCall.Call()</code> can construct its return value using, for example,
<code>new XdmAtomicValue(123).GetEnumerator()</code>. To do this, relax the return type of the method if necessary.</p> Saxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=141442019-09-02T15:29:31ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>In Progress</i></li></ul> Saxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=141532019-09-03T14:27:48ZMichael Kaymike@saxonica.com
<ul></ul><p>We've decided to clean this up, at the cost of taking a bit of a hit in terms of backwards compatibility.</p>
<p>The classes<code> IXdmEnumerator</code> and <code>IXdmEnumerable</code> disappear; in their place we use <code>IEnumerator<XdmItem></code> and <code>IEnumerable<XdmItem></code>.</p>
<p>Any code that implements <code>ExtensionFunctionCall</code> will need to change; in most cases it's just a matter of changing <code>IXdmEnumerator</code> to <code>IEnumerator<XdmItem></code> in both the arguments and the result type of the <code>Call()</code> method.</p>
<p>Also affected is any 9.8 code that explicitly casts the results of (for example) <code>XPathSelector.GetEnumerator()</code> to <code>IXdmEnumerator</code> (as was done in some of the sample applications, which have now been rewritten).</p> Saxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=141542019-09-04T10:15:17ZMichael Kaymike@saxonica.com
<ul><li><strong>Status</strong> changed from <i>In Progress</i> to <i>Resolved</i></li><li><strong>Applies to branch</strong> <i>9.9, trunk</i> added</li><li><strong>Fix Committed on Branch</strong> <i>9.9, trunk</i> added</li></ul> Saxon - Bug #4296: XdmEnumerator on .NEThttps://saxonica.plan.io/issues/4296?journal_id=142112019-09-05T14:43:30ZO'Neil Delprattoneil@saxonica.com
<ul><li><strong>Status</strong> changed from <i>Resolved</i> to <i>Closed</i></li><li><strong>% Done</strong> changed from <i>0</i> to <i>100</i></li><li><strong>Fixed in Maintenance Release</strong> <i>9.9.1.5</i> added</li></ul><p>Bug fix applied in the Saxon 9.9.1.5 maintenance release.</p>