XML Dataset Problem
Hi,
I have an XML file containing information about my portfolio.
I just need to show different information on my webpage when
I click on an image.
Here is my page:
www.w00t.biz/beta.asp
I would like to display information in the middle of the page
when I click each image.
Could anyone tell me how to do this?
I have seen various examples that show you how to repeat
data, but none that show you how to display parts of an XML file
dynamically.
Can anyone help?
Thankyou
I've managed top get a basic page working off an XML file,
can someone please tell me how I can get two items per row like in
my page I linked above?
Thanks in advance
Similar Messages
-
Spry XML dataset + PHP problem
I have installed Dreamweaver CS3 and created a simple page
that receives a XML dataset from a PHP page. I was not able to
display any data in either FF or IE (just got a blank page). I then
downloaded the 1.5 pre-release and discovered the Data Set Explorer
which worked well in FF but doesn't do anything in IE. Then I
copied SpryData.js and xpath.js to my sites' SpryAssets directory,
overwriting the 1.4 files and my simple page worked in FF,
but still NOT in IE6/7. I then uploaded the pages to a
remote server and tested on another PC, but it still doesn't work.
If I replace the php file with a XML dataset it works on both FF
and IE. Can someone please look at the
test page and tell me what
I am missing? The PHP page that feeds the XML can be viewed
hereThanks for the reply Kin, I also had an idea that it might be
the headers. When I copied the example from
here
the
header('Content-type:
text/xml'); line was commented out by mistake! Thanks for
your help, it's working now! -
Hi,
I've created a PHP page with a recordset consisting of joined tables. I've then exported it as XML. When I am on my main page and attempting to create an XML dataset, as I have done successfully before, when I click on "Get Schema" I get the exception "Type:UTFDataFormat Exception". I don't know why. I haven't had this before.
I have viewed my original PHP page with the recordset and I see all the information there, so I don't think there should be a problem.
Am I missing something?You know, I've got this problem again. I think the last time, I took out some special text characters - like the french e with an accent and the swedish o with a line through it, and then it worked. I hate to do that since it is an international site. And now I'm having this exception error again and I'm not sure why.
Any ideas of what I should look for? This time it is not an XML file created from a joined recordset - it's a simply recordset.
Very frustrating. -
XML dataset doesn't change in detail area
Thanks in advance for any help you might be able to lend...
My accordion layout has five panels all of which are using
different XML datasets. I have been wracking my brain to figure out
how to have multiple master data regions filter into one detail
region - I have one setup correctly, but when I change the focus on
the accordion menu, the other XML data is not displayed in the
detail region.
I understand why they do not populate, but I cannot figure
out what to include to have all data regions filter into the detail
area.
Thanks again in advance!
http://www.cateringlyons.com/menus.php"luke14free" <[email protected]> wrote in
message
news:f3bdm8$gsu$[email protected]..
> I am a new AJAX spry developer and i would like to ask
you a question.
> I have done a code that modifies the content of an xml
file after user
> writes
> something in a box. The code works(is written in php)
and my problem is
> that:
> the xml dataset in the page doesn't refresh. I mean if I
add something to
> the
> xml file the page isn't affected by the changes and
continues to display
> the
> old xml-data. I checked manually the xml file and it's
correctly writed
> and
> closed, and the file has the right permiossions. Can you
tell me why?
http://livedocs.adobe.com/en_US/Spry/1.4/WS95A48911-209C-4075-A90A-4FB06F6DAAA4.html
Massimo Foti, web-programmer for hire
Tools for ColdFusion and Dreamweaver developers:
http://www.massimocorner.com -
Spry xml datasets can't recognise images
Been trying all day to load a spry xml dataset with image
information into a table using the wizard. problem is, you can't
tell the wizard that the data in one of the columns is the path to
an image, so it sees it as a string and just sticks the path in the
table. I tried putting it in as html rather than string but really
I am firing into the dark here!
What have I missed?thanks for the reply. I found the issue in the path string,
along with having to edit the html tag directly, which I wasn't
expecting, being used to DW doing it all for me! I found a lot of
the answer here:
http://www.csupomona.edu/~llsoe/42101/css/sprytables.htm
At least it stopped me being scared of html! -
Currently when I try and add a SPRY XML Dataset and hit the Get Schema button I get "Unable to locate or parse the XML Source (-1,-1). I created the XML from the Export recordset to XML tool in the Developer Toolbox. I can't seem to figure out what I am missing. Anyone else having this problem as well. It use to work then I think my system did some update from Adobe and since has stopped working. Any assistance is greatly appreciated. Thanks.
Hello,
The error usually means that the XML source that you choose within Spry XML Data Set interface is not valid.
So you should check the XML source to see if it returns a valid XML.
Regards,
Ionut -
I am new to DW and have a question I am hoping someone will
answer. I am using Spry.Data.XMLDataSet found in SpryData.js. I
have it working correctly, but if I change the XML content and
attempt to reload the page using this data it does not show the
changes. I have declared a dsObj called dsXMLdata that the
XMLDataSet method loads. How can I cause the dsXMLdata to reload
from the file. I would assume this would happen each time the
Spry.Data.XMLDataSet method is called, but I never see my changes
unless I rename the file and read the newly named file.. Kind of a
PIA.
Thanks.,
PatI am brand new to Spry, and ran into the same problem. I
believe you will have the functionality you are looking for if you
use the subpaths command in your dataset declaration. Otherwise,
your XML dataset will be limited to the data nodes in the first
tier of the <root> node (ie. only channel) You can try code
like this:
var ds1 = new Spry.Data.XMLDataSet("test.xml", "root", {
subPaths: ["channel/data1","channel/data2"] });
then access through the tags {ds1::channel/data1} ....
If you download the prerelease 1.5 spry package it has the
API docs with samples. One of the samples is about nested XML data
structures and is a good source to find out what you can do.
Hope this helps
Josh -
Changes to xml dataset not showing up on webpage
Using spry, I added a spry:region to my home page that uses an xml dataset to post special announcements on the page. Since the people that maintain this are not technical I want to give them an easy way to post their announcement and the xml file makes a lot of sense. It will be easy for them to post their "School CLOSED today due to snow" announcement.
So the whole spry dataset works great except that when I update the xml file, the new content does not show up on the web page. I assume its something to do with cache. I did select the no cache option. If I delete the temp files from the browser I can see the changes. This is obviously a problem. I need the changes to appear on the website when the xml file is updated. Is there some way to force the webpage to recreate the dataset everytime the page is loaded? or some other work around that will do what we need?
You can see the page at www.tribecacommunityschool.com. At this moment there is a school closing announcement up. It may not be up tomorrow but the code will still be on the page if you want to view it.
Thanks for any help. I did see a post from 2007 that asked this same question and there were no responses. I'm hoping for better luck and a slightly faster turn around.Thanks for the help... This additional explanation on Phil_W's post gave me what I need and the refresh works great.
testxml.js
var dsData = new Spry.Data.XMLDataSet("testxml.xml?cache=" + (new Date()).valueOf(), "/data/info", {useCache:false, method:'GET'});
var dsOne = new Spry.Data.XMLDataSet("testxml.xml?cache=" + (new Date()).valueOf(), "/data/info/one", { subPaths: ["test" ], useCache:false, method:'GET'});
function RefreshMe()
var auctionxml = 'testxml.xml?cache=' + (new Date()).valueOf();
dsData.setURL(auctionxml);
dsData.loadData();
dsOne.setURL(auctionxml);
dsOne.loadData();
testxml.xml file -------
<?xml version="1.0" encoding="UTF-8"?>
<data>
<info id="1">
<one>
<test>test me sdfsdf</test>
</one>
</info>
</data>
html file----------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type='text/javascript' src="jquery.js"></script>
<script language="JavaScript" type="text/javascript" src="SpryAssets/xpath.js"></script>
<script language="JavaScript" type="text/javascript" src="SpryAssets/SpryData.js"></script>
<script language="JavaScript" type="text/javascript" src="SpryAssets/SpryEffects.js"></script>
<script language="JavaScript" type="text/javascript" src="testxml.js"></script>
</head>
<body >
<div class="SpryHiddenRegion" spry:region="dsOne">
<div id="test">{dsOne::test} </div>
</div>
<script language="JavaScript">
// Switch on Refresh of auction data
var AuctionInterval = 0;
AuctionInterval = setInterval ( 'RefreshMe()', 5000 );
</script>
</body>
</html> -
Passing a Spry XML Dataset to a function
I am very much a noob at this. How would I pass my XML dataset to a function so that the function would check a "date" field in the XML file and color the corresponding date cell in a YUI calendar? I have looked through the YUI Forums, but couldn't find any good examples. I am making a calendar of events that uses a calendar to filter the events in my XML file. I want the calendar to highlight the dates that have an event scheduled, so the users get a visual pointer to when events are scheduled. Here is my code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script src="SpryAssets/xpath.js" type="text/javascript"></script>
<script src="SpryAssets/SpryData.js" type="text/javascript"></script>
<script src="SpryAssets/SpryDataExtensions.js" type="text/javascript"></script>
<script src="yui/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
<script src="yui/2.6.0/build/calendar/calendar-min.js" type="text/javascript"></script>
<script src="SpryAssets/SpryDOMUtils.js" language="javascript" type="text/javascript"></script>
<script type="text/javascript">
<!--
var dsMDEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"});
var dsEvents = new Spry.Data.XMLDataSet("schedule.xml", "events/event", {sortOnLoad: "date", sortOrderOnLoad: "ascending"} );
dsEvents.setColumnType("date", "date");
dsEvents.setColumnType("@id", "number");var thisDate = new Date();
var todaysDate = mydateFormat(thisDate);
function pad(v)
return (v<10?"0"+v:v);
function mydateFormat(inDate)
var myData = inDate;
var gToday = new Date(myData);
var tToday = pad(gToday.getMonth()+1).toString() + "/" + pad(gToday.getDate()).toString() + "/" + gToday.getFullYear().toString();
return (tToday);
}//-->
</script>
<link href="yui/2.6.0/build/fonts/fonts-min.css" rel="stylesheet" type="text/css" />
<link href="yui/2.6.0/build/calendar/assets/skins/sam/calendar.css" rel="stylesheet" type="text/css" /><link href="SpryAssets/SpryMasterDetail.css" rel="stylesheet" type="text/css" />
</head><body>
<div id="Schedule">
<div id="calendarDiv"></div>
<script type="text/javascript">
// BeginWebWidget YUI_Calendar: yuicalendar1
YAHOO.namespace("calendar"); (function() {
var cn = document.body.className.toString();
if (cn.indexOf('yui-skin-sam') == -1) {
document.body.className += " yui-skin-sam";
YAHOO.calendar.init = function() {
YAHOO.calendar.cal1 = new YAHOO.widget.CalendarGroup("cal1", "CalendarDiv", {PAGES:3}); // The following event subscribers demonstrate how to handle
// YUI Calendar events, specifically when a date cell is
// selected and when it is unselected.
// See: http://developer.yahoo.com/yui/calendar/ for more
// information on the YUI Calendar's configurations and
// events.
// The YUI Calendar API cheatsheet can be found at:
// http://yuiblog.com/assets/pdf/cheatsheets/calendar.pdf
//--- begin event subscribers ---//
YAHOO.calendar.cal1.selectEvent.subscribe(selectHandler, YAHOO.calendar.cal1, true);
YAHOO.calendar.cal1.deselectEvent.subscribe(deselectHandler, YAHOO.calendar.cal1, true);
//--- end event subscribers ---//
function dateHighlightRenderer(workingDate, cell) {
var isHighlighted = false;
var date = workingDate.getMonth()+1 + "/" + workingDate.getDate() + "/" + workingDate.getFullYear();
/*if (rows["date"].search(date) != -1) {
isHighlighted = true;
if (date) {
isHighlighted = true;
if (isHighlighted) {
YAHOO.util.Dom.addClass(cell, this.Style.CSS_CELL_HIGHLIGHT4);
//YAHOO.calendar.cal1.addRenderer("11/14/2009, 11/1/2009, 11/29/2009, 11/30/2009", YAHOO.calendar.cal1.renderCellStyleHighlight1);
for (var i = 1; i <= 7; i++) {
// Attach to the Weekday, instead of individual dates/ranges, to improve performance.
YAHOO.calendar.cal1.addWeekdayRenderer(i, dateHighlightRenderer);
YAHOO.calendar.cal1.render();
var todayFilterFunc = function(dsMDEvents, row, rowNumber)
if (row["date"] >= todaysDate)
return row; // Return the row to keep it in the data set.
return null; // Return null to remove the row from the data set.
dsMDEvents.filter(todayFilterFunc);
} function selectHandler(event, data) {
// The JavaScript function subscribed to yuicalendar1. It is called when
// a date cell is selected.
// alert(event) will show an event type of "Select".
// alert(data) will show the selected date as [year, month, date].
var formattedDate = pad(data[0][0][1]) + "/" + pad(data[0][0][2]) + "/" + data[0][0][0];
var dateFilterFunc = function(dsMDEvents, row, rowNumber)
if (row["date"].search(formattedDate) != -1)
return row; // Return the row to keep it in the data set.
return null; // Return null to remove the row from the data set.
dsMDEvents.filter(dateFilterFunc); // Filter the rows in the data set.
}; function deselectHandler(event, data) {
// The JavaScript function subscribed to yuicalendar1. It is called when
// a selected date cell is unselected.
}; // Create the YUI Calendar when the HTML document is usable.
YAHOO.util.Event.onDOMReady(YAHOO.calendar.init);
// EndWebWidget YUI_Calendar: yuicalendar1
</script>
<div class="MasterDetail">
<div spry:region="dsMDEvents" class="MasterContainer">
<div class="MasterColumn" spry:repeat="dsMDEvents" spry:setrow="dsMDEvents" spry:hover="MasterColumnHover" spry:select="MasterColumnSelected">{date}<br />
{name}<br />
{starttime} - {endtime}</div>
</div>
<div spry:detailregion="dsMDEvents" class="DetailContainer">
<h2 class="DetailColumn">{name}</h2>
<p class="DetailColumn"><strong>Date:</strong> {date}<br />
<strong>Time:</strong> {starttime} - {endtime}</p>
<p class="DetailColumn"><strong>Where:</strong> {location}<br />
<strong>Type:</strong> {type}</p>
<p class="DetailColumn"><strong>Contact:</strong> {contact}</p>
</div>
<br style="clear:both" />
</div>
</div>
</body>
</html>
and here is a snipet of my xml file:
<?xml version="1.0" encoding="utf-8"?>
<events>
<event id="1">
<name>Dreamweaver CS4 Intermediate</name>
<date>10/15/2009</date>
<starttime>8:00 am</starttime>
<endtime>5:00 pm</endtime>
<location>Room 1</location>
<type>Training</type>
<contact>Contact 1</contact>
</event>
<event id="2">
<name>InDesign CS4 Advanced</name>
<date>11/14/2009</date>
<starttime>8:00 am</starttime>
<endtime>5:00 pm</endtime>
<location>Room 2</location>
<type>Training</type>
<contact>Contact 1</contact>
</event>
<event id="3">
<name>Flex CS4 Data Services</name>
<date>10/15/2009</date>
<starttime>1:00 pm</starttime>
<endtime>5:00 pm</endtime>
<location>Room 2</location>
<type>Meeting</type>
<contact>Contact 2</contact>
</event>
<event id="4">
<name>Another Dreamweaver CS4 Intermediate</name>
<date>11/30/2009</date>
<starttime>8:00 am</starttime>
<endtime>5:00 pm</endtime>
<location>Room 1</location>
<type>Training</type>
<contact>Contact 1</contact>
</event>
<event id="5">
<name>Another InDesign CS4 Advanced</name>
<date>11/29/2009</date>
<starttime>8:00 am</starttime>
<endtime>5:00 pm</endtime>
<location>Room 2</location>
<type>Training</type>
<contact>Contact 3</contact>
</event>
<event id="6">
<name>Another Flex CS4 Data Services</name>
<date>11/01/2009</date>
<starttime>1:00 pm</starttime>
<endtime>5:00 pm</endtime>
<location>Room 2</location>
<type>Meeting</type>
<contact>Contact 2</contact>
</event>
<event id="7">
<name>More Training</name>
<date>11/02/2009</date>
<starttime>8:00 am</starttime>
<endtime>10:00 am</endtime>
<location>Room 3</location>
<type>Training</type>
<contact>Contact 4</contact>
</event>
<event id="8">
<name>Another Training</name>
<date>10/25/2009</date>
<starttime>9:00 am</starttime>
<endtime>11:00 am</endtime>
<location>Room 3</location>
<type>Training</type>
<contact>Contact 4</contact>
</event>
<event id="9">
<name>Some More Training</name>
<date>12/02/2009</date>
<starttime>1:00 pm</starttime>
<endtime>3:00 pm</endtime>
<location>Room 3</location>
<type>Training</type>
<contact>Contact 4</contact>
</event>
</events>
The function "dateHighlightRenderer" is where I am running into the problem. How do I code this so that "dateHighlightRenderer" can read the "date" field in my XML file?I have tried the getData() function for this. However, I am not sure if I am using it right:
var d = dsMDEvents.getData();
for (var i = 0; i < d.length(); i++) {
var day = d[i]["date"];
YAHOO.calendar.cal1.addRenderer(day, dateHighlightRenderer);
When I run this for loop, my calendar will not appear on the page. Any suggestions? -
WIJ 20002 xml Parser Problem - Rich Client
Hi,
I have a problem with the rich client on a new installation:
Business Objects Enterprise XI 3.1 SP3 on Windows 2008 Standard.
If I connect with the rich client "import document"is disabled.
if I try to create a new document from the rich client it returns the error below (I used the rich client on two workstations):
WIJ 20002
Version: null
Analisi dello stack:
java.lang.RuntimeException: java.lang.RuntimeException: XML parser problem:
XMLJaxpParser.parse(): Element type "ABOUT_Patentnumbers" must be followed by either attribute specification, ">" or "/>".
at com.businessobjects.wp.xml.jaxp.XMLJaxpParser.parse (Unknown Source)
at.com.businessobjects.webi.richclient.XMLviaOccaRC.getServerConfiguration (Unknown Source)
Have you any solution?The fixpack 3.5 client resolves the problem.
-
Spry Menu Using Nested XML Dataset (Spry 1.6)
I have a vertical menu with a few items. One of which is
labeled Products which has submenus. I want to have that submenu
read from a Nested XML dataset. Using a single dataset for one
level in a menu is easy enough, but the subenu will have submenus.
Example Menu:
Home
Company
Products
|-- Product 1
|-- Item 1
|-- Item 2
|-- Item 3
|-- Product 2
|-- Item 1
|-- Item 2
|-- Product 3
|-- Item 1
|-- Item 2
|-- Item 3
|-- Item 4
|-- Product 4
|-- Item 1
|-- Item 2
|-- Product 5
I have been looking for an easy way to use the Spry Nested
XML Dataset to create the Product/Item menu. The number of Products
may vary as well as the number of Items in each Product submenu
(also, some Products may not have Items).
I already have an ASP page that creates the XML data from a
database.
Schema follows (XSD ):
<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="
http://www.w3.org/2001/XMLSchema">
<xsd:element name="products">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="product_type"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="type_name" maxOccurs="1"
type="xsd:string"/>
<xsd:element name="type_url" maxOccurs="1"
type="xsd:anyURI"/>
<xsd:element name="product_name"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item_name" maxOccurs="1"
type="xsd:string"/>
<xsd:element name="item_url" maxOccurs="1"
type="xsd:anyURI"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
I have been programming for 17 years but am new to Spry. If
this cannot be done easily with the Spry framework, I'll probably
wind up splitting the XML data into 2 files (Products and Items)
then writing a nested loop and call each by row, but then I have to
find out how Spry Datasets reference XML data. Figuring out how to
call rows from the XML data shouldn't be so bad, but this method
just seems like such a hassle for something that should be easy.
Pseudocode follows:
j=1
i=1 to TotalNumberProducts
display Product i from Products
ItemsExist=true
While ItemsExist
if j > TotalNumberItems | Item j is not for Product then
ItemsExist=false
else
display Item j from Items
j++
Wend
Next
Thanks in advance for any help or direction!That's exactly what I'm trying to do. However, I implemented
that code and the submenus won't appear. I suspect the submenus
aren't finding the field names from the Nested XML Dataset. The
first level of Product menus work great (this is a submenu of the
overall menu) and correctly identify products that do not have
submenus, so I know it's picking up the number of records in the
Nested Dataset correctly - it just won't display the data in the
next level of menu.
variable and script declarations:
<script src="SpryAssets/SpryMenuBar.js"
type="text/javascript"></script>
<script src="SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryData.js"
type="text/javascript"></script>
<script src="SpryAssets/SpryNestedXMLDataSet.js"
type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarVertical.css"
rel="stylesheet" type="text/css">
<script type="text/javascript">
<!--
var productMenuData = new
Spry.Data.XMLDataSet("products.asp", "products/product_type");
var productMenuDataItems = new
Spry.Data.NestedXMLDataSet(productMenuData, "product_name");
//-->
</script>
Code for menus:
<ul id="NavMenu" class="MenuBarVertical">
<li><a
href="index.html">Home</a></li>
<li><a
href="company.html">Company</a></li>
<li><a href="franco_giberti.html">Franco
Giberti</a></li>
<li><a class="MenuBarItemSubmenu"
href="products.asp">Products</a>
<ul spry:region="productMenuData
productMenuDataItems">
<li spry:repeat="productMenuData"><a
class="MenuBarItemSubmenu" href="{type_url}"
spry:if="{productMenuDataItems::ds_RowCount} !=
0">{type_name}</a> <a href="{type_url}"
spry:if="{productMenuDataItems::ds_RowCount} ==
0">{type_name}</a>
<ul spry:if="{productMenuDataItems::ds_RowCount} !=
0">
<li spry:repeat="productMenuDataItems"><a
href="{productMenuDataItems::item_url}">{productMenuDataItems::item_name}</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="contact.html">Contact Us</a>
<!-- end #sidebar1 -->
</li>
</ul>
XML:
<products
xsi:noNameSpaceSchemaLocation="products.xsd">
−
<product_type>
<type_name>Pasta Sauce</type_name>
<type_url>pt_2.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_3.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_4.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_5.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_6.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_7.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_8.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Olive Oil</type_name>
<type_url>pt_3.asp</type_url>
−
<product_name>
<item_name>Original</item_name>
<item_url>pn_9.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil</item_name>
<item_url>pn_10.asp</item_url>
</product_name>
−
<product_name>
<item_name>Herbs</item_name>
<item_url>pn_11.asp</item_url>
</product_name>
−
<product_name>
<item_name>Sun Dried Tomato</item_name>
<item_url>pn_12.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Spreads</type_name>
<type_url>pt_4.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_13.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_14.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_15.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_16.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_17.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_18.asp</item_url>
</product_name>
</product_type>
+
<product_type>
<type_name>Organic Grilled Vegetables</type_name>
<type_url>pt_5.asp</type_url>
−
<product_name>
<item_name>Putenesca</item_name>
<item_url>pn_19.asp</item_url>
</product_name>
−
<product_name>
<item_name>Arrabiata</item_name>
<item_url>pn_20.asp</item_url>
</product_name>
−
<product_name>
<item_name>Pesto</item_name>
<item_url>pn_21.asp</item_url>
</product_name>
−
<product_name>
<item_name>Basil and Tomato</item_name>
<item_url>pn_22.asp</item_url>
</product_name>
−
<product_name>
<item_name>Bolognese</item_name>
<item_url>pn_23.asp</item_url>
</product_name>
−
<product_name>
<item_name>Carboniera</item_name>
<item_url>pn_24.asp</item_url>
</product_name>
</product_type>
−
<product_type>
<type_name>Truffle Products</type_name>
<type_url>pt_6.asp</type_url>
</product_type>
</products>
Any further guidance would be very much appreciated! -
I'm exporting a xml document that I'm creating dynamically in my application.
I'm having the following problems (working with 30M.2).
1)
It's not possible to edit a DTD (or creating one run time) so I have to write a
template doc XML to have it.
I'm afraid that this is a costraint on the DOM1 so ...
2)
Once I complete the construction of the doc, I need to write it down (let's say
on a file, but could be also in memory to send it on http).
When I write it (using exportdocument function) I just find the root element
with all it's children, no haeder (<?xml version="1.0" ?><!DOCUMENT ...>) so I
cannot have the dtd information on the stream, and cannot enforce validation of
the doc when someone read it afterwards.
I admit I'm new of the subject, but or I miss something or something is wrong:
having trouble to get a dtd and not being able to code it's information.
Anyone has some ideas?
TIA
LucaI'm interested in DTDs. For example in the reported situation, why, if you
know you've created a valid XML document would you want to give a DTD to
someone at the other end? If someone has a DTD at the other end and want to
use it to validate your XML then fine but if you create the XML and are
controlling the format then wouldn't they just assume the XML correct if the
DTD wasn't being controlled by a 3rd party or themselves?
DTDs don't help you create a document but just validate it, I'd thought. If
there is more to DTDs I'd appreciate if someone felt like ellaborating.
Thanks.
Matthew Middleton
OrYx Software Consultant
Lawpoint Pty. Limited
A Solution 6 Company
Ph: +61 2 9239 4972
Fax: +61 2 9239 4900
E-mail matthewmwriteme.com
----- Original Message -----
From: Luca Gioppo <Luca.GioppoCSI.IT>
To: <forte-userslists.xpedior.com>
Sent: Tuesday, August 08, 2000 8:24 PM
Subject: (forte-users) XML - ExportDocument problem
>
>
I'm exporting a xml document that I'm creating dynamically in myapplication.
I'm having the following problems (working with 30M.2).
1)
It's not possible to edit a DTD (or creating one run time) so I have towrite a
template doc XML to have it.
I'm afraid that this is a costraint on the DOM1 so ...
2)
Once I complete the construction of the doc, I need to write it down(let's say
on a file, but could be also in memory to send it on http).
When I write it (using exportdocument function) I just find the rootelement
with all it's children, no haeder (<?xml version="1.0" ?><!DOCUMENT ...>)so I
cannot have the dtd information on the stream, and cannot enforcevalidation of
the doc when someone read it afterwards.
I admit I'm new of the subject, but or I miss something or something iswrong:
having trouble to get a dtd and not being able to code it's information.
Anyone has some ideas?
TIA
Luca
For the archives, go to: http://lists.xpedior.com/forte-users and use
the login: forte and the password: archive. To unsubscribe, send in a new
email the word: 'Unsubscribe' to: forte-users-requestlists.xpedior.com -
How to show an entry with specific ID from spry xml dataset?
I have a spry xml dataset, can I show only one record
specified by, say, unique ID?yeah, I first posted this one, then found out that my other
message was replied:) -
I want to generate a xml file with text from a txt file but i have problems with special characters such as &, <... I'd like to know if there�s any class or library to filter the text in order to generate my xml without problems.
Thank you.Use JDOM to generate your XML. It will worry about escaping issues for you.
Here's a (probably rather inelegant) example for you to play around with:
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.*;
public class DateBoom {
public static void main(String[] args)
throws Exception
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
String dodgyText = "< & '";
Document document = builder.newDocument();
Element root = document.createElement("root");
root.setAttribute("dodgy",dodgyText);
document.appendChild(root);
Element child = document.createElement("child");
root.appendChild(child);
child.appendChild(document.createTextNode(dodgyText));
Transformer transform = TransformerFactory.newInstance().newTransformer();
Source source = new DOMSource(document);
Result result = new StreamResult(System.out);
transform.transform(source,result);
}Your alternative is to use something like String regular expressions (regex) to do this manually, but the XML oriented libraries will catch more corner cases than you're likely to anticipate, making them more reliable. -
Nested XML dataset: can't see items
Hi,
I'm a newbie and started using Spry 1.5 because it looks
promising and helps me avoid getting into javascript for the
moment. My XML data looks like
<lanternsandsconces>
<lantern>
<name>1</name>
<size>
<description>Standard 1</description>
</size>
<size>
<description>Standard 2</description>
</size>
</lantern>
<lantern>
<name>2</name>
<size>
<description>Standard 1</description>
</size>
</lantern>
</lanternsandsconces>
I am trying to access the data using Nested XML datasets. I
tried to mimic your example on
http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html
with my XML data. Here's my html:
<script src="../SpryAssets/xpath.js"
type="text/javascript"></script>
<script src="../SpryAssets/SpryData.js"
type="text/javascript"></script>
<script src="../SpryAssets/SpryXMLNestedDataSet.js"
type="text/javascript"></script>
<script type="text/javascript">
var dsTest = new
Spry.Data.XMLDataSet("../XML/productsnested1.xml","lanternsandsconces/lantern");
var dsTestNest = new Spry.Data.NestedXMLDataSet(dsTest,
"size");
</script>
<div>
<table class="dataTable">
<tr>
<th>lantern</th>
<th>sizes</th>
</tr>
<tr>
<td spry:region="dsTest">
<ul spry:repeatchildren="dsTest" spry:choose="">
<li spry:when="{ds_CurrentRowNumber} == {ds_RowNumber}"
spry:setrow="dsTest" spry:select="select" spry:hover="hover"
spry:selected="">{dsTest::name}</li>
<li spry:default="" spry:setrow="dsTest"
spry:select="select"
spry:hover="hover">{dsTest::name}</li>
</ul>
</td>
<td spry:region="dsTestNest">
<ul spry:repeatchildren="dsTestNest">
<li>{dsTestNest::description}</li>
</ul>
</td>
</tr>
</table>
</div>
I would appreciate any help on getting this to work .... As
you can see it is almost a straight copy and paste from the
example. I have the proper scripts copied into the SpryAssets
directory.
Cheers,
HuubAh,
excellent. That indeed works. For future reference: this line
I actually copied from
http://livedocs.adobe.com/en_US/Spry/SDG/help.html?content=WSC0DC5D76-B6F1-41ae-9E59-586A1 19AA7C5.html
that's where the bug originated. At
http://labs.adobe.com/technologies/spry/samples/data_region/NestedXMLDataSample.html
it is correct.
thanks a bunch, JV.
Cheers,
Huub
Maybe you are looking for
-
Music on iPod but not under Artists
I have recently put on some new music to my iPod (now 1year old) and have noticed it appears under the "recently added" playlist, and the album will appear under "albums", however, the artist will not appear under "artists". It seems to occur only wi
-
Is the Speaker Wire Loose?
I thought the soundcard was fried for the past few weeks, but the sound came back miraculously today, but then would get really loud and distorted before konking out I noticed that knocking or tapping on top of the laptop cover where the soundcard is
-
How to design a registration page
Hi, I want to design a registration page for oracle EBS R12. Can you guide me to step by step docs for that? Thanks
-
I've been getting this error everytime I try to upload photos to the Facebook publishing service has anyone encountered this before? upload through flicker is fine though
-
JTree setSelectionPaths problem
Hi, I am searching my jTree and the value that are return by the search are stored. However I will like to be able to select all the nodes that match the criteria. I can select one node using setSelectedPath(node.getPath), however I would like to use