CurryInfo: icurry-3.2.0 / TermGraph.SVG.nodeFromXml

definition:
nodeFromXml :: Bool -> XmlExp -> Node
nodeFromXml labelNID (XElem nodetype _ attrs)
  | nodetype == "node" = Node (readElem attrs "type")
                              (readElem attrs "id")
                              label
                              children
                              (readElem attrs "isActive")
                              (readElem attrs "isResult")
  | otherwise          = error "could not parse node"
 where
  label = readStrElem attrs "label" ++
          if labelNID then " (" ++ (readStrElem attrs "id") ++ ")"
                      else ""

  childrenXml :: [XmlExp]
  childrenXml = ((elemsOf . (fromMaybe (error "Error in nodeFromXml")) . find ((== "children") . tagOf)) attrs)

  children    :: [NodeID]
  children    = map (read . textOfXmlExp)
                    (filter ((== "nodeId") . tagOf) childrenXml)
nodeFromXml _ (XText _) = error "could not parse node"
demand:
argument 2
deterministic:
deterministic operation
documentation:
-- Extract a node from Xml representation
failfree:
<FAILING>
indeterministic:
referentially transparent operation
infix:
no fixity defined
iotype:
{(_,{XElem}) |-> {Node}}
name:
nodeFromXml
precedence:
no precedence defined
result-values:
{Node}
signature:
Prelude.Bool -> XML.XmlExp -> Node
solution-complete:
operation might suspend on free variables
terminating:
possibly non-terminating
totally-defined:
possibly non-reducible on same data term