[plt-scheme] xml-parsing

From: John Clements (clements at brinckerhoff.org)
Date: Thu Jan 23 15:14:58 EST 2003

On Wednesday, January 22, 2003, at 12:57  AM, Mike T. Machenry wrote:

>   For list-related administrative tasks:
>   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> Hello List,
>
>   I am trying to parse an xml fragment. I am noting that it seems all 
> the
> provisions from the xml library require the document to be a full xml
> document with a root tag. Is it not possible to parse fragments with 
> the
> current library? My desired function would be as such:
>
> given a STDIN
> this is a <a href="http://www.test.org">test</a>
>
> a call to
> (xml->xexpr (my-desired-function))
>
> produces
> ("this is a " (a ((href "http://www.test.org")) "test"))
>
> When (define my-desired-function read-xml/element) I get an error
> complaining about a missing root tag :-\

I think a root tag is not what you think it is.  If I understand things 
correctly, the only requirement is that the input be wrapped in some 
kind of XML tag.  So, for instance, if you wrapped your input in any 
tag pair at all, I believe this would work fine.

Check me on this.

john



Posted on the users mailing list.