Flat document indexing solution (based on XML and XSLT)

Source: Internet
Author: User
Tags xslt

In daily use of enterprise information systems, some flat files are often processed. Some may be uploaded to a uniform Document Server for management through the website platform, and some may have specialized document management application systems. When using these systems, you often need to add ancillary information of some documents, such as uploading staff, uploading time, and object usage.

Although professional document systems make document management very simple and efficient, some people still need to export the commonly used flat documents to a local folder for viewing and management. However, if only these files are exported, the ancillary information of one file will be lost, which may cause trouble for query. It is too troublesome to develop an application to read the relevant information from the document system, and it has high requirements on the use environment, so it cannot be browsed or accessed offline.

Based on the above problems, from the perspective of requirements, the customer hopes to have a good user interface to view the relevant information of the document. However, it is recommended that you do not need to install any software or have any special requirements on the running environment. You also need to be able to search for and locate specific files on the content.

Next, let's talk about the solution. We all know that XML is a language used to describe formatted data. We can store the ancillary information of a document in a defined format. The document system only needs to export according to the defined XML format when exporting. (Development may be required for different systems ). The following is an example of XML.

<Documents BeginTime = "2009.1" EndTime = "2009.12">
<Document Level = "normal">
<Title> Gary's project document </Title>
<Author Name = "Gary Zhang" Email = cbcye@live.com SendTime = "2009-3-1 10:10:00"/>
<File Uri = "Documents \ 01 \ cbcye00002009document .zip" Name = "cbcye00002009document .zip" Size = "1111"/>
<Description> from: www.cbcye.com | cbcye.cnblogs.com | www.quicklearn.cn </Description>
</Document>
</Documents>

 

When XML is ready, it is the problem of display. Of course, you can develop programs such as WinForm for display. However, the simpler method (which may be more complicated for some people) is to display it directly in a browser. The support for XML operations based on Javascript can provide a good user experience. If there is only one data file, you can use HTML embedded Javascript to access XML. Of course, there may be multiple data XML files, so that you can use XSLT (XML Conversion language. As long as the XML document only references this type of file, the XML can be converted to HTML for display.

<? Xml-stylesheet type = 'text/xsl 'href = 'bin \ xmlStyle. xsl'?>

 

For the following demonstration, refer to MSNShell's management and display of chat records, store document-related data in XML format, and convert XML into HTML for display using XSLT, XML fuzzy query and paging technologies are applied to improve user experience.

In summary, this solution can meet users' requirements for document query. In addition, this solution has the following advantages:

  • XML-based data storage provides excellent scalability.
  • Separation of data storage and presentation reduces development complexity.
  • Using javascript and standard XML, XSLT technology reduces the maintenance cost in the future.
  • Cross-platform solutions can be run with a browser.
  • Good user experience.

OK. The solution is finished. It should be good, becauseThis demo source code is not availableFor more information about how to use XSLT, see message conversion code of MSNShell. For more information about XML fuzzy search, see "use Xpath to fuzzy search XML". In addition, if you have better solutions or problems encountered during development, you are welcome to discuss them together.

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.