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.

Jeremias M�rki

mailto:[EMAIL PROTECTED]

OUTLINE AG
Postfach 3954 - Rhynauerstr. 15 - CH-6002 Luzern
Fon +41 (41) 317 2020 - Fax +41 (41) 317 2029
Internet http://www.outline.ch

----------------------------------------------------------------------
Post a message:         mailto:[EMAIL PROTECTED]
Unsubscribe:            mailto:[EMAIL PROTECTED]
Contact administrator:  mailto:[EMAIL PROTECTED]
Read archived messages: http://archive.xmldb.org/
----------------------------------------------------------------------


Kimbro Staken The dbXML Project htttp://www.dbxml.org ---------------------------------------------------------------------- Post a message: mailto:[EMAIL PROTECTED] Unsubscribe: mailto:[EMAIL PROTECTED] Contact administrator: mailto:[EMAIL PROTECTED] Read archived messages: http://archive.xmldb.org/ ----------------------------------------------------------------------

Reply via email to