Find all nodes that have an attribute that matches a certain value with scala

前端 未结 5 1043
遥遥无期
遥遥无期 2021-02-08 04:00

I saw the following example on Nabble, where the goal was to return all nodes that contain an attribute with an id of X that contains a value Y:

//find all nodes         


        
5条回答
  •  再見小時候
    2021-02-08 04:29

    Code snippet in the question doesn't working with Scala 2.8 - due to this comparasion

    (_ == value)
    Needs to be replaced with (_.text == value) or (_ == Text(value)) or change type of value from String to Text.

    And in Daniel's answer (_.value == value) needs to be replaced with (_.value.text == value).

提交回复
热议问题