I want filter information from a .xml file, the general xml rule isfrom elements that look like this:
XMLElement["div", {"class" -> "art_title linkable"},
{XMLElement["a",
{"shape" -> "rect", "class" -> "ref nowrap",
"href" -> "XXXX"},
{"name"} ]}]
so I use the following code, it will word good, to filter out the text from the a element:
Cases[data,
XMLElement[
"div", {"class" -> "art_title linkable"}, {XMLElement[
"a", {___}, {papername_}]}] :> {papername}, {0, Infinity}];
(* {{"name"}} *)
But I found there arethis does not work if the content of the special condition,a element is more complicated:
XMLElement["div", {"class" -> "art_title linkable"}, {XMLElement[
"a"{XMLElement["a", {"shape" -> "rect", "class" -> "ref nowrap",
"href" -> "XXXX"}, {XMLElement[
"b"{XMLElement["b", {}, {"namepart1"}],
"namepart2"} ]}]
The name of the special form can't use... which gives the code, so I hope someone can help me, if there is a methodresult {}
.
How can get the name forI extract just the spectial condtion.text "namepart1namepart2
in this second case?