~singpolyma/xml-types-haskell

e7d582450e59f02cf2e05ae6272496462df24c81 — John Millikin 13 years ago ed4e0ed
Add ``elementContent`` function.
1 files changed, 6 insertions(+), 0 deletions(-)

M Data/XML/Types.hs
M Data/XML/Types.hs => Data/XML/Types.hs +6 -0
@@ 174,6 174,8 @@ data InternalSubset = InternalSubset
-- | Some XML processing tools are incremental, and work in terms of events
-- rather than node trees. Defining the event type here, even though it won't
-- be useful to most users, allows these packages to interoperate more easily.
--
-- Since: 0.1.1
data Event
	= EventBeginDocument
	| EventEndDocument


@@ 207,6 209,10 @@ isNamed n x = [x | getName x == n]
elementChildren :: Element -> [Element]
elementChildren = elementNodes >=> isElement

-- | Since 0.1.3
elementContent :: Element -> [Content]
elementContent = elementNodes >=> isContent

nodeChildren :: Node -> [Node]
nodeChildren = isElement >=> elementNodes