我有一个XmlNode
函数,写XmlCDataSection
然后返回XmlCDataSection
。
现在,我已将XNode
转换为XmlNode
,我想调用上述方法,但我需要将生成的XmlCDataSection
转换为XCData
。< / p>
这是用Vb.Net编写的伪代码:
<Extension>
Public Function CreateCDataSection(ByVal node As XNode) As XCData
Dim xmlNode as XmlNode =
node.ConvertToXmlNode()
Dim xmlCDataSection as XmlCDataSection =
XmlNodeExtensions.CreateCDataSection(xmlNode)
' Here is where I need help for the conversion:
Dim xCData as XCData = xmlCDataSection.ConvertToXCData()
Return xCData
End Function
如何将 XmlCDataSection
转换为 XCData
?
答案 0 :(得分:1)