簡體   English   中英

為什么此xpath失敗

[英]Why this xpath fails

我有以下xml文件

<applications>
   <application>
      <forms>
          <questions>
              <first_name>
                   My Name
              </first_name>
          </questions>
      </forms>
    </application>
</applications>

首先,我為每個循環運行一個for所有循環,並為當前應用程序分配一個變量應用程序。 然后,我像這樣測試每個應用程序:

<wr:if select="${app}/forms/questions/first_name" notEmpty="true">Print this if succeeded</wr:if>

我正在嘗試測試first_name標記中是否有文本,但最后我總是有空字符串,我想我的if不會成功。 您知道我的xpath錯誤嗎?

嘗試使用text():

<wr:if select="${app}/forms/questions/first_name/text()" notEmpty="true">Print this if succeeded</wr:if>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM