Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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

etc.


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  
broken).

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).

Best,

Daniel

[1] http://www.w3.org/TR/REC-xml-names/
[2] http://www.xml.com/axml/notes/TrailingMisc.html
[3] http://erratique.ch/software/xmlm/doc/Xmlm#io