0
Multiple XML data sets

/t5/dreamweaver-discussions/multiple-xml-data-sets/td-p/109699
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
Hi
I want to create multiple XML datasets on one page. For example: 2 queries (php,mysql), 2 results. Then on the page where you define the datasets you normally add this:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
//-->
</script>
Now, this works perfectly, but how can i add multiple datasets, for example:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
var dsEmployees2 = new Spry.Data.XMLDataSet("export.php", "company2/employee2");
//-->
Once i add the second dataset, only the first one displays. Anybody have any ideas?
Thanks
</script>
I want to create multiple XML datasets on one page. For example: 2 queries (php,mysql), 2 results. Then on the page where you define the datasets you normally add this:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
//-->
</script>
Now, this works perfectly, but how can i add multiple datasets, for example:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
var dsEmployees2 = new Spry.Data.XMLDataSet("export.php", "company2/employee2");
//-->
Once i add the second dataset, only the first one displays. Anybody have any ideas?
Thanks
</script>
TOPICS
Server side applications
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
People's Champ
,
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109700#M86816
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
did you add the other dataset to the regions?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109701#M86817
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
Yes, i created 2 connections (php,mysql) on the one page,
exported the data to 2 seperate tables, but when i try and call
both tables on the page where the datasets are defined (see my
original post), only 1 appear. Even in DW CS4, when i want to add
another spry dataset (XML) using the wizard, only the first one
comes up, it doesn't even show 2 data sets.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
People's Champ
,
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109702#M86818
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
Do you have a online url?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109703#M86819
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
No, but i can post the code?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
People's Champ
,
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109704#M86820
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
Uhm i guess so. :)
can you also post a sample xml? also, are you using the latest version of Spry ? (1.6.1)
can you also post a sample xml? also, are you using the latest version of Spry ? (1.6.1)
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109705#M86821
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
Ok, here is the code that gets the data and exports it to
XML:
Query 1:
=============================
mysql_select_db($database_conn_export, $conn_export);
$query_rsEmployees = "SELECT * FROM employees_emp";
$rsEmployees = mysql_query($query_rsEmployees, $conn_export) or die(mysql_error());
$row_rsEmployees = mysql_fetch_assoc($rsEmployees);
$totalRows_rsEmployees = mysql_num_rows($rsEmployees);
// Begin XMLExport rsEmployees
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($rsEmployees);
$xmlExportObj->addColumn("firstname_emp", "firstname");
$xmlExportObj->addColumn("lastname_emp", "lastname");
$xmlExportObj->addColumn("address_emp", "address");
$xmlExportObj->addColumn("salary_emp", "salary");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("company");
$xmlExportObj->setRowNode("employee");
$xmlExportObj->Execute();
// End XMLExport rsEmployees
=============================
Query 2:
=============================
=============================
mysql_select_db($database_data_one, $data_one);
$query_mem_details = "SELECT * FROM wherever where mem='$mem_number'";
$mem_details = mysql_query($query_mem_details, $data_one) or die(mysql_error());
$row_mem_details = mysql_fetch_assoc($mem_details);
$totalRows_mem_details = mysql_num_rows($mem_details);
// Begin XMLExport Member Details
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($mem_details);
$xmlExportObj->addColumn("firstname", "firstname");
$xmlExportObj->addColumn("lastname", "lastname");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("Member");
$xmlExportObj->setRowNode("Details");
$xmlExportObj->Execute();
// End XMLExport Member Details
=============================
And here is the page that calls these two datasets:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
var mem_details = new Spry.Data.XMLDataSet("export.php", "Member/Details");
//-->
And only the first one appears.
</script>
Query 1:
=============================
mysql_select_db($database_conn_export, $conn_export);
$query_rsEmployees = "SELECT * FROM employees_emp";
$rsEmployees = mysql_query($query_rsEmployees, $conn_export) or die(mysql_error());
$row_rsEmployees = mysql_fetch_assoc($rsEmployees);
$totalRows_rsEmployees = mysql_num_rows($rsEmployees);
// Begin XMLExport rsEmployees
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($rsEmployees);
$xmlExportObj->addColumn("firstname_emp", "firstname");
$xmlExportObj->addColumn("lastname_emp", "lastname");
$xmlExportObj->addColumn("address_emp", "address");
$xmlExportObj->addColumn("salary_emp", "salary");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("company");
$xmlExportObj->setRowNode("employee");
$xmlExportObj->Execute();
// End XMLExport rsEmployees
=============================
Query 2:
=============================
=============================
mysql_select_db($database_data_one, $data_one);
$query_mem_details = "SELECT * FROM wherever where mem='$mem_number'";
$mem_details = mysql_query($query_mem_details, $data_one) or die(mysql_error());
$row_mem_details = mysql_fetch_assoc($mem_details);
$totalRows_mem_details = mysql_num_rows($mem_details);
// Begin XMLExport Member Details
$xmlExportObj = new XMLExport();
$xmlExportObj->setRecordset($mem_details);
$xmlExportObj->addColumn("firstname", "firstname");
$xmlExportObj->addColumn("lastname", "lastname");
$xmlExportObj->setMaxRecords("ALL");
$xmlExportObj->setDBEncoding("ISO-8859-1");
$xmlExportObj->setXMLEncoding("ISO-8859-1");
$xmlExportObj->setXMLFormat("NODES");
$xmlExportObj->setRootNode("Member");
$xmlExportObj->setRowNode("Details");
$xmlExportObj->Execute();
// End XMLExport Member Details
=============================
And here is the page that calls these two datasets:
<script type="text/javascript">
<!--
var dsEmployees = new Spry.Data.XMLDataSet("export.php", "company/employee");
var mem_details = new Spry.Data.XMLDataSet("export.php", "Member/Details");
//-->
And only the first one appears.
</script>
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
People's Champ
,
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109706#M86822
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
I was talking about the html of the page, containing the
regions.. repeats or anything that doesn't show up... and the
rendered xml, not the php query 😄
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

Guest
AUTHOR
/t5/dreamweaver-discussions/multiple-xml-data-sets/m-p/109707#M86823
Jan 23, 2009
Jan 23, 2009
Copy link to clipboard
Copied
But thats my whole problem, it doesn't even get that far,
even if i add the html, repeats, regions etc.. it only shows the
first table. Also if i open the source file (whith the php queries)
it also only shows the first table, but nothing more than
that.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

