Re: [bdbxml] XmlValue.getNodeValue() Problem

George Feinberg <[email protected]> Thu, 15 Sep 2005 18:03:11 -0400
Newsgroups gmane.comp.db.dbxml.general
Message-ID <[email protected]>
Ambar,

The simplest thing is if you provide a very specific,
self-contained, small Java test program that exhibits the
behavior you are seeing.

It is important to understand that the XmlValue methods
getFirstChild, getLastChild, getNodeValue, etc are exact
parallels for the corresponding DOM methods, which means
you may  not get what you expect in the face of
white space, and other unexpected nodes in the DOM tree.

Regards,

George

> Hi ...
>
> I am trying to retrieve specific information by the combining and  
> joining
> results. So the query is something like this:
>
> String query = "for $col in
> collection('management.bdbxml')/collections/collection,\n";
> query += "$alg in collection('management.bdbxml')/algorithms/ 
> algorithm,\n";
> query += "$alp in collection('management.bdbxml')/alphas/alpha,\n";
> query += "$algorithm in $alg[name=$col/associatedAlgorithm/ 
> algorithm],\n";
> query += "$alpha in $alp[name=$alg/alpha]\n";
> query += "where $col[name='col2']\n";
> query += "return <collection id='{$col/name}'>";
> query += "{$alg/extractor}";
> query += "{$alp/descriptor}";
> query += "</collection>";
>
> To examine the results:
> XmlResults results = managerQuery.execute(managerContext,0);
> XmlValue value = results.next();
> if(value != null){
>  System.out.println("Display the result set. There is:");
>  while(value != null){
>   XmlValue extValue = value.getFirstChild();
>   XmlValue desValue = value.getLastChild();
>   String extractor = extValue.getNodeValue();
>   String descriptor = desValue.getNodeValue();
>   System.out.println("Extractor: "+extractor+" y descriptor:  
> "+descriptor);
>
>   value = results.next();
>  }
> }else{
>  System.out.println("It's empty :'(");
> }
>
> But the method getNodeValue() returns nothing. nevertheless, when i  
> test with
> value.asString() or extValue.isNull() the node value exist.
>
> I don't know, what's wrong?
>
> Any help would be appreciated.
>


------------------------------------------
To remove yourself from this list, send an
email to [email protected]