Thanks Charles and Ivan for your responses.
It's too bad there is no include mechanism right now but maybe in the
future.
Mario
On 7/2/2012 3:39 AM, Charles Foster wrote:
> Hi Mario,
>
> If you are using the Sedna XQJ API, when executing XQuery expressions
> you can add default namespaces to the static context of all queries,
> for instance:
>
> ==============
>
> XQConnection conn = MySednaXQDataSource.getConnection();
>
> XQStaticContext context = conn.getStaticContext();
>
> context.declareNamespace("p1", "http://www.example.com/ns/1");
> context.declareNamespace("p2", "http://www.example.com/ns/2");
> context.declareNamespace("p3", "http://www.example.com/ns/3");
>
> conn.setStaticContext(context);
>
> XQPreparedExpression xqpe = conn.prepareExpression(
> "<p1:doc> <p2:child1 /> <p3:child2 /> </p1:doc>"
> );
>
>
> XQResultSequence rs = xqpe.executeQuery();
>
> // proces results of result sequence ...
>
> ==============
>
> Because you set the connection's static context, you can continue to
> execute further queries where each query already has the namespaces
> declared.
>
> If you wish the namespaces declarations to only affect a given XQuery
> expression, but not subsequent calls, then you can use the following
> two methods, passing the XQStaticContext properties in as required:
>
> XQConnection.prepareExpression(..., XQStaticContext properties)
> XQConnection.createExpression(XQStaticContext properties)
>
> Hope this helps.
>
> Regards,
>
> Charles
>
>
> On 28 June 2012 19:11, Marijan (Mario) Madunic<hajduk@...> wrote:
>> Hi,
>>
>> Was wondering if it is possible to create a module to include a list of
>> namespace declarations? If not is there another method that this can be
>> done?
>>
>> Thanks
>>
>> Mario
>>
>> ------------------------------------------------------------------------------
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond. Discussions
>> will include endpoint security, mobile security and the latest in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> Sedna-discussion mailing list
>> Sedna-discussion@...
>> https://lists.sourceforge.net/lists/listinfo/sedna-discussion
>>
>
|