我试图在 vb 中获取 Text 的值,只有当 TextTypeCode = "02" - 如果我应该将 tes 更改为
tes = (product.Elements(HandleTagName("OtherText"))).value
它获取包括 TextTypeCode、TextFormat 和 Text PublicationDate 在内的全部信息,但是,当
tes = (product.Elements(HandleTagName("Text"))).value
它什么也没抓住!
For Each ThisOtherText In product.Elements(HandleTagName("OtherText"))
If ThisOtherText.Element(HandleTagName("TextTypeCode")) = "02" Then
Dim tes as string = (product.Elements(HandleTagName("Text"))).value
ThisBook.shortDescription = tes
Next
<Product>
<OtherText>
<TextTypeCode>02</TextTypeCode>
<TextFormat>05</TextFormat>
<Text>In a series of humorous incidents and hair-raising episodes </Text>
<TextPublicationDate>20140422</TextPublicationDate>
</OtherText>
</Product>
我还将数据库上的 shortDescription 声明为 LONGTEXT