Re: [bdbxml] fn:id() problem
George Feinberg <[email protected]> Wed, 10 May 2006 12:30:27 -0400
| Newsgroups | gmane.comp.db.dbxml.general |
|---|---|
| Message-ID | <[email protected]> |
Tobias,
A document must have either a DTD or schema in
order to have an attribute that is an ID.
I do not know why this works with XMLSpy, unless they
implicitly cast all attributes named "id" to ID.
If you want good performance searching for attributes
in BDB XML, you can add an index on the id attribute
(in dbxml shell syntax):
dbxml> addIndex "" id edge-attribute-equality-string
Then you can query for it using normal attribute syntax.
Regards,
George
> Hi,
>
> I use PHP and have a problem with the fn:id() function. I always
> get the
> error message "undefined context item in fn:id [err:F0N0001]". The
> same
> query executes well in Altova XMLSpy, so I am confused.
>
> My code looks something like this:
> <root>
> <child id="someid">
> <subchild />
> </child>
> <child id="someotherid">
> <subchild />
> </child>
> </root>
>
> $manager = newXmlManager();
> $container = $manager->openContainer("container.dbxml");
>
> $results = $manager->query(
> "for \$x in collection('container.dbxml')//root
> return fn:id('someid')");
>
> What is wrong? Other XQueries work well, but not fn:id()...
>
> Thank you,
> Tobias Neumann
>
>
> ------------------------------------------
> To remove yourself from this list, send an
> email to [email protected]
>
------------------------------------------
To remove yourself from this list, send an
email to [email protected]