briand | 24 Jan 16:40 2013

hxt pickling question

Hi,

Trying to understand how to write a document using a pickler but I can't make sense of the types.  

From the example:

     runX ( xunpickleDocument xpSeason
                               [ withValidate no
                               , withTrace 1
                               , withRemoveWS yes
                               , withPreserveComment no
                               ] "simple2.xml"
	     >>>  
	     processSeason
	     >>>  
	     xpickleDocument   xpSeason
                               [ withIndent yes
                               ] "new-simple2.xml"
	   )

So all I want to do is pickle a value directly instead of reading the value from a document.  I expected to do
something like:

runX (someHXTPicklingFunction myValue
      >>>  
      xpickleDocument ...)

but I can't seem to figure out what someHXTPicklingFunction should be, it's certainly nothing obvious
like pickleDoc, because that generates the wrong value.

(Continue reading)

Erik Hesselink | 24 Jan 17:05 2013
Picon

Re: hxt pickling question

There's showPickled [0] and unpickleDoc [1], maybe those help?

Erik

[0] http://hackage.haskell.org/packages/archive/hxt/latest/doc/html/Text-XML-HXT-Arrow-Pickle-Xml.html#v:showPickled
[1] http://hackage.haskell.org/packages/archive/hxt/latest/doc/html/Text-XML-HXT-Arrow-Pickle-Xml.html#v:unpickleDoc

On Thu, Jan 24, 2013 at 4:40 PM,  <briand <at> aracnet.com> wrote:
> Hi,
>
> Trying to understand how to write a document using a pickler but I can't make sense of the types.
>
> From the example:
>
>      runX ( xunpickleDocument xpSeason
>                                [ withValidate no
>                                , withTrace 1
>                                , withRemoveWS yes
>                                , withPreserveComment no
>                                ] "simple2.xml"
>              >>>
>              processSeason
>              >>>
>              xpickleDocument   xpSeason
>                                [ withIndent yes
>                                ] "new-simple2.xml"
>            )
>
> So all I want to do is pickle a value directly instead of reading the value from a document.  I expected to do
something like:
(Continue reading)

briand | 25 Jan 05:19 2013

Re: hxt pickling question

On Thu, 24 Jan 2013 17:05:15 +0100
Erik Hesselink <hesselink <at> gmail.com> wrote:

> There's showPickled [0] and unpickleDoc [1], maybe those help?
> 

Thank you , they help a lot :-)  I was stuck looking in Text.XML.HXT.Arrow.Pickle for the answer and got lost
trying to decipher IOStateArrow s a XmlTree and runX.

It's odd that there does not seem to be a way to use the example so that a tree can be written directly to a file.

  xpickleDocument :: PU a -> SysConfigList -> String -> IOStateArrow s a XmlTreeSource

  store an arbitray value in a persistent XML document 

Except there doesn't seem to be a way to pass that value into xpickleDocument without reading a document
first using xunpickleDocument.

Thanks again.

Brian

> Erik
> 
> [0] http://hackage.haskell.org/packages/archive/hxt/latest/doc/html/Text-XML-HXT-Arrow-Pickle-Xml.html#v:showPickled
> [1] http://hackage.haskell.org/packages/archive/hxt/latest/doc/html/Text-XML-HXT-Arrow-Pickle-Xml.html#v:unpickleDoc
> 
> On Thu, Jan 24, 2013 at 4:40 PM,  <briand <at> aracnet.com> wrote:
> > Hi,
> >
(Continue reading)


Gmane