Article View: fr.comp.text.xml
Article #8458Ranger un sous-ensemble de noeuds...
From: Pierre Y.
Date: Tue, 02 Oct 2001 11:57
Date: Tue, 02 Oct 2001 11:57
39 lines
2179 bytes
2179 bytes
Salut,
Voil� l'histoire j'utilise XML pour stocker une hi�rarchie de donn�es dans
mon programme (Delphi 6 + TXMLCursor de XMLComponents + parser MSXML).
ET j'aimerais trouver un moyen simple de prendre un sous-ensemble de noeuds
pour les ranger dans un noeud qui deviendrait leur p�re : Exemple :
<lignes>
<article />
<article />
</lignes>
Doit devenir apr�s l'appel � la fonction range :
<ligne>
<paquet_articles>
<article />
<article />
</paquet_articles>
</lignes>
De mon c�t� j'imagine deux solutions :
- Version Delphi pure : Selectionner le sous-ensemble avec la syntaxe XPath
ad-hoc. Cr�er un noeud, ranger les �l�ments trouv�s dans le noeud, les
supprimer du XML d'origine et ajouter le noeud ainsi cr�� contenant la
s�lection de noeuds � ranger.
- Version XSLT : faire un fichier XSLT qui fait la requ�te XPath et range
les noeuds s�lectionn�s dans le noeud parent. Et laisser bosser MSXML pour
pondre le nouveau fichier XML. Mais je ne vois pas comment �crire le fichier
XSLT correspondant.
Voil�, si vous avez une id�e sur la question je vous remercie d'avance.
A bientot,
Pierre Y.
Technical Details
Message-ID:
<9pca3u$f28$1@wanadoo.fr>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: FRENCH,ASCII X-Google-Thread: 114f60,3aa322f22b3687e6,start X-Google-Attributes: gid114f60,public X-Google-ArrivalTime: 2001-10-02 04:57:53 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!small.news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!not-for-mail From: "Pierre Y." <pierre.crisalid@wanadoo.fr> Newsgroups: fr.comp.text.xml Subject: Ranger un sous-ensemble de noeuds... Date: Tue, 2 Oct 2001 13:57:30 +0200 Organization: Wanadoo, l'internet avec France Telecom Lines: 41 Message-ID: <9pca3u$f28$1@wanadoo.fr> NNTP-Posting-Host: mix-metz-104-2-25.abo.wanadoo.fr X-Trace: wanadoo.fr 1002023870 15432 193.250.151.25 (2 Oct 2001 11:57:50 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 2 Oct 2001 11:57:50 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200