Website? Xml? My thoughts.

Source: Internet
Author: User
Tags format end expression final variables parent directory variable dreamweaver
Xml

1, I use HTML to design

Once I thought I was quite special, I like to use Notepad to write very simple and simple HTML. Also, the first tutorial I read about Web pages is a tutorial that teaches you But for a long time, I still feel quite tired. Because when I write code is to rely on their own brain to imagine what the final appearance will be, so sometimes I still like to use Dreamweaver such tools. It is no wonder that those who see the resulting tool will have so many users, because the time to write directly to see the final rendering. When writing code, if you encounter important content, I will use the <font> such labels deliberately to change the appearance. When you encounter the contents of a list, you will use a label like <ul> to produce 1234 labels, or dots. In fact, sometimes feel that HTML is very simple, because the number of tags is very limited.

2, I use the HTML table

The HTML table is a very interesting thing. When you encounter a list of things, if there is no header and is a column, you may use <ol> such a single-column. If you have two columns, you may be using <table>. And it's not very complicated to use.,<tr> is a row,<td>. There are, of course, many different kinds of methods. The basic is to divide the square, and then put things. The interesting thing about tables is that you use forms when you design something like that. Although there is no meaningful correlation between the contents of each cell. Unlike your transcript list, the math score is one column and the language score is one. Using a table in a form is just for the final layout problem. Use the cell to position the components in the form. Later, the layout of the table used the layout of the entire page, and the more complex, the table plus table. People who have directly caused me to write code like this can't be modified to do this kind of page. At one point it made me sad to think that the world was Dreamweaver by a tool like this, because only by using what you see and what you can do to design such a rich homepage.

3, I also used CSS

CSS is something that excites me. I admit this. I used to dream that when I wrote a page, I just had to specify the class for each piece of content. In the future to change the appearance of the Web page just need to change the CSS can be. And CSS can be embedded or external with <link> links. I would like to change the content of the Web site CSS can be changed. and CSS and @import, using it I can also put a style.css in each directory of the site, and then use @import contains the site's style sheet. So that every page doesn't have to. Such a directory selector selects the style sheet in the parent directory. This feature really excites me. My dream is getting clearer that one day my web pages can easily change their appearance, and I don't have to use labels like <font> on my own when I write them.

4, JavaScript is also a curious thing

I believe that the development of the network is not as advanced as now when the design of the Web page friends, must be very familiar with all kinds of javascript. such as the stars following the mouse, the horse lamp and things like that. JavaScript is designed to achieve a certain interaction between the client. JavaScript is able to interact because it can manipulate the HTML pages you see through the DOM, and you can get your input through the event attributes in the HTML element. Because JavaScript can change HTML pages through the DOM. This nature also let me excited for a long time. For example, Leoboard's latest post is the message that links to a CGI via a <script> link, which produces a JS script that writes a section of HTML code through the document's function. That is, JavaScript can "dynamically" generate HTML code. Because of this function of JavaScript, I began to dream again. Hopefully the entire site will be made up of JavaScript that contains each other. I write my content in JavaScript variables and then write the content in a certain template style to the final HTML output through a combination of rules through the DOM function.

5, and then smell the CSS

When I first heard of CSS, maybe it was the time of Css1. Only know that CSS can set the appearance of certain elements, such as fonts Ah, blank or something. About the CSS layout functions are not known. The first time to do the dream of CSS, in fact, because the HTML to the layout control, had to use a lot of table this reason to burst. So when I know that the function of CSS is very powerful, you can do a variety of layout control, and then began to dream. Put the content according to its nature to some <div class= "..." > such tags, with different CSS style sheets, you can position these div to the different parts of the page, and the display is not the same. So I can write HTML in any order, just the content. And CSS will be based on your description of the content (class is what) the content of the positioning layout and display. So, the CSS that I used to know only separates the content and the display of the elements, but the position of the element is related to the position in the source code. And now know the CSS, can let the element to mind their own things, tell CSS what they are (class is what), no longer consider their position in the document. Does this not accomplish the separation of content and performance? is not that I wait to write the page with Notepad web designer pursuit of it?

6, content and appearance separation

I believe this sentence many people have heard, dreamed of. My dreams are blurred and clear, and I have been thinking that one day I can just write down what I want to convey, and let the other people come and give me a layout that will give me a look. It is a Dream. We talk about this from the perspective of a web designer and from the perspective of an ordinary web designer. Do not put any middleware, Application server What program master relish the term to press "we". Why to separate the content from the appearance I believe many people have their own experience. My experience is very simple. When I was writing HTML myself, I had confidence in my content, I knew what I was going to say, I had content. But I have no information on how to make a layout, I want to let others, or myself, later to typesetting the content. But the thing is very disappointing, I basically only have two countermeasures. The format of the content can be simply no longer simple, just the linear arrangement of the most basic elements of HTML. In addition to <p> is <p> such a page, simple can not be simple. or design a very good-looking, very complex page. I manually paste the content into the template of the page. If there are many similar pages, make sure they are the same style. If each page also has links to other pages, such as the previous page, the next page, and so on, it is a nightmare. Separating the content from the look, it became my 16-year-old dream.

