日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

android transform xml xsl,XslCompiledTransform.Transform 方法 (System.Xml.Xsl) | Microsoft Docs

發(fā)布時(shí)間:2025/3/21 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android transform xml xsl,XslCompiledTransform.Transform 方法 (System.Xml.Xsl) | Microsoft Docs 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

使用 URI 指定的輸入文檔執(zhí)行轉(zhuǎn)換,然后將結(jié)果輸出到 XmlWriter。Executes the transform using the input document specified by the URI and outputs the results to an XmlWriter. The XsltArgumentList provides additional run-time arguments.

public:

void Transform(System::String ^ inputUri, System::Xml::Xsl::XsltArgumentList ^ arguments, System::Xml::XmlWriter ^ results);

public void Transform (string inputUri, System.Xml.Xsl.XsltArgumentList? arguments, System.Xml.XmlWriter results);

public void Transform (string inputUri, System.Xml.Xsl.XsltArgumentList arguments, System.Xml.XmlWriter results);

member this.Transform : string * System.Xml.Xsl.XsltArgumentList * System.Xml.XmlWriter -> unit

Public Sub Transform (inputUri As String, arguments As XsltArgumentList, results As XmlWriter)

參數(shù)

inputUri

輸入文檔的 URI。The URI of the input document.

XsltArgumentList,包含用作轉(zhuǎn)換輸入的命名空間限定的參數(shù)。An XsltArgumentList containing the namespace-qualified arguments used as input to the transform. 此值可為 null。This value can be null.

The XmlWriter to which you want to output.

If the style sheet contains an xsl:output element, you should create the XmlWriter using the XmlWriterSettings object returned from the OutputSettings property. 這樣可以確保 XmlWriter 的輸出設(shè)置是正確的。This ensures that the XmlWriter has the correct output settings.

例外

inputUri 或 results 值為 null。The inputUri or results value is null.

執(zhí)行 XSLT 轉(zhuǎn)換時(shí)出錯(cuò)。There was an error executing the XSLT transform.

inputtUri 值包含無法找到的文件名或目錄。The inputtUri value includes a filename or directory cannot be found.

無法解析 inputUri 值。The inputUri value cannot be resolved.

- 或 --or-

處理該請(qǐng)求時(shí)出錯(cuò)。An error occurred while processing the request.

inputUri 不是有效的 URI。inputUri is not a valid URI.

加載輸入文檔時(shí)出現(xiàn)分析錯(cuò)誤。There was a parsing error loading the input document.

示例

下面的示例使用 XsltArgumentList 對(duì)象創(chuàng)建一個(gè)表示當(dāng)前日期和時(shí)間的參數(shù)。The following example uses an XsltArgumentList object to create a parameter representing the current date and time.

using System;

using System.IO;

using System.Xml;

using System.Xml.Xsl;

public class Sample

{

public static void Main()

{

// Create the XslCompiledTransform and load the stylesheet.

XslCompiledTransform xslt = new XslCompiledTransform();

xslt.Load("order.xsl");

// Create the XsltArgumentList.

XsltArgumentList xslArg = new XsltArgumentList();

// Create a parameter which represents the current date and time.

DateTime d = DateTime.Now;

xslArg.AddParam("date", "", d.ToString());

// Transform the file.

using (XmlWriter w = XmlWriter.Create("output.xml"))

{

xslt.Transform("order.xml", xslArg, w);

}

}

}Imports System.IO

Imports System.Xml

Imports System.Xml.Xsl

Public Class Sample

Public Shared Sub Main()

' Create the XslCompiledTransform and load the stylesheet.

Dim xslt As New XslCompiledTransform()

xslt.Load("order.xsl")

' Create the XsltArgumentList.

Dim xslArg As New XsltArgumentList()

' Create a parameter which represents the current date and time.

Dim d As DateTime = DateTime.Now

xslArg.AddParam("date", "", d.ToString())

Using w As XmlWriter = XmlWriter.Create("output.xml")

' Transform the file.

xslt.Transform("order.xml", xslArg, w)

End Using

End Sub

End Class

該示例使用以下兩個(gè)數(shù)據(jù)文件作為輸入。The example uses the following two data files as input.

order.xmlorder.xml

The Handmaid's Tale

19.95

Americana

16.95

order .xslorder.xsl

注解

此方法使用 XmlUrlResolver 沒有用戶憑據(jù)的默認(rèn)值來解析輸入文檔和 document() 在樣式表中找到的任何 XSLT 函數(shù)的實(shí)例。This method uses a default XmlUrlResolver with no user credentials to resolve the input document and any instances of the XSLT document() function found in the style sheet. 如果這些資源中的任何一個(gè)需要身份驗(yàn)證的網(wǎng)絡(luò)資源,請(qǐng)使用 XmlResolver 以作為其參數(shù)之一的重載,并使用 XmlResolver 所需的憑據(jù)指定。If any of these resources are located on a network resource that requires authentication, use the overload that takes an XmlResolver as one of its arguments and specify an XmlResolver with the necessary credentials.

使用 XmlReader 帶有默認(rèn)設(shè)置的來加載輸入文檔。An XmlReader with default settings is used to load the input document. 在上禁用 DTD 處理 XmlReader 。DTD processing is disabled on the XmlReader. 如果需要 DTD 處理,請(qǐng)創(chuàng)建一個(gè) XmlReader 啟用了此功能的,并將其傳遞給 Transform 方法。If you require DTD processing, create an XmlReader with this feature enabled, and pass it to the Transform method.

適用于

《新程序員》:云原生和全面數(shù)字化實(shí)踐50位技術(shù)專家共同創(chuàng)作,文字、視頻、音頻交互閱讀

總結(jié)

以上是生活随笔為你收集整理的android transform xml xsl,XslCompiledTransform.Transform 方法 (System.Xml.Xsl) | Microsoft Docs的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。