From: Wolfgang M. <wol...@ex...> - 2009-12-26 08:34:37
|
> <context > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://xml.memeio.org/2010/context" > xsi:schemaLocation="http://xml.memeio.org/2010/context / > db/memeio/schemas/Property/XSD/context.xsd" > name="" > publisher="{$document/publisher}" The xmlns default namespace declaration in the enclosing XML fragment also changes the context for the enclosed XQuery expression. $document/publisher will thus search for publisher elements in the http://xml.memeio.org/2010/context namespace! This behaviour might be confusing (I have hit the same issue frequently), but it is required by the XQuery spec. To escape this feature, you would need to declare another namespace prefix: declare namespace c="http://xml.memeio.org/2010/context"; and then use: publisher="{$document/c:publisher}" for the attribute declaration. Wolfgang |