嗨,我有一个下面提到的 xml,它是来自数据库的字符串值。我想解析 xml 字符串并且不想保存那些有空的空间,即这个语句意味着它存储了空的空间。我需要在 if 条件下查找此语句,如果为空则不保存。请让我知道该怎么做。下面是xml之后的vb.net代码
<DocumentElement>
<TBLCustomizedCodes>
<tblRowkey>-1</tblRowkey>
<TBLRowCustomizedCodes>test</TBLRowCustomizedCodes>
<TBLRowCompliance>N/A</TBLRowCompliance>
</TBLCustomizedCodes>
<TBLCustomizedCodes>
<tblRowkey>-2</tblRowkey>
<TBLRowCustomizedCodes xml:space="preserve"> </TBLRowCustomizedCodes>
<TBLRowCompliance xml:space="preserve"> </TBLRowCompliance>
</TBLCustomizedCodes>
<TBLCustomizedCodes>
<tblRowkey>-3</tblRowkey>
<TBLRowCustomizedCodes xml:space="preserve"> </TBLRowCustomizedCodes>
<TBLRowCompliance xml:space="preserve"> </TBLRowCompliance>
</TBLCustomizedCodes>
</DocumentElement>
Dim ds As DataSet = New DataSet("DocumentElement")
ds.Tables.Add(tempdataTable)
Dim valueXML As String = ds.GetXml().ToString().Trim()
SaveInspectionSupplementalLineItem(valueXML)