7, perl,php,asp

I am quite frank, I have never used JSP, I do not like the Java provided by those things (please do not scold me shallow, I know their business value, but now only to say that the web design). In order, I've used three of these network scripts. Perl was the first web script I ever contacted, and it was usually the name of the CGI. Later I have encountered PHP, the last is the ASP. Here I just talk about the problem of Web pages, do not involve these network scripts how to achieve network interaction. It's just a web script that says how they can separate the content from the look. And these three kinds of access to the file, access to the database, the use of templates, the production of HTML output stages and modules are different, but the same principle, the method is similar, so generally known as network script. Web scripting is something that excites me, and the same as engine drives many of the Web sites that are now running, such as the classic lamp combination. Their key point is the ability to generate HTML output. Because HTML is no longer your own handwriting, you can change the output of HTML without having to pass your hand, which gives you flexibility. In order for the article to be able to divide more sections, I look in the order of my own understanding the network script uses

8, network scripts and files

I first saw the use of web scripts, a CGI program such as Leoboard, which uses text as the storage medium for data. The source of the data is text, and then the Perl program in CGI parses the text, and then the result of the parsing can be put into the variable and finally the output of the HTML. This is through the CGI program as an intermediary, the content of the text into the HTML.

9, network scripts and databases

Then I saw the combination of Web scripts and databases. The classic collocation has Php+mysql and asp+access, I have been useful, but it is very simple. The benefits of storing data in a database are certainly great, and professionals can have a lot of business and other terms to describe their benefits. However, it is obvious that the methods of storage and acquisition are standardized, through SQL. The use of text as a storage medium, file format and parsing, as well as file integrity, fault-tolerant these require the network scripting designers themselves to control, although very free, but more is tired. Similarly, a script has a format of its own, much waste. It takes a lot of trouble to change the forum program.

10, network Scripts and templates

I remember when I was learning ASP, a lot of articles is so introduced. ASP can be mixed in HTML code, it is convenient to use. When I use Perl CGI, many programs use the $xxx template to do HTML output. At this time, I just want who's better? Template I still quite appreciate it. The initial stage of the template is a lot of the previous CGI Web article program, in the HTML in the name of Perl variable, and then the final output to make a replacement. Now the template is certainly a lot more complex, a lot of theory. However, one thing we can see is that templates do "separate business logic from performance logic". A generic template is associated with a script by a variable or array that knows the name in two ways. The script then stores the contents in these variables in advance, and the template then extracts the contents of the variables and arrays into the HTML. Because most of the templates are made up of HTML, it's more appropriate to design for designers. and the task of the script is only to work from the database or text, such as the data source to take out the content, do some processing, and then into the variable. At the very least, let the scripting programmers avoid considering the final appearance issues.

11, the era of network scripting

We are now basically in an era where most of the pages are not hand-written HTML. Instead, it is generated dynamically by network scripts. The method steps are similar: Data source + Network script + template = page. It seems that the story has come to an end. Because the dream has come true. Using the database to store data, templates to control the display, network scripts to do some computing and communication work, the content and appearance of the separation of the dream has been achieved. And, now a lot of ready-made programs, some CMS (Content management System), you directly installed on the server, you can enjoy its convenience. But we have a lot more to choose from.

12, the stage of XML

XML should not be something unfamiliar. If you don't know, you probably haven't cared about web design or the computer industry for a long time. The benefits of XML, the strengths, have been said to be rotten. I will not say more.
I divide XML into two categories: XML as a data or document, and functional XML. This classification is my own, functional XML refers to html,svg,mathml these. Maybe svg something you don't understand, but at least HTML you know. You should have heard about the idea that HTML is also XML. Why is it that I am speaking of HTML as functional XML? Because if you're a browser, it knows HTML, and it can display the content of HTML tags. If it is a generic XML, it does not recognize, if it is IE will call an internal display of XML template to show it, but some browsers will not. That is, the content element of a generic XML is not known to the browser, and the HTML element is of particular interest to the browser. In the same way, SVG XML is the same, although the standard is still in development, the browser to its support requires some plug-ins. However, the basic structure of SVG will not change anything, it is through the tag, through the browser to generate two-dimensional images. The key is that browsers recognize the elements in SVG, know what it means, and can make a display.
Naturally, XML, which has no special meaning for browsers, is a document data type. This method of dividing XML into document-centric and data-centric is very common. On this topic, I continue to say later.

13, HTML as a functional XML

I now use HTML entirely as a language of expression, and its only function is to display the content. That is, I give up the dream of expressing content in HTML completely. HTML is a functional XML that is designed to be displayed by browsers. To separate content from performance, I just want to convert from another data source to HTML. Is that CSS redundant? Of course not, the purpose of CSS is to help HTML better express how to show this requirement. That is xhtml+css common expression of a purpose, the appearance of the layout of the page. Their purpose is the same, not the HTML expression I used to imagine, CSS to express the appearance. and the existence of CSS, can express more accurate and richer content, and more concise than table layout.

