🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.text.xml
Article #9990

Re: Kit XML Oracle + DOM

#9990
From: Doeni
Date: Thu, 11 Jan 2001 20:22
60 lines
2552 bytes
"Vincent Croquette" <vincent.croquette@reuters.com> writes:

> Bonjour
> 
> Comment creer dans un programme C++ un arbre DOM correspondant a:
> 
> <SOCIETES>
>     <SOCIETE Id="1">
>         <NOM>Societe1</NOM>
>     </SOCIETE>
>     <SOCIETE Id="2">
>         <NOM>Societe2</NOM>
>     </SOCIETE>
> </SOCIETES>
> 

Si �a peut t'aider, voici un comment faire en Java :

import java.io.*;
import org.w3c.dom.*;
import oracle.xml.parser.v2.*;

public class TestDom {

    public static void main(String args[]) throws Exception {

	XMLDocument doc = new XMLDocument();
	doc.setEncoding("iso-8859-1");

	Element societes = doc.createElement("SOCIETES");
	Element societe = doc.createElement("SOCIETE");
	societe.setAttribute("Id","1");
	Element nom = doc.createElement("NOM");
	nom.appendChild(doc.createTextNode("Societe1"));
	societe.appendChild(nom);
	societes.appendChild(societe);
	
	societe = doc.createElement("SOCIETE");
	societe.setAttribute("Id","2");
	nom = doc.createElement("NOM");
	nom.appendChild(doc.createTextNode("Societe2"));
	societe.appendChild(nom);
	societes.appendChild(societe);

	doc.appendChild(societes);

	doc.print(new PrintWriter(System.out));
    }
}


Mis � part XMLDocument qui est une classe Oracle impl�mentant
l'interface Document, toutes les classes existent �galement en C++


-- 
I am not listed on the United States Department of Treasury lists of
Specially Designated Nationals, Specially Designated Terrorists, and
Specially Designated Narcotic Traffickers, nor am I listed on the
United States Department of Commerce Table of Denial Orders. 
Technical Details
Message-ID: <87y9whalfr.fsf@dinosaur.evhr.net>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!isdnet!inetway!inetway.net!not-for-mail
References: <93kt8t$9m4$1@unlisys.unlisys.net>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 114f60,a43fd66908363808
X-Google-Attributes: gid114f60,public
X-Google-ArrivalTime: 2001-01-11 12:24:06 PST
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!freenix!isdnet!inetway!inetway.net!not-for-mail
From: Doeni <doeni@evhr.net>
Newsgroups: fr.comp.text.xml
Subject: Re: Kit XML Oracle + DOM
Date: 11 Jan 2001 21:22:16 +0100
Organization: Ni dieu ni b�te
Lines: 60
Message-ID: <87y9whalfr.fsf@dinosaur.evhr.net>
References: <93kt8t$9m4$1@unlisys.unlisys.net>
NNTP-Posting-Host: 212.94.197.221
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: reader1.fr.uu.net 979245605 25374 212.94.197.221 (11 Jan 2001 20:40:05 GMT)
X-Complaints-To: abuse@fr.uu.net
NNTP-Posting-Date: 11 Jan 2001 20:40:05 GMT
User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Carlsbad Caverns)