
Hi Jimmy,
Doesn't xpPair [0] do what you want? Then afterwards, use `xpWrap` to
convert the pair(s) to your custom data type.
Erik
[0] http://hackage.haskell.org/package/hxt-9.3.1.10/docs/Text-XML-HXT-Arrow-Pick...
On Mon, Jan 5, 2015 at 12:15 AM, Jimmy Lu
Hi,
With xml element having DTD like following:
<!ELEMENT entry ((art*, formula?, table?), hw, hsl?, (pr | altpr)?, (ahw, hsl?, (pr | altpr)?)*, vr?, fl?, lb*, in*, ((dx) | (cx?, def?))?, dro*, dxnl*, uro*, syns*)>
I want to unpickle the sequence
hw, hsl?, (pr | altpr)?, (ahw, hsl?, (pr | altpr)?)*
into Haskell data type [Headword] where
data Headword = Hw { hwText :: String , hwSl :: Maybe String , hwPr :: Maybe Pronunciation }
However in the hxt pickle API I cannot found a way to extract a sequence of adjacent elements. Is there any one knowing how to do it?
Thanks,
Jimmy Lu _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe