XML annotations in Visual Studio.NET

Source: Internet
Author: User
Tags processing instruction xsl xsl file visual studio
Visual|xml XML annotations in Visual Studio.NET10/18/2001 11:1:33 Yesky

   applying an XSL template to an XML file

You will now apply the XSL template to the XML file you created. You will open the XML and XSL files in the IDE and then apply the XSL template so that Xml.doc can be displayed correctly in your Web browser.

1. In the IDE, click File, and then click Add Existing Item.

2. Open the path C:\Documents and Settings\Administrator\My documents\visual Studio projects\xmlcomments.

3. Click Doc.xml, and then press the Open button. The Doc.xml file will open in the IDE, as shown in Figure 6.


Figure 6. Doc.xml in the IDE
You can now open the Doc.xml original file in your Web browser

4. Click View and then click Open With.

5. Click IExplore.exe, then click Open. Doc.xml The original file is opened in Microsoft Internet Explorer, as shown in Figure 7.

Note: Internet Explorer displays unformatted XML files with a series of "-" symbols


Figure 7. Doc.xml original file displayed in IE
6. To turn off Internet Explorer, click File First, and then click Close.

7. Open the doc.xsl template in the IDE: Click File, and then click Add Existing Item.

8. Open path C:\Documents and Settings\Administrator\My Documents\Visual Studio projects\xmlcomments

9. Select all files in the files of type, which will cause the Doc.xsl file name to be displayed.

10. Click Doc.xsl, and then press Open. Doc.xsl is opened in the IDE, as shown in Figure 8.


Figure 8. Doc.xsl in the IDE
Note: The second line of the Doc.xsl file has a commented out processing instruction: We will add it to the XML file in the next step.

11. Apply the doc.xsl template to the Doc.xml file: Highlight the XML Processing command for the second row of the Doc.xsl template, as shown in Figure 9. Click Edit, and then click Copy.


Type form processing instructions in Figure 9.doc.xsl
12. Click the Doc.xml tab.

13. Inserts a blank line between and the label.

14. Place the cursor on a blank line, click Edit, and then click Paste, and the screen will show the figure 10 interface.


Figure 10. Doc.xml file after adding type form processing instruction
15. Click File, and then click Save Doc.xml.

16. When you have finished saving a file, note that the colon is missing from the processing instructions. Then you need to add a dash (-) between "xml" and "stylesheet" (excluding quotes, like the second line in Figure 11), so that the processing instructions work correctly. After inserting a dash, click File, and then click Save Doc.xml.


Figure 11. Doc.xml with the correct type form format
   Open Doc.xml final version

You can now watch the doc.xml of the type form applied in the browser. Make sure the Doc.xml tab is selected in the IDE.

1. Click View and then click Open With.

2. Click Iexplore.exe, then click Open. The Doc.xml file will be displayed in doc.xsl format on the browser.


Figure 12. Doc.xml after the type form has been applied to Internet Explorer
   End

1. Click File, and then click Close to turn off Internet Explorer.

2. Click File, and then click Exit to close the IDE.


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.