Re: [Haskell-cafe] How do I insert an element in HaXml?

2007-05-22 Thread Malcolm Wallace
Jeremy Shaw [EMAIL PROTECTED] wrote: Another example is sorting the children. sortedChildren match = mkElem match [ sortBy ((=) `on` tagName) . children ] `o` tag match where tagName (CElem (Elem name _ _ _)) = name or maybe, to use the labelling combinators rather than

Re: [Haskell-cafe] How do I insert an element in HaXml?

2007-05-21 Thread Jeremy Shaw
At Sun, 20 May 2007 10:55:26 +0100, Malcolm Wallace wrote: Jeremy Shaw [EMAIL PROTECTED] writes: How do I create a HaXml filter that adds a new element as a child of an existing element. For example, let's say I have the XML document: a b/ c/ /a How do I add a new element under a

Re: [Haskell-cafe] How do I insert an element in HaXml?

2007-05-20 Thread Malcolm Wallace
Jeremy Shaw [EMAIL PROTECTED] writes: How do I create a HaXml filter that adds a new element as a child of an existing element. For example, let's say I have the XML document: a b/ c/ /a How do I add a new element under a / so that I have the document: a newElement/ b/ c/ /a Using

[Haskell-cafe] How do I insert an element in HaXml?

2007-05-19 Thread Jeremy Shaw
Hello, How do I create a HaXml filter that adds a new element as a child of an existing element. For example, let's say I have the XML document: a b/ c/ /a How do I add a new element under a / so that I have the document: a newElement/ b/ c/ /a The following works, but it seems very