我正在尝试解析这个 xml:
...
<member>
<name>id</name>
<value>
<string>1</string>
</value>
</member>
<member>
<name>description</name>
<value>
<string>sdfsdfsdf</string>
</value>
</member>
...
如何仅解析具有从属“name”-tag =“id”的“<member>”标签?
我试过了:
getroot = multi ( ( getChildren >>> hasName "name" >>> hasText "id") `guards` (isElem >>> hasName "member" ) )
main = do
print <- runX (parseXML "test2.xml" >>> getroot >>> putXmlTree "-")