Using spry to display XML data to an HTML page in DreamweaverCS3

Source: Internet
Author: User
Tags html page xpath dreamweaver
dreamweaver|xml| Data | show

Use spry to easily display XML data to an HTML page

With an in-depth study of the integration of Spry features into Dreamweavse CS3, some of the functional modules of the spry framework are understood and mastered, with the ability to easily display XML data to an HTML page through Dreamweavse CS3 visualization.

Of course, when it comes to how to insert XML data into an HTML page, it's often an immediate thought of data island. Like what:

<xml id= "Blog" >
<blog>
<title>test xml</title>
<atime>2007/5/1</atime>
<cont>content is ...</cont>
</blog>
</xml>

<table datasrc= "#blog" width= "100%" >
<tr>
<td>title</td>
<td>atime</td>
<td>content</td>
</tr>
<tr>
<td><span datafld= "title" ></span></td>
<td><span datafld= "Atime" ></span></td>
<td><span datafld= "cont" ></span></td>
</tr>
</table>

Of course, you can also use XSLT to display XML to a page, but now with the Dreamweaver CS3 integrated spry feature, it's easy to embed XML data into HTML, while also making XML data reordering and timed data updates and no refresh displays. Standard spry AJAX applications.

1,xml data file: Site.xml

<?xml version= "1.0" encoding= "Utf-8"
<mysite>
    <site>
        <name>cnbruce</name>
         <url>http://www.cnbruce.com</url>
        <desc>cnbruce ' s blog</desc>
        <atime>2003</ Atime>
    </site>
    <site>
         <name>dw8</name>
        <url>http:// Www.dw8.cn</url>
        <desc>about Dreamweaver and web</ Desc>
        <atime>2006</atime>
    </site>
    <site>
        <name>164 </name&gT
        <url>http://www.164.cc</url>
         <desc>music blog</desc>
        < Atime>2005</atime>
    </site>
</mysite>

2, add "Spry XML Date Set" in Dreamweaver CS3

3, open the dialog box to browse to select an XML data source , and then click "Get Schema" to extract the XML node display, in "Row element" Select the node is automatically obtained "XPath" (Note: When you select a different XPath, The information that can eventually be displayed is not the same), in the "Sort" column, select a sorted reference node, such as a descending or ascending selection time, in which you can set up an automatic update of the XML data and a display without a refresh mechanism.

4, once the XML data is bound, the XML data (loop) can be displayed in the HTML page.

In general, it's easy to get started, and looking at code in the Code view is concise, and all of the work is done with the spry framework.

Test Address: http://www.cnbruce.com/test/spry/site.html

However, the current issues and considerations are:
1, the data source for the Chinese XML node is not very well supported
2,xml hyperlinks in HTML don't seem to be open.
3, you need to solve the problem of remote XML data source, which is similar to the function of RSS aggregation







Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.