Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[OSR] Suggested topic - XML processing API
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-01-30 (10:32)
From: Bünzli_Daniel <daniel.buenzli@e...>
Subject: Re: [Caml-list] [OSR] Suggested topic - XML processing API

> Jim Miller wrote:
>> type xmlNode =
>> | XmlElement of (namespace: string * tagName: string * attributes:
>> (string * string) list * (children:xmlNode list) )
>> | XmlPCData of (text:string)

Attributes can have their own namespace, have a look a the spec [1]. I  
see it more that way (but I'm biaised).

type name = string * string
type attribute = name * string
type tag = name * attribute list


Adding to Alain's list, other things that need to be specified.

- what do you do with processing instructions and comments

- whether character references and predefined entities are resolved.

- how do you deal with external entity references.

- where does the parsing end (I don't do it according to the xml spec  
because from the words of the spec editor himself [2] the spec is  

I did document many of this issues for my own parser. You may want to  
check that out [3] it may show you some of the specification details  
that are needed (note that the tree and the cursor representations are  
going away in the next version).