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
[Caml-list] Create a XML with PXP
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-06-06 (09:30)
From: Dominique Quatravaux <dom@i...>
Subject: Re: [Caml-list] Create a XML with PXP
> Hi list;
>   I´m creating a XML with PXP and I´ve one problem;
>   I use the funtion "create_element_node" in order to create a node 
> with attributes in the XML tree , and I use the 
> function  "create_data_node" in order to create a node with data, but: 
> How can I create a node with attributes and data? Is this possible?
>   For example, in this DTD;
>     <!ATTLIST NOTE type (warning | comment) #REQUIRED>
>   The node NOTE has one attribute, type, and at the same time has 
> data. 
> How can I create this node?

  This really is an XML question. I do not know PXP at all, but in a
DOM-like API (which I suppose PXP is), the data node would be a child
of the element node like this:

    element node: type="NOTE"
     |      \
     |       \
     |      attribute node: type="type", value="warning"
   data node: contents="text of the warning here"

  Since you say create_element_node accepts attribute arguments,
I tend to conclude that PXP will hide the oblique parent/child
relationship for you, but not the vertical one.

Dominique QUATRAVAUX                           Ingénieur senior
01 44 42 00 08                                 IDEALX

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: