[plt-scheme] Serializing objects as XML

From: Dmitry Lizorkin (lizorkin at ispras.ru)
Date: Wed Feb 13 08:56:11 EST 2008

Hello James,

Probably, the SXML library could be helpful for you (available from PLaneT).

In particular,

; Obtain the SXML representation for an XML document located in the filename
(sxml:document "filename.xml")

; Serialize SXML back into XML
(srl:sxml->xml doc "filename")

> I have an application that needs to process XML data based on its
> content according to some arbitrary rules that will be defined at runtime.
>
> For example: if element Type is 'ABC and element Amount is 100 then call
> function foo.

XPath ?
http://www.w3.org/TR/xpath

For your example, it would be something like:
self::ABC and Amount = 100

; Sample usage
((if-sxpath "self::ABC and Amount = 100")
  '(ABC (Amount 100)))
 => true

Would that be helpful for you?

Dmitry



Posted on the users mailing list.