私はこれでどこに行きますか。xslt シートを使用して変換する必要がある XML ドキュメントがあります。私のコードは次のとおりです。
Dim xStream As New IO.MemoryStream
' Create the XslCompiledTransform and load the stylesheet.
Dim xslt As New XslCompiledTransform()
xslt.Load(strLKxsl)
' Create the XslCompiledTransform and load the stylesheet.
Dim xslt As New XslCompiledTransform()
xslt.Load(strXSLfolder & "xslt_lookup.xslt")
' Create the XsltArgumentList.
Dim xslArg As New XsltArgumentList()
Using w As XmlWriter = XmlWriter.Create(xStream)
' Transform the file.
xslt.Transform(xmldLookup, Nothing, w)
End Using
xslt.Transform(xmldLookup, Nothing, w) 行で次のエラーが発生します。
EndRootElement 状態のトークン StartElement は、無効な XML ドキュメントになります。XML フラグメントを作成する場合は、ConformanceLevel 設定が ConformanceLevel.Fragment または ConformanceLevel.Auto に設定されていることを確認してください。
これは、XML ファイルの内容です。
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="includes/xslt_lookup.xslt"?>
<lookup xmlns="logis-online:lk"
title="<Document Title>"
nexturl="<URL>">
<search visible="false">
<field id="SUPPLIER_NO" hidden="true" size="10"
value="<Value>" />
<field id="WEB_STORE_NO" hidden="true" size="10"
value="<Value>" />
<field id="REST" hidden="true" size="40" value="" />
<field id="LOOKUP_ACTION" hidden="true" size="1" value="<Value>" />
<field id="WEB_ACTION" hidden="true" size="2" value="<Value>" />
</search>
<results>
<header>
<section>
<item id="SUPPLIER_NO" title="Supplier No" value="<Value>"
HelpID="10" />
<item id="SUPPLIER_NAME_SHORT" title="Supplier Name"
value="<Value>" HelpID="10" />
<item id="LIABLE_STORE_NO" title="Liable Store No"
value="<Value>" HelpID="98" />
</section>
</header>
<list target="<lookup aspx page>" />
</results>
</lookup>