Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Input as xml in dojo unable to load  RSS feed

jyothsna ananthula
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in the following example anything mistake i am unable to load xml url.while running this getting error as lookup fail and unable to load
../WEB-INF/books.xml.please help me out as soon as possible

Document : xmltotreegrid
Created on : Jun 23, 2011, 11:53:07 AM
Author : JA0084604

<html dir="ltr">

<style type="text/css">
body, html { font-family:helvetica,arial,sans-serif; font-size:90%; }
<script src=""
djConfig="parseOnLoad: true">

//This function performs some basic dojo initialization. In this case it connects the button
//onClick to a function which invokes the fetch(). The fetch function queries for all items
//and provides callbacks to use for completion of data retrieval or reporting of errors.
function init3() {
//Function to perform a fetch on the datastore when a button is clicked
function search() {
var queryObj = {};

//Build up the query from the input boxes.
var isbn = isbnBox.getValue();
if (isbn && dojo.trim(isbn) !== "") {
queryObj["isbn"] = isbn;

var qNode = dojo.byId("query");
if (qNode) {
qNode.innerHTML = dojo.toJson(queryObj);

//Callback to perform an action when the data items are starting to be returned:
function clearOldList(size, request) {
var list = dojo.byId("list3");
if (list) {
while (list.firstChild) {

//Callback for processing a returned list of items.
function gotItems(items, request) {
var list = dojo.byId("list3");
if (list) {
var i;
for (i = 0; i < items.length; i++) {
var item = items[i];
list.appendChild(document.createTextNode("ISBN: " + bookStore.getValue(item, "isbn") + " TITLE:" + bookStore.getValue(item, "title")));

//Callback for if the lookup fails.
function fetchFailed(error, request) {
alert("lookup failed.");

//Fetch the data.
query: queryObj,
onBegin: clearOldList,
onComplete: gotItems,
onError: fetchFailed

//Link the click event of the button to driving the fetch.
dojo.connect(button3, "onClick", search);
//Set the init function to run when dojo loading and page parsing has completed.
<link rel="stylesheet" type="text/css" href=""

<body class=" claro ">
<input dojoType="dijit.form.TextBox" jsId="isbnBox" value="*">
<div dojoType="" jsId="bookStore" url="../WEB-INF/books.xml">
<div dojoType="dijit.form.Button" jsId="button3">
Click to search!
Query used:
<span id="query">
</span <br>
Books located:
<span id="list3">
<!-- NOTE: the following script tag is not intended for usage in real
world!! it is part of the CodeGlass and you should just remove it when
you use the code -->
<script type="text/javascript">
dojo.addOnLoad(function() {
if ( {;


xml in WEB_INF/books.xml i created as follows
<?xml version="1.0" encoding="UTF-8"?>

Document : books.xml
Created on : June 23, 2011, 12:12 PM
Author : JA0084604
Purpose of the document follows.

<?xml version="1.0" encoding="ISO-8859-1"?>
<title>Title of 1</title>
<author>Author of 1</author>
<title>Title of 2</title>
<author>Author of 2</author>
<title>Title of 3</title>
<author>Author of 3</author>
<title>Title of 4</title>
<author>Author of 4</author>
<title>Title of 5</title>
<author>Author of 5</author>
<title>Title of 6</title>
<author>Author of 6</author>

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!