我在加载XML并读取其内容时遇到了麻烦。我得到一个空白的结果,无法将值填充到文本框。 我的XML看起来像:
<div id="page" class="hfeed site">
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<?php $image_url = home_url( ); ?>
<a href="<?php echo $image_url; ?>">
<?php the_post_thumbnail('full'); ?>
</a>
<?php else : ?>
<div id="headimg"><img class="ImageResize560" src="<?php header_image(); ?>"></div>
我需要Function_string,CaseString_col中的值....即FunctionString,m,...要映射到指定的文本框。
请建议
答案 0 :(得分:0)
试试xml linq
Imports System.Xml
Imports System.Xml.Linq
Module Module1
Const FILENAME As String = "c:\temp\test.xml"
Sub Main()
Dim doc As XDocument = XDocument.Load(FILENAME)
Dim function_String As String = CType(doc.Descendants("Function_String").FirstOrDefault(), String)
Dim caseString_Col As String = CType(doc.Descendants("CaseString_Col").FirstOrDefault(), String)
Dim iD_String As String = CType(doc.Descendants("ID_String").FirstOrDefault(), String)
Dim topic_Col As String = CType(doc.Descendants("Topic_Col").FirstOrDefault(), String)
Dim sub_Topic As String = CType(doc.Descendants("Sub_Topic").FirstOrDefault(), String)
Dim iD_Col As String = CType(doc.Descendants("ID_Col").FirstOrDefault(), String)
Dim notes As String = CType(doc.Descendants("Notes").FirstOrDefault(), String)
End Sub
End Module