[Haskell-beginners] Recursive XML schema and feeding into data model

ashwin sathya ashwin.sathya at gmail.com
Wed Jun 19 09:06:39 CEST 2013


Hi,

I have a recursive schema whose data model looks like the following

{-data InformationField = InformationField { name, value :: String }-}
        {-deriving (Show, Eq) -}

{-data Fields = Fields { fields :: [InformationField] }-}
        {-deriving (Show, Eq)-}

{-data Children = Children { childNodes :: [BuildInformationNode] }-}

{-data BuildInformationNode = BuildInformationNode { field :: Fields,
children :: Children }-}


BuildInformationNode has children which has multiple BuildInformationNode.

I am getting started on HXT, using the samples that they had provided i was
able to pull up individual nodes from xml.

I am having difficult in starting to read the entire xml into the data
model and have one single BuildInformationNode created which represents the
entire xml.

The idea is to implement a show on BuildInformationNode wherein i can
implement for displaying the  tree in a format that i require.

Any pointers regarding this would be great.

-- 
Thanks & Regards,
R Ashwin Sathya
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130619/d8a38d40/attachment.htm>


More information about the Beginners mailing list