尊敬的用户,
<note>
<to>ToText</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
Run Code Online (Sandbox Code Playgroud)
我需要XML使用Xpath. 我正在使用string-lenth(),但无法呈现准确的结果。
有没有办法得到string-lenght(/to)或 string-lenght(/from)?
尝试在下面使用XPath:
//from/string-length(text())
Run Code Online (Sandbox Code Playgroud)
或者
//to/string-length(text())
Run Code Online (Sandbox Code Playgroud)