How can i get the value of the element

When the result of X-query is like this:

<?xml version="1.0" encoding="UTF-8"?>
<result>
	<selfnodename ino:id="3"> ???? </selfnodename>
	<selfnodename ino:id="3"> ??? </selfnodename>
	<selfnodename ino:id="3"> ??????? </selfnodename>
	<selfnodename ino:id="3"> ?? </selfnodename>
	<selfnodename ino:id="3"> ??????? </selfnodename>
</result>  </pre><BR><BR>what dom method should i use to get the value of element.<BR><BR>when i use the follow method :<BR> <pre class="ip-ubbcode-code-pre"> xqlResult=QueryResult.getResult();
 var nodeList=xqlResult.childNodes;
 itemSelected = nodeList.item(i);
 scr = itemSelected.nodeValue;
 document.write(scr); 



it return null ,the the real result.

Does itemSelected.xml help?

Hi markk,
> Does itemSelected.xml help?
what do you means?
I can’t find more details in tamino document.
How can I find more documents about jscript API ?

How can i save the query result to a xml file,using what API method?

In your example you said that itemSelected.nodeValue produced a null result. I was suggesting using itemSelected.xml. I typically use node.xml to display the XML for debugging or whatever.

The API doesn’t provide a mechanism for storing the XML to a file. But given node.xml it should be relatively easy to do this.

[This message was edited by markk on 09 May 2003 at 08:08.]

For nodes of type text node.text shows the text. This is probably what you want.

The JScript API documentation only describes the API specific parts. On Windows it only supports the Microsoft DOM (MSXML3/MSXML4). Information about this can be found online at http://msdn.microsoft.com.

hello markk,
Thanks very much for your help!

Best wish,
lisa

Hi markk,
I want to ask another question:
what the type of the QueryResult,
Is it a document object or element object or others onject ?
Then what about the xqlResult,
And i am sorry to tell you that i only
know some sample object,such as nodeList is nodeList object…



var QueryVal=‘/?[?ID = “TP312/0001”]’;
QueryResult = QueryObj.query(QueryVal);
xqlResult=QueryResult.getResult();
var nodeList=xqlResult.childNodes;//error message is: the object doesn’t support the method or attribute.

then i chage it like this:
var QueryVal=‘/?[?ID = “TP312/0001”]’;
QueryResult = QueryObj.query(QueryVal);
var nodelist = QueryQesult.nodes();//it displays the same error.


however it shows QueryResult.errorNo=0; also
the result in x-query query is like this :

<?xml version="1.0" encoding="UTF-8"?>
<result>

<? ino:id="1">
	<?ID>TP312/0001</?ID>
	<??>Tamino ??</??>
	<??>???</??>
	<??>Steven Holzner</??>
	<???>???????</???>
	<????>2001-10</????>
	<??>243</??>
	<??>52.00</??>
	<????>xml???</????>
	<????>?????</????>
	<???>???</???>
	<???>Tamino</???>
	<???>xml</???>
	<ISDN>7-111-02541/TP.2241</ISDN>
</?>

</result> 



what it happens? and i use what method to read the data of the child element?

thanks
lisa

The result of most TaminoClient methods is a TaminoResult object.

var tamResult = tamClient.query(“…”);

In your case what is the complete output of “tamResult.DOM.documentElement.xml”?

:slight_smile:
thanks, markk.
lisa