It seems likely this is a bug in Lexus, but I haven't looked at it in detail. Lars, do you know if namespaces work correctly in Lexus? If they do then it's a bug in Xindice (what used to be dbXML for those who don't know).

As for adding namespace methods I'm inclined to want to avoid it. For instance, it will also cause problems when we want to add XQuery support, since XQuery defines its own way of handling namespaces. It creates an inconsistency in the API but I think that is probably better then having to change the way you work with the actual query languages. Of course the API could also allow both ways by just mapping the method calls into whatever the underlying language uses. I'm not sure if that is a good approach or not, maybe it would actually be good for consistency.

On Wednesday, December 12, 2001, at 01:04 PM, Timothy M. Dean wrote:

No, you are not missing anything. I suspect that the approach you have suggested could be made to work. I have verified that it does not currently work with dbXML, but perhaps it should work that way. However, it might still be nice to have an API mechanism to set namespace mappings.

Here is an example of what I've been trying to do. Consider the
following
XML document which is stored in my database:

  <?xml version="1.0" encoding="UTF-8"?>
  <RootElement xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
      xmlns="http://www.mydomain.com/MyDocument";
      xsi:schemaLocation="http://www.mydomain.com/MyDocument
Document.xsd">
      <Subelement id="sub1"/>
      <Subelement id="sub2"/>
      <Subelement id="sub3"/>
  </RootElement>

Now suppose I want to perform an Xupdate on the above document. For the
sake
of this example, I will attempt to append a new Subelement node. The
XUpdate
document I would use if there were no default would be as follows:

  <xupdate:append select="/RootElement">
      <xupdate:element name="Subelement">
          <xupdate:attribute name="id">sub4</xupdate:attribute>
      </xupdate:element>
  </xupdate:append>

This Xupdate query, as expected, has no results because the select comes
back
with no nodes due to the fact that I have not qualified RootElement with
a
namespace. So, what I want to do is add a namespace to my select as
follows:

  <xupdate:append select="/doc:RootElement">
      ...
  </xupdate:append>

Now I need a way to specify the mapping from the "doc" namespace prefix
to an
appropriate URI. If I understand your suggestion correctly, you are
suggesting
that I should do something like:

  <xupdate:append xmlns:doc="http://www.mydomain.com/MyDocument";
      select="/doc:RootElement">
      ...
  </xupdate>

Is this what you are suggesting? I was curious if this was the way
selection was
supposed to work within XUPdate. If this is supposed to work, then I
will shift
my attention to understanding why it doesn't appear to be working for me
within
the dbXMLb4 implementation (or perhaps the problem is within the Lexus
code?).

I believe that my suggestion might still be a more convenient way of
mapping
namespaces from the API. Rather than having to add the namespace
mappings to
my XUpdate document, I would be able to set the namespace mappings
programatically - Much like I can with the XPathQueryService.

You do make a good point about the difference between XPath and XUpdate.
It seems
likely that namespace mapping methods were added to XPathQueryService
because
there was no way to do it conveniently within the query string. On the
other hand,
an XUpdate document at least has the option of putting namespace
mappings directly
in the document. Even so, I still think it would be a lot more
convenient if you
could define your mappings via the XUpdateQueryService API.

- Tim

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


Kimbro Staken
XML Database Software, Consulting and Writing
http://www.xmldatabases.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