• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            C++ Programmer's Cookbook

            {C++ 基礎(chǔ)} {C++ 高級} {C#界面,C++核心算法} {設(shè)計模式} {C#基礎(chǔ)}

            Perform an XSL Transform(XML五)

            Solution

            Use the System.Xml.Xsl.XslTransform class. Load the XSLT stylesheet using the XslTransform.Load method, and generate the output document by using the Transform method and supplying a source document.
            xstl:

            <?xml version="1.0" encoding="UTF-8" ?>
            <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                version="1.0" >
            
              <xsl:template match="Order">
                <html><body><p>
                Order <b><xsl:value-of select="Client/@id"/></b>
                for <xsl:value-of select="Client/Name"/></p>
                <table border="1">
                <td>ID</td><td>Name</td><td>Price</td>
                <xsl:apply-templates select="Items/Item"/>
                </table></body></html>
              </xsl:template>
             
              <xsl:template match="Items/Item">
                <tr>
                <td><xsl:value-of select="@id"/></td>
                <td><xsl:value-of select="Name"/></td>
                <td><xsl:value-of select="Price"/></td>
                </tr>
              </xsl:template>
            
            </xsl:stylesheet>


            xml:
            <?xml version="1.0"?>
            <Order id="2004-01-30.195496">
              <Client id="ROS-930252034">
                <Name>Remarkable Office Supplies</Name>
              </Client>
            
              <Items>
                <Item id="1001">
                  <Name>Electronic Protractor</Name>
                  <Price>42.99</Price>
                </Item>
                <Item id="1002">
                  <Name>Invisible Ink</Name>
                  <Price>200.25</Price>
                </Item>
              </Items>
            </Order>


            the progrming:
            using System;
            using System.Windows.Forms;
            using System.Xml.Xsl;
            
            public class TransformXml : System.Windows.Forms.Form {
            
                private AxSHDocVw.AxWebBrowser webBrowser;
            
                 // (Designer code omitted.)
            
                private void TransformXml_Load(object sender, System.EventArgs e) {
            
                    XslTransform transform = new XslTransform();
                        
                    // Load the XSL stylesheet.
                    transform.Load("orders.xslt");
                        
                    // Transform orders.xml into orders.html using orders.xslt.
                    transform.Transform("orders.xml", "orders.html", null);
            
                    object var = null;
                    webBrowser.Navigate(
                      "file:///" + Application.StartupPath + @"\orders.html",
                      ref var, ref var, ref var, ref var);
                }
            }
            The .NET Framework does not include any controls for rendering HTML content.
            However, this functionality is available through COM interoperability
            if you use the ActiveX Web browser control provided with Microsoft Internet
            Explorer and the Microsoft Windows operating system. This window can
            show local or remote HTML files, and supports JavaScript, VBScript,
            and all Internet Explorer plug-ins.




            :To add the Web browser to a project in Microsoft Visual Studio .NET, right- click the Toolbox and
            choose Add/Remove Items. Then select the COM Components tab, and check the Microsoft Web Browser
            control (shdocvw.dll). This will add the Microsoft Web Browser control to your Toolbox. When you
            drop this control onto a form, the necessary interop assemblies will be generated and added to your
            project.

            posted on 2005-11-23 18:50 夢在天涯 閱讀(602) 評論(0)  編輯 收藏 引用 所屬分類: C#/.NET

            公告

            EMail:itech001#126.com

            導(dǎo)航

            統(tǒng)計

            • 隨筆 - 461
            • 文章 - 4
            • 評論 - 746
            • 引用 - 0

            常用鏈接

            隨筆分類

            隨筆檔案

            收藏夾

            Blogs

            c#(csharp)

            C++(cpp)

            Enlish

            Forums(bbs)

            My self

            Often go

            Useful Webs

            Xml/Uml/html

            搜索

            •  

            積分與排名

            • 積分 - 1804603
            • 排名 - 5

            最新評論

            閱讀排行榜

            中文字幕成人精品久久不卡 | 欧美成人免费观看久久| 青青草原综合久久大伊人| 久久精品www人人爽人人| 久久亚洲AV无码西西人体| 久久久亚洲欧洲日产国码是AV| 青青青国产精品国产精品久久久久 | 人妻精品久久无码区| 亚洲国产天堂久久综合| 久久精品国产精品青草| 日本久久久久亚洲中字幕 | 国产情侣久久久久aⅴ免费| 亚洲国产精品狼友中文久久久| 久久精品日日躁夜夜躁欧美| 91精品国产色综合久久| 久久水蜜桃亚洲av无码精品麻豆| 久久精品国产福利国产秒| 99久久精品免费看国产一区二区三区| 久久天天躁狠狠躁夜夜2020老熟妇| 99蜜桃臀久久久欧美精品网站| 国产精品日韩欧美久久综合| 久久国产视屏| 亚洲国产视频久久| 国产∨亚洲V天堂无码久久久| 色偷偷91久久综合噜噜噜噜| 婷婷久久综合九色综合九七| 97久久天天综合色天天综合色hd| 久久亚洲精品国产精品婷婷| 国产激情久久久久影院| 国内精品久久久久久野外| 久久久久无码精品国产| 中文字幕日本人妻久久久免费 | 热99RE久久精品这里都是精品免费| 久久亚洲国产中v天仙www| 狠狠色婷婷久久一区二区三区| 久久精品国产免费观看| 99久久综合国产精品免费| 亚洲伊人久久综合中文成人网| 久久天天躁狠狠躁夜夜不卡| 亚洲?V乱码久久精品蜜桃| 婷婷久久综合九色综合绿巨人 |