On Thu, 2 Aug 2001 01:23:56 -0700
Kimbro Staken <[EMAIL PROTECTED]> wrote:
>
> On Thursday, August 2, 2001, at 01:00 AM, Jeremias Maerki wrote:
>
> >> I'd like some input on how the XPathQueryService should handle
> >> namespaces.
> >> A while back I posted the following set of options. I'm currently
> >> leaning
> >> toward #4.
> >
> > I like #2. To #4: What about an array of Namespace objects (similar to
> > the ones in JDOM) instead of an array of Strings?
> >
> > The class would look like this:
> >
> > class Namespace {
> > public Namespace(String prefix, String uri);
> > public String getPrefix();
> > public String getURI();
> > }
> >
> > This class can be extended/subclassed (new constructors) to parse the
> > different string representations such as "xmlns(x=http....)".
> >
> > I'm for #5: Second arg as an array of Namespace objects.
> >
> > namespaces[0] = new Namespace("x", "http://example.com/foo");
> > namespaces[1] = new Namespace("y", "http://example.com/y");
> > query("//x:bar", namespaces);
> >
> > What do you think? Is this portable?
> >
>
> Since we're only defining interfaces we'd have to have a factory method
> somewhere to create these objects. How often is the programmer going to
> need the namespace object other then as a mechanism to feed the api? My
> concern is simply keeping the number of interfaces to an absolute minimum
> and I'm not sure this one would be absolutely necessary.
>
> Another option here would be to have a setNameSpace(string prefix, string
> uri) method on XPathQueryService itself.
Even if I like #4, I would say that "setNameSpace()" would be the
modicum of effort and would match our goal to provide a thin API.
Regards,
Lars
--
______________________________________________________________________
Lars Martin mailto:[EMAIL PROTECTED]
SMB GmbH http://www.smb-tec.com
----------------------------------------------------------------------
Post a message: mailto:[EMAIL PROTECTED]
Unsubscribe: mailto:[EMAIL PROTECTED]
Contact administrator: mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------