Home >Web Front-end >JS Tutorial >Problem solving method combining xml and javascript_javascript skills

Problem solving method combining xml and javascript_javascript skills

WBOY
WBOYOriginal
2016-05-16 19:16:101111browse

我想把html里面的title 动态绑定到一个xml 
没成功 help me ,pls 
如下 
 
 
 
 
 
Straight Talk About Computersyyyyyyyyyy 
72-80088-005 
 
 
Straight Talk About Computersyyyyyyyyyy 
72-80088-005 
 
 
 
 
 
 
 
 
 
 
 

 
 
Title ISBN 
 
 

 
 
 
 
 
 

 
  
 
 
书名 出版号 
 
 
 
 
 
 
 

 

myXML.xml 如下,其实这个没用,只不过为了完整性。

复制代码 代码如下:

  
  
  
计算机技术  
72-80088-005  
  
  
电工技术  
72-80081-082  
  
  
计算机软件技术  
72-80088-005  
  
  
计算机修理技术  
72-80081-082  
  
 

xmldso 是一个 XML DOM 对象,访问的时候要使用 DOM API。这样写: 
复制代码 代码如下:

var books = xmldso.selectSingleNode("booklist").selectNodes("book");
for(var i=0; i alert(books [i].selectSingleNode("title").text);
}
I would also like to say a few words about xmldso. I once worked on a project. The early stage was done by a few talented people in Taiwan. MVC, the following is my summary of the project:

XXX Framework:
XXX is the MVC pattern used. Data, control and view are separated from each other. JSP is responsible for the view, Servlet is responsible for the control, and DataModule is responsible for the storage of data. Take the
Model part:
Advantages: You can use event listener to write business logic, visual management, especially supports master-detail (master-sub table structure), look-up (search, making its function equivalent to that in the database) View), format (formatting), etc.
Disadvantages: Company employees must be familiar with DataModule. DataModule is not a mainstream technology, and not many people can use it - especially Java programmers.
The IDE generates a large amount of code for the Datamodule, but it also reduces a large number of SQL statements. During the operation of the system, multiple tables often need to be operated at the same time. In order to ensure the integrity of the data and the reliable execution of complex operations, DataModule automatically performs transaction processing, reducing the development tasks of programmers.
Control part:
Advantages:
Defining system external behavior through pd.xml, such as adding, modifying, deleting, querying, including settings Permissions (not currently implemented, but already reflected in the design), etc.
Convert user operations into datamodule operations.
Choose the appropriate view for display.

View part:
Advantages:
1): Front-end functions (onclick, onfocus, onblue, onchange), using xslt, which reduces a lot of jsp Code.
2): Display uses XML-DSO, IE automatically performs data binding.
Disadvantages:
1): Must use IE6. Other systems will not run properly.
2 ): Due to the use of XML-DSO, the requirements for programmers are very high.
3): Since many detections and calculations are performed on the client, the so-called "fat client" is formed, and the result is: concentrated functions , not conducive to updates and maintenance.

Process
1): The client sends a request request to the server.
2): The server receives the request through the control Servlet, parses the request, and assigns it to the appropriate Business Object
3) The controller passes some necessary request information to DataModule
4): Business Object updates (add, modify, delete, etc.) Model, Model synchronizes DataBase
5): Controller executes Jsp Page, the execution results are temporarily stored.
6): Model information is packaged into xml data
1): The client sends a request request to the server.
2): The server receives the request through the control Servlet, By parsing the request, assign it to the appropriate Business Object
3) The controller passes some necessary request information to the DataModule
4): Business Object updates (add, modify, delete, etc.) Model, Model synchronizes DataBase
5): The controller executes the Jsp page, and the execution results are temporarily stored.
6): The Model information is packaged into xml data
7): Combine the xml data with the execution results of the Jsp page, and respond to the client together .

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:A good function that can detect multiple browsers and other functions_javascript skillsNext article:A good function that can detect multiple browsers and other functions_javascript skills

Related articles

See more