You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Gareth Reakes <ga...@we7.com> on 2008/04/18 11:53:04 UTC

Re: [Fwd: Re: Xerces-C API changes for XQilla]

Hey,


On 17 Apr 2008, at 17:42, John Snelson wrote:

>
>
> -------- Original Message --------
> Subject: Re: Xerces-C API changes for XQilla
> Date: Thu, 17 Apr 2008 16:31:57 +0100
> From: John Snelson <jo...@oracle.com>
> Reply-To: c-dev@xerces.apache.org
> To: c-dev@xerces.apache.org
> References: <47...@oracle.com>  
> <20...@karelia>
>
> Hi Boris,
>
> Boris Kolpackov wrote:
>> John Snelson <jo...@oracle.com> writes:
>>> 1) Problem:
>>>
>>> XPath 2.0 is just different to XPath 1.0. We've therefore got our  
>>> own
>>> version of DOMXPathResult (XPath2Result) which makes more sense in  
>>> this
>>> context:
>>>
>>> http://xqilla.sourceforge.net/docs/dom3-api/classXPath2Result.html
>>>
>>> Solution:
>>>
>>> It's probably simple enough to either extend DOMXPathResult to  
>>> include
>>> the extra functionality in XPath2Result, or to include it as a new  
>>> class
>>> called DOMXPath2Result.
>> I did a quick check and it appears that the DOMXPathResult is very
>> similar to DOMXPath2Result. I would therefore suggest that we try
>> to add the missing functionality to DOMXPathResult as non-standard
>> extensions (though we should try to use names that will likely be
>> used in the next version of DOM3 when it is updated to include
>> support for XPath 2, for example getIntegerValue instead of asInt).
>> What is your feeling on this approach? Also did you base your
>> DOMXPath2Result on any draft spec (e.g., where do the asDouble,
>> asInt, etc., names come from)?
>
> XPath2Result wasn't based on any draft spec IIRC. Gareth probably
> remembers more about it's design, since I wasn't heavily involved in
> Pathan at the time.


It was off some draft note. Some conversation and the note is here:

http://lists.w3.org/Archives/Public/www-dom/2003JulSep/0125.html


Gareth--
Gareth Reakes, CTO                                            WE7
+44-20-7117-0809                    http://www.we7.com





Re: [Fwd: Re: Xerces-C API changes for XQilla]

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi John,

John Snelson <jo...@oracle.com> writes:

> I suggest adding two methods:
>
> const DOMTypeInfo *getTypeInfo() const;
> int getIntegerValue() const;

I like this idea. It is also a good idea to add the INTEGER_TYPE
enumerator to resultType for consistency.

We will probably also have to implement these to methods in
DOMXPathResultImpl which will be really easy since they just
throw.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: [Fwd: Re: Xerces-C API changes for XQilla]

Posted by John Snelson <jo...@oracle.com>.
Boris Kolpackov wrote:
> Hi John, Gareth,
> 
> John Snelson <jo...@oracle.com> writes:
> 
>>> It was off some draft note. Some conversation and the note is here:
>>>
>>> http://lists.w3.org/Archives/Public/www-dom/2003JulSep/0125.html
>> Now I look at that link I remember reading it before. That leaves me a
>> little uncertain about what to do. Maybe we should add DOMXPathResult2
>> to Xerces-C based on this note - any opinions?
> 
> What puzzles me in this note is that it appears the author tried to
> make the XPath2Result interface as incompatible with XPathResult as
> he possibly could. For example the original interface has accessors
> named as getBooleanValue, getNumberValue, etc. The new interface for
> some reason uses asBoolean, asDouble, etc. This makes me question the
> seriousness of the author's effort. Also, I am wondering if anything
> came out of this, e.g., was it submitted to W3C for recommendation as
> suggested in the email? Perhaps there is something newer than this?
> I also wonder what other XPath 2 implementations did.

I don't know of anyone else who's tried to implement the DOM3 XPath API 
for XPath 2.0.

The more I read through that thread of discussion, the more I realise 
that there's nothing like consensus for what a DOM XPath 2.0 API would 
look like. Since I think that I can certainly implement DOMXPathResult 
in XQilla, why don't we just extend that class a little. I suggest 
adding two methods:

