See a few Good articles today: obviously affixed to this, I do not know whether to join the elite area: use Asp+xml to create a message book-1

Source: Internet
Author: User
Tags join
asp+|xml| essence use Asp+xml to build message book-1
The Yesky of the harsh son

--------------------------------------------------------------------------------


First, the reader guide

The Reader guide helps you master the outline of this article. Lest you read most of it to understand this article is not suitable for you, causing you visual pollution.

If you're writing a program with Asp+xml, or you're learning XML, it's worth seeing.

Read the knowledge required in this article, have a basic understanding of the ASP, a basic understanding of XML and DOM, if you do not understand then you by learning this article can basically
Holds the Asp+xml and DOM applications, and can write from the more advanced Asp+xml program according to Ben Wen van.

Ii. Basic Ideas

The idea of this paper is to use ASP and DOM to read and store XML data, and use XML data to store message information to achieve the work of storing data in the same database.
Yes.

Third, the advantages of the XML message book

Perhaps you will ask to use asp+txt text can also achieve the function that does not use the database to actually leave a message, good indeed can do, and the net also has a lot of such stay
This free download, but here I want to talk about the advantages of asp+xml.

1, xml+asp faster than asp+txt speed. You may also find that when the TXT file is very rare, the speed is surprisingly fast, but with the addition of message txt text
Getting bigger, but the speed is surprisingly slow this is the weakness of asp+txt. Of course I can't say asp+xml must be surprisingly fast, but rather than as
P+txt is a lot faster, of course, with the increase in message information XML text increased speed also dropped quickly, but compared to TXT is still a lot better
(This can be shown from the was test that readers can test themselves), of course, asp+xml is not as good as the database, because the database for the query made a special excellent
, and XML is just plain text, in the ASP set up to be like to read all the XML data into memory, if the amount of data can be imagined slowed down.
Then you might ask me, when do I use relational databases to store data, and when do I store data in XML? I'm also here to mention that when data is compared
It's more appropriate to use XML data for complex random rates, and that's when you're going to read the data on different operating systems.
Out. Do not use XML files to store data if you are not in a critical moment or do not support the database's space.
2, easy to read the XML data, txt text is more difficult to operate, we have to read a line of judgment, but also very multi-functional can not be, can only be edited
Simple message book, and the XML data is different, using DOM can easily access each node, rather than txt those annoying readline ()
Witeline (), we can add at will delete update a certain we are interested in the node, using ASP or JS or data island can easily actually on this
Point, of course I'm here. Consider compatibility, use ASP to read XML data, and do not use data island to read node data (because only IE5 above version
Support Data island Technology and use ASP to actually do not exist these ask because the customer gets the HTML file.

3, the XML data Kua operating system, as long as we store this data as XML so that the data can be He Ki it language or system recognized, without doing
What changes should be made. TXT obviously does not have these performance. For example, our message on the Internet can be directly converted into a WAP format on the phone to display.

IV. create an XML file to store message information (list.xml)
We do not intend to use DTDs here, because we are the XML data that we have compiled and tested, so we do not need a DTD to validate it (if you
This interest of course can add a this does not affect the operation of the program. Now let's take a look at the basics of creating a message book.

0, Message ID number--defined as <id>

1, user name US--defined as <username>

2, from there--defined as <fromwhere>

3, message time set-the meaning of the <Posttime>

4, User homepage set-righteousness is
5, the user's mailbox--defined as <email>

6, message content set-the meaning of the <text>

Of course, the above is not necessary to the reader can name and add and subtract related tags, put them together to get the List.xml file

<?xml version= "1.0" encoding= "gb2312"?
<site>
<NewList>
<list>
<id> 1 </id>
<username> Harsh child </username>
<fromwhere> Guangzhou, China </fromwhere>
<Posttime> 01-4-23 18:26:56 </Posttime>
<email> lucaihui@cmmail.com </email>
<text> This is my first XML file </text>
</list>
</NewList>
</site>


Note: You must add encoding= "gb2312" otherwise the error will be invalid because the XML does not support Chinese by default. <site> to root node <NewList>
The <ist> is a child node. I don't have much to say about the document, so we should see it. The next step is how we can show it.



Related Article

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.