A simple code generator-XML and XLST application test.

Source: Internet
Author: User

I want to write this mainly because sometimes it is difficult to generate corresponding format files based on the tables in the database. The difference is actually the database part, the external code generator can be customized with less space, while also deepening the XML application.

Here, a lot of ideas I refer to Yuan Yongfu Yuan http://www.cnblogs.com/xdesigner/archive/2008/05/15/1198398.html

Let's talk about my ideas first.

1. Analyze the table and field information of the database. (Mainly sqldmo)

2. Select the corresponding table to generate the corresponding XML file.

3. Generate a file in the corresponding format based on the corresponding XLST file.

In general, there is no problem. The idea is also relatively simple.

Follow these steps.

Select a database.

 

Then obtain the information of the corresponding database.

 

Select the relevant table. If userinfo is selected above, the corresponding XML file is generated. The format is as follows.

The XLST document used for testing is as follows,

The final file is as follows.

Almost the entire process is as above. The most important thing to do is to compile the XLST file. Now I only write CSHARP and HTML processing, and I haven't done anything about it yet.

You only need to put the prepared XLST document into the corresponding document, and select several corresponding XLST documents on the main interface, then several corresponding documents will be generated for you.

 

PS: I can use WPF to make such an ugly interface. I don't know what Ms thinks ....

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.