14, XML as the source of HTML

After I give up the idea of HTML to express the content of a Web page, it's natural to think of XML as the source of data for HTML. But this is not a very common practice. More often, use the database, use the file and then use the network script to extract, and then perhaps through a template, directly generate HTML. Where there is no XML location, do you need XML in the process of producing HTML?
Now that the problem is clear, HTML is all about being a language of expression. The focus is on where the HTML comes from. The pragmatic approach is to respect existing solutions, and they can do well. Here is just a few personal insights into what the XML can do in the process of generating HTML.

15. XML generates HTML directly

This may be the first idea that many people think of in their minds. Use XSLT to transform XML into HTML. And in this, I will at the end of the article, give me a personal comprehensive idea.
I think using XML to generate HTML is mainly used in small, purely published situations (such as personal homepage), because it's not perfect for updating and deleting XML files. And even the use of XML databases, can not be competent for large occasions. and XML is more of an intermediate data

16, have the database to generate XML and then generate HTML

This may be a good plan. Just now it seems that there are some superfluous. Because the Web script extracts the content from the database, it generates HTML directly, or it generates HTML by calling a template. If there is more than one process of generating XML, it is necessary to write XSLT to produce HTML.

17, XML and Database

Naturally, a discussion extends to "XML and database, which one?" "。 In fact, this problem has become, I think that the development of XML is immature. XML has its structural and functional advantages, but it also brings a great degree of complexity. Querying for XML is much more complex than a simple database query. In the same way, XML has a much stronger expressiveness. Also related to the two uses of XML, XML can be used as a data-centric, such as a customer order for a Web site. This is consistent with the characteristics of relational databases, where the entries for each table are fixed and the data is similar to duplicates. XML can also be used as a center for writing documents, such as when you write an article, using XML to mark the article. This makes the position of the tag appear, and the context becomes very important.
So it's hard to answer the question of where XML is needed in any situation, and in what context. At least, with the refinement of XML technology and the mastery of more and more people, XML will be used more and more in its suitable situations.

18. XML and Web site

I think it's hard to say if it's just a generalities XML and database. But if we narrow the scope of the discussion to the website, I think it is easy to get the answer. For interactive occasions, such as forums, where data is often updated, XML is not appropriate. XML is a good choice for publishing situations, such as the article system. Of course, also consider whether the query is convenient. and XML is suitable to describe loose information, such as webmaster information such as data stored in the database is obviously overkill, and put in the XML is more appropriate. Therefore, I personally think that if it is a website of this nature, the use of XML is very appropriate.

19, the use of XML in the personal home page

The personal homepage is generally unable to buy the kind of server that has the network script support, let alone the database, this is from the real environment restriction. Personal homepage of the data is generally more loose and messy, and more documents, more suitable for XML to describe, this is the need to display.
So combined with these two points, for the General Personal homepage Webmaster, such a combination scheme is very good:
1, using XML to describe the site data, using XSLT to do the conversion
2, sign up for a free message board
3, sign up for a free blog
This way you need only one HTML space, while the content and appearance can be separated, at least for me is the realization of a dream.

20, the final implementation of guidance

This is purely a personal opinion, and the technical threshold is relatively high, it is estimated that no one will adopt.
First step:
Describe the content of your site. It is also your freedom to describe what is entirely your freedom, and to use something like DocBook to describe your article. The description should be distributed among a number of XML files, using Xinclude technology, that is, using a label such as <xi:include href= ' ... xml '/> to cascade all the XML, and ultimately a site.xml. When you find Site.xml, you find the content of your entire site.
You can simply use an element to record the location of the file without Xinclude, and then it is possible to read it in XSLT using the document function.
Step Two:
Describe the structure of your site, which is the information of the page. This is what I do with sitemap.xsl. The end result is a sitemap.xml. It's made up of elements like this:
<page name= "Article1" template= "article.xsl" output= "article1.html" param= "1"/>
This has two very important roles, one of which is to enable automated tools to extract content from generated page information and automatically invoke the XSLT processor to compile the site. The second is the ability to index pages to other pages, such as all the other articles in the category that you want to link to in an article's page, and you can provide a sitemap.xml of what pages are doing, such as what the category belongs to. The page's XSL can then be based on this information in Sitemap.xml, then find the pages and eventually write the hyperlinks.
Step Three:
Design XSLT for each page. There are two inputs to XSLT, one is Site.xml, and the other is sitemap.xml. Get content from Site.xml and get the location of other pages from Sitemap.xml.
Fourth Step:
Use your favorite scripting tools (Setup is Xslt+bat) to automate the completion of the entire station's compilation work. You can also provide options to choose what pages to compile.
Fifth Step:
You can also write a tool yourself to implement the new and old FTP upload work.

OK, my thinking about the technology of web design is almost over.
PS: Very classic, each learning the experience of the web of the enrichment! Unfortunately, I still can't fully understand!! ~~
In the effort to ...



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.