• <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++ 基礎} {C++ 高級} {C#界面,C++核心算法} {設計模式} {C#基礎}

            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 夢在天涯 閱讀(605) 評論(0)  編輯 收藏 引用 所屬分類: C#/.NET

            公告

            EMail:itech001#126.com

            導航

            統計

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

            常用鏈接

            隨筆分類

            隨筆檔案

            收藏夾

            Blogs

            c#(csharp)

            C++(cpp)

            Enlish

            Forums(bbs)

            My self

            Often go

            Useful Webs

            Xml/Uml/html

            搜索

            •  

            積分與排名

            • 積分 - 1808189
            • 排名 - 5

            最新評論

            閱讀排行榜

            色偷偷888欧美精品久久久| 狠狠色综合网站久久久久久久高清| 无码人妻精品一区二区三区久久 | 久久毛片一区二区| 欧美一区二区三区久久综合| 精品久久久无码中文字幕天天 | 久久久亚洲裙底偷窥综合| 青青青国产成人久久111网站| 99久久国产综合精品网成人影院| 亚洲中文久久精品无码| 国内精品久久久久久99蜜桃| 色8激情欧美成人久久综合电| 久久久久女人精品毛片| 91麻豆国产精品91久久久| 国产一区二区精品久久岳| 亚洲中文字幕无码久久2020 | 国产成人久久精品区一区二区| 99久久国产亚洲综合精品| 久久久国产精品网站| 亚洲精品乱码久久久久久蜜桃图片 | 漂亮人妻被中出中文字幕久久| 久久精品草草草| 国产99久久久久久免费看| 狠色狠色狠狠色综合久久| 久久久久久久精品成人热色戒| 久久er国产精品免费观看8| 国产精品久久久久久一区二区三区| A级毛片无码久久精品免费| 久久人人爽人人爽AV片| 香港aa三级久久三级老师2021国产三级精品三级在 | 久久婷婷人人澡人人爽人人爱| 久久综合九色综合97_久久久| 精品熟女少妇a∨免费久久| 国色天香久久久久久久小说| 色狠狠久久综合网| 久久毛片一区二区| 亚洲av成人无码久久精品 | 久久99精品久久久久子伦| 久久免费的精品国产V∧| 亚洲AV日韩精品久久久久久久| 亚洲乱码精品久久久久.. |