PDA

View Full Version : Compiler warning for "id" attribute of dataset element...


bplawler
03-19-2003, 08:47 PM
Hello all-

I am currently working on a little proof of concept involving retrieving xml data using an http dataset. Using some examples from the documentation and from this forum, I came up with code that looks like:

<canvas ...>
<dataset name="login" id="login"
type="http" src="...">

... and so on ...

The "id" attribute is necessary in the code so that we can have access to the dataset, but the code results in a compiler warning about id not being allowed, but without the id the code does not work. The lzx.dtd file does not seem to have the "id" attribute for dataset, but the code clearly needs it. Things work ok, but the error at the bottom is kind of a drag.

Is this a bug or is it something I have overlooked?

-Brian

antun
03-19-2003, 09:02 PM
Hey Brian

You don't need the id attribute. You use the name attribute with datasets:


<dataset name="myDataset" ... />


When binding data to views, you'd refer to it as follows:-


<view datapath="myDataset:/myRootNode/myReplicatedNode" .../>


But if you need to access it in script, for example to set the query string or do the query, you use canvas.datasets, which is globally accessible:-


<script>
canvas.datasets.myDataset.setQuerystring(...);
</script>


Take care,

Antun

bplawler
03-20-2003, 12:00 AM
Antun-

Thanks for the prompt reply! It was the canvas.datasets bit of magic that was the missing link. I now have my prototype working - a successful login to a Turbine backend!

-Brian