const DOMTypeInfo *getTypeInfo() const;
int getIntegerValue() const;

> I don't mind having XPath2 as a separate interface (note that it
> appears from the email discussion that it should be DOMXPath2Result
> and not DOMXPathResult2). The question is do we make it as
> inconsistent as the author suggests or do we try to make it more
> in line with XPathResult?

Lets not bother - it's too much effort for very little gain. I strongly 
suspect that there'll never be an official DOM XPath 2.0 API, so XQilla 
gets more interoperability by implementing DOMXPathResult.

> BTW, we probably will want to extend XPathNSResolver interface
> as well to add addNamespaceBinding() so that the user does not
> need to cast it to XQillaNSResolver.

Sounds good to me.

John

-- 
John Snelson, Oracle Corporation            http://snelson.org.uk/john
Berkeley DB XML:            http://oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: [Fwd: Re: Xerces-C API changes for XQilla]

Posted by Boris Kolpackov <bo...@codesynthesis.com>.
Hi John, Gareth,

John Snelson <jo...@oracle.com> writes:

> >It was off some draft note. Some conversation and the note is here:
> >
> >http://lists.w3.org/Archives/Public/www-dom/2003JulSep/0125.html
>
> Now I look at that link I remember reading it before. That leaves me a
> little uncertain about what to do. Maybe we should add DOMXPathResult2
> to Xerces-C based on this note - any opinions?

What puzzles me in this note is that it appears the author tried to
make the XPath2Result interface as incompatible with XPathResult as
he possibly could. For example the original interface has accessors
named as getBooleanValue, getNumberValue, etc. The new interface for
some reason uses asBoolean, asDouble, etc. This makes me question the
seriousness of the author's effort. Also, I am wondering if anything
came out of this, e.g., was it submitted to W3C for recommendation as
suggested in the email? Perhaps there is something newer than this?
I also wonder what other XPath 2 implementations did.

I don't mind having XPath2 as a separate interface (note that it
appears from the email discussion that it should be DOMXPath2Result
and not DOMXPathResult2). The question is do we make it as
inconsistent as the author suggests or do we try to make it more
in line with XPathResult?

BTW, we probably will want to extend XPathNSResolver interface
as well to add addNamespaceBinding() so that the user does not
need to cast it to XQillaNSResolver.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: [Fwd: Re: Xerces-C API changes for XQilla]

Posted by Gareth Reakes <ga...@we7.com>.
On 18 Apr 2008, at 12:39, John Snelson wrote:

> Gareth Reakes wrote:
>>> XPath2Result wasn't based on any draft spec IIRC. Gareth probably
>>> remembers more about it's design, since I wasn't heavily involved in
>>> Pathan at the time.
>> It was off some draft note. Some conversation and the note is here:
>> http://lists.w3.org/Archives/Public/www-dom/2003JulSep/0125.html
>
> Now I look at that link I remember reading it before. That leaves me  
> a little uncertain about what to do. Maybe we should add  
> DOMXPathResult2 to Xerces-C based on this note - any opinions?



If its useful then I say yes.

Gareth

--
Gareth Reakes, CTO                                            WE7
+44-20-7117-0809                    http://www.we7.com





---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org


Re: [Fwd: Re: Xerces-C API changes for XQilla]

Posted by John Snelson <jo...@oracle.com>.
Gareth Reakes wrote:
>> XPath2Result wasn't based on any draft spec IIRC. Gareth probably
>> remembers more about it's design, since I wasn't heavily involved in
>> Pathan at the time.
> 
> It was off some draft note. Some conversation and the note is here:
> 
> http://lists.w3.org/Archives/Public/www-dom/2003JulSep/0125.html

Now I look at that link I remember reading it before. That leaves me a 
little uncertain about what to do. Maybe we should add DOMXPathResult2 
to Xerces-C based on this note - any opinions?

John

-- 
John Snelson, Oracle Corporation            http://snelson.org.uk/john
Berkeley DB XML:            http://oracle.com/database/berkeley-db/xml
XQilla:                                  http://xqilla.sourceforge.net

---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: c-dev-help@xerces.apache.org