Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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;
> 
>     <!ELEMENT NOTE (#PCDATA)>
>     <!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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners