Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

utilisation de LibXml2.

8 réponses
Avatar
programmation
Bonjour,

J'ai bien install=E9 Libxml2 dans mon projet de travail. Il me reste
comment je vais l'utiliser dans mon programme C. De plus, je ne trouve
pas des exemplessimples sous Windows.
Je voudrais lire des informations =E0 partir d'un fichier XML pour les
utiliser apr=E8s dans mon programme C. Ce fichier XML est assez
volumineux. Ce fichier a une structure bien d=E9finie.
En g=E9n=E9ral voici la structure de ce fichier:
On trouve :
- le type de document
- le nombre d'objets, le nombre d'attributs et le nombre des concepts
- le nom de lattice
- la liste des objets
- le liste des attributs
- la liste des concepts

Je m'int=E9resse =E0 liste des concepts dans mon programme C.

Voici en g=E9n=E9ral la structure de ce fichier "nom.lat.xml"
<Galicia_Document>
<Lattice numberObj=3D"5" numberAtt=3D"4" numberCpt=3D"11">
<Name>lattice(essai)</Name>
<Object>3</Object>
.....
<Object>4</Object>
<Attribute>b</Attribute>
........
<Attribute>a</Attribute>
<Concept>
<ID> 1 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
</Intent>
<UpperCovers>
</UpperCovers>
........
.........
.......
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>

</Concept>

Comment je vais positionner sur le dernier identifiant <ID> 11 </ID>
pour extraire toutes les valeurs de balise <Attribute_Ref> </
Attribute_Ref> qui existent entre les deux balises
<Intent> </Intent> ?

<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>


Ces valeurs d, b, c et a je vais les utiliser dans mon programme C.
Aussi de m=EAme, je veux lire les valeurs 10, 8, 9 et 7 entre les deux
balises <Concept_Ref>
</Concept_Ref> qui existent sous les balises <UpperCovers> </
UpperCovers>

<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>

Voici mon fichier XML complet nomm=E9 "essai.lat.xml":

<Galicia_Document>
<Lattice numberObj=3D"5" numberAtt=3D"4" numberCpt=3D"11">
<Name>lattice(essai)</Name>
<Object>3</Object>
<Object>2</Object>
<Object>1</Object>
<Object>5</Object>
<Object>4</Object>
<Attribute>d</Attribute>
<Attribute>b</Attribute>
<Attribute>c</Attribute>
<Attribute>a</Attribute>
<Concept>
<ID> 1 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
</Intent>
<UpperCovers>
</UpperCovers>
</Concept>
<Concept>
<ID> 2 </ID>
<Extent>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 5 </ID>
<Extent>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>b</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 4 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 3 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 8 </ID>
<Extent>
<Object_Ref>1</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>2</Concept_Ref>
<Concept_Ref>4</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 9 </ID>
<Extent>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>5</Concept_Ref>
<Concept_Ref>4</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 6 </ID>
<Extent>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>5</Concept_Ref>
<Concept_Ref>3</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 7 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>4</Concept_Ref>
<Concept_Ref>3</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 10 </ID>
<Extent>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>2</Concept_Ref>
<Concept_Ref>6</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>
</Concept>
</Lattice>
</Galicia_Document>


Donc, comment je vais lire les valeurs d=E9j=E0 cit=E9es =E0 partir de ce
fichier et comment je les mettre (dans des autres variables ou
directement je vais les utiliser) dans mon programme ?

S'il vous pla=EEt, Pouvez-vous m'aider ?

Merci.

8 réponses

Avatar
programmation
On 29 juil, 08:25, programmation wrote:
Bonjour,

J'ai bien installé Libxml2  dans mon projet de travail. Il me reste
comment je vais l'utiliser dans mon programme C. De plus, je ne trouve
pas des exemplessimples sous Windows.
Je voudrais lire des informations à partir d'un fichier XML pour les
utiliser après dans  mon programme C. Ce fichier XML est assez
volumineux. Ce fichier a une structure bien définie.
En général voici la structure de ce fichier:
On trouve :
- le type de document
- le nombre d'objets, le nombre d'attributs et le nombre des concepts
- le nom de lattice
- la liste des objets
- le liste des attributs
- la liste des concepts

Je m'intéresse à liste des concepts dans mon programme C.

Voici en général la structure de ce fichier "nom.lat.xml"
<Galicia_Document>
<Lattice numberObj="5" numberAtt="4" numberCpt="11">
<Name>lattice(essai)</Name>
<Object>3</Object>
.....
<Object>4</Object>
<Attribute>b</Attribute>
........
<Attribute>a</Attribute>
<Concept>
<ID> 1 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
</Intent>
<UpperCovers>
</UpperCovers>
........
.........
.......
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>

</Concept>

Comment je vais positionner sur le dernier identifiant <ID> 11 </ID>
pour extraire toutes les valeurs de balise <Attribute_Ref> </
Attribute_Ref> qui existent entre les deux balises
<Intent> </Intent>  ?

<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>

Ces valeurs d, b, c et a  je vais les utiliser dans mon programme C.
Aussi de même, je veux lire les valeurs 10, 8, 9 et 7 entre les deux
balises <Concept_Ref>
</Concept_Ref> qui existent sous les balises <UpperCovers> </
UpperCovers>

<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>

Voici mon fichier XML complet nommé "essai.lat.xml":

<Galicia_Document>
<Lattice numberObj="5" numberAtt="4" numberCpt="11">
<Name>lattice(essai)</Name>
<Object>3</Object>
<Object>2</Object>
<Object>1</Object>
<Object>5</Object>
<Object>4</Object>
<Attribute>d</Attribute>
<Attribute>b</Attribute>
<Attribute>c</Attribute>
<Attribute>a</Attribute>
<Concept>
<ID> 1 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
</Intent>
<UpperCovers>
</UpperCovers>
</Concept>
<Concept>
<ID> 2 </ID>
<Extent>
<Object_Ref>1</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 5 </ID>
<Extent>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>b</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 4 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>1</Object_Ref>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 3 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>1</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 8 </ID>
<Extent>
<Object_Ref>1</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>2</Concept_Ref>
<Concept_Ref>4</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 9 </ID>
<Extent>
<Object_Ref>4</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>5</Concept_Ref>
<Concept_Ref>4</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 6 </ID>
<Extent>
<Object_Ref>2</Object_Ref>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>5</Concept_Ref>
<Concept_Ref>3</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 7 </ID>
<Extent>
<Object_Ref>3</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>4</Concept_Ref>
<Concept_Ref>3</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 10 </ID>
<Extent>
<Object_Ref>5</Object_Ref>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>2</Concept_Ref>
<Concept_Ref>6</Concept_Ref>
</UpperCovers>
</Concept>
<Concept>
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>
</Concept>
</Lattice>
</Galicia_Document>

Donc, comment je vais lire les valeurs déjà citées à partir de ce
fichier et comment je les mettre (dans des autres variables ou
directement je vais les utiliser) dans mon programme  ?

S'il vous plaît, Pouvez-vous m'aider ?

Merci.



Salut,

Je trouve deux méthodes sans LibXml2 : DOM et SAX.

Laquelle est la plus adaptée surtout je utilise des fichiers
volumineux et je m'intéresse au temps d'exécution le moins possible ?

Merci.
Avatar
Christian ASTOR
On 29 juil, 09:25, programmation wrote:
Bonjour,

J'ai bien installé Libxml2  dans mon projet de travail. Il me reste
comment je vais l'utiliser dans mon programme C. De plus, je ne trouve
pas des exemplessimples sous Windows.



Mais tu n'as absolument pas besoin de libxml !
Je viens de te donner le code pour parser avec les interfaces
Windows !
On dirait que ne lis aucune des réponses.
Avatar
programmation
On 29 juil, 12:16, programmation wrote:
On 29 juil, 08:25, programmation wrote:



> Bonjour,

> J'ai bien installé Libxml2  dans mon projet de travail. Il me reste
> comment je vais l'utiliser dans mon programme C. De plus, je ne trouve
> pas des exemplessimples sous Windows.
> Je voudrais lire des informations à partir d'un fichier XML pour les
> utiliser après dans  mon programme C. Ce fichier XML est assez
> volumineux. Ce fichier a une structure bien définie.
> En général voici la structure de ce fichier:
> On trouve :
> - le type de document
> - le nombre d'objets, le nombre d'attributs et le nombre des concepts
> - le nom de lattice
> - la liste des objets
> - le liste des attributs
> - la liste des concepts

> Je m'intéresse à liste des concepts dans mon programme C.

> Voici en général la structure de ce fichier "nom.lat.xml"
> <Galicia_Document>
> <Lattice numberObj="5" numberAtt="4" numberCpt="11">
> <Name>lattice(essai)</Name>
> <Object>3</Object>
> .....
> <Object>4</Object>
> <Attribute>b</Attribute>
> ........
> <Attribute>a</Attribute>
> <Concept>
> <ID> 1 </ID>
> <Extent>
> <Object_Ref>3</Object_Ref>
> <Object_Ref>2</Object_Ref>
> <Object_Ref>1</Object_Ref>
> <Object_Ref>5</Object_Ref>
> <Object_Ref>4</Object_Ref>
> </Extent>
> <Intent>
> </Intent>
> <UpperCovers>
> </UpperCovers>
> ........
> .........
> .......
> <ID> 11 </ID>
> <Extent>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>b</Attribute_Ref>
> <Attribute_Ref>c</Attribute_Ref>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>10</Concept_Ref>
> <Concept_Ref>8</Concept_Ref>
> <Concept_Ref>9</Concept_Ref>
> <Concept_Ref>7</Concept_Ref>
> </UpperCovers>

> </Concept>

> Comment je vais positionner sur le dernier identifiant <ID> 11 </ID>
> pour extraire toutes les valeurs de balise <Attribute_Ref> </
> Attribute_Ref> qui existent entre les deux balises
> <Intent> </Intent>  ?

> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>b</Attribute_Ref>
> <Attribute_Ref>c</Attribute_Ref>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>

> Ces valeurs d, b, c et a  je vais les utiliser dans mon programme C.
> Aussi de même, je veux lire les valeurs 10, 8, 9 et 7 entre les deux
> balises <Concept_Ref>
> </Concept_Ref> qui existent sous les balises <UpperCovers> </
> UpperCovers>

> <UpperCovers>
> <Concept_Ref>10</Concept_Ref>
> <Concept_Ref>8</Concept_Ref>
> <Concept_Ref>9</Concept_Ref>
> <Concept_Ref>7</Concept_Ref>
> </UpperCovers>

> Voici mon fichier XML complet nommé "essai.lat.xml":

> <Galicia_Document>
> <Lattice numberObj="5" numberAtt="4" numberCpt="11">
> <Name>lattice(essai)</Name>
> <Object>3</Object>
> <Object>2</Object>
> <Object>1</Object>
> <Object>5</Object>
> <Object>4</Object>
> <Attribute>d</Attribute>
> <Attribute>b</Attribute>
> <Attribute>c</Attribute>
> <Attribute>a</Attribute>
> <Concept>
> <ID> 1 </ID>
> <Extent>
> <Object_Ref>3</Object_Ref>
> <Object_Ref>2</Object_Ref>
> <Object_Ref>1</Object_Ref>
> <Object_Ref>5</Object_Ref>
> <Object_Ref>4</Object_Ref>
> </Extent>
> <Intent>
> </Intent>
> <UpperCovers>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 2 </ID>
> <Extent>
> <Object_Ref>1</Object_Ref>
> <Object_Ref>5</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>1</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 5 </ID>
> <Extent>
> <Object_Ref>2</Object_Ref>
> <Object_Ref>5</Object_Ref>
> <Object_Ref>4</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>b</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>1</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 4 </ID>
> <Extent>
> <Object_Ref>3</Object_Ref>
> <Object_Ref>1</Object_Ref>
> <Object_Ref>4</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>c</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>1</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 3 </ID>
> <Extent>
> <Object_Ref>3</Object_Ref>
> <Object_Ref>2</Object_Ref>
> <Object_Ref>5</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>1</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 8 </ID>
> <Extent>
> <Object_Ref>1</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>c</Attribute_Ref>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>2</Concept_Ref>
> <Concept_Ref>4</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 9 </ID>
> <Extent>
> <Object_Ref>4</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>b</Attribute_Ref>
> <Attribute_Ref>c</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>5</Concept_Ref>
> <Concept_Ref>4</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 6 </ID>
> <Extent>
> <Object_Ref>2</Object_Ref>
> <Object_Ref>5</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>b</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>5</Concept_Ref>
> <Concept_Ref>3</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 7 </ID>
> <Extent>
> <Object_Ref>3</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>c</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>4</Concept_Ref>
> <Concept_Ref>3</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 10 </ID>
> <Extent>
> <Object_Ref>5</Object_Ref>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>b</Attribute_Ref>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>2</Concept_Ref>
> <Concept_Ref>6</Concept_Ref>
> </UpperCovers>
> </Concept>
> <Concept>
> <ID> 11 </ID>
> <Extent>
> </Extent>
> <Intent>
> <Attribute_Ref>d</Attribute_Ref>
> <Attribute_Ref>b</Attribute_Ref>
> <Attribute_Ref>c</Attribute_Ref>
> <Attribute_Ref>a</Attribute_Ref>
> </Intent>
> <UpperCovers>
> <Concept_Ref>10</Concept_Ref>
> <Concept_Ref>8</Concept_Ref>
> <Concept_Ref>9</Concept_Ref>
> <Concept_Ref>7</Concept_Ref>
> </UpperCovers>
> </Concept>
> </Lattice>
> </Galicia_Document>

> Donc, comment je vais lire les valeurs déjà citées à partir de ce
> fichier et comment je les mettre (dans des autres variables ou
> directement je vais les utiliser) dans mon programme  ?

> S'il vous plaît, Pouvez-vous m'aider ?

> Merci.

Salut,

Je trouve deux méthodes sans LibXml2 : DOM et SAX.

Laquelle est la plus adaptée surtout je utilise des fichiers
volumineux et je m'intéresse au temps d'exécution le moins possible ?

Merci.



Salut,

Je vais travailler avec SAX .
Comment je vais utiliser SAX pour trouver les informations qui j'ai
déjà les cité ?

Merci.
Avatar
programmation
On 29 juil, 13:54, Christian ASTOR wrote:
On 29 juil, 09:25, programmation wrote:

> Bonjour,

> J'ai bien installé Libxml2  dans mon projet de travail. Il me reste
> comment je vais l'utiliser dans mon programme C. De plus, je ne trouve
> pas des exemplessimples sous Windows.

Mais tu n'as absolument pas besoin de libxml !
Je viens de te donner le code pour parser avec les interfaces
Windows !
On dirait que ne lis aucune des réponses.



Salut,

MSXML est basée sur la méthode DOM. Or, DOM est adaptée au fichiers d e
taille petite de plus il y a la navigation dans l'arbre c'est vraie
c'est simple de chercher l'information par rapport à la méthode SAX.
Mais, le but de mon travail est de manipuler des fichiers de taille
grande. De plus, je m'intéresse au temps d'exécution qui je voulais le
moins possible.

Aussi, je ne vais pas modifier le fichier XML. Mais, je vais lire
seulement des informations entre les balises de ce fichier pour les
utiliser après dans mon programme C.
Pour cela, j'ai vu que la méthode SAX est plus convenable à mon
problème.

Je ne sais pas si MSXML implémente la méthoe SAX.

Quelle est votre proposition ?
Avatar
Christian ASTOR
On 29 juil, 16:48, programmation wrote:

Je ne sais pas si MSXML implémente la méthoe SAX.



Oui, je viens juste de répondre dans l'autre thread (tu poses n fois
la même question..)
Avatar
programmation
On 29 juil, 16:49, Christian ASTOR wrote:
On 29 juil, 16:48, programmation wrote:

> Je ne sais pas si MSXML implémente la méthoe SAX.

Oui, je viens juste de répondre dans l'autre thread (tu poses n fois
la même question..)



Salut,

C'est vraie dans cet exemple "essai.lat.xml" n'est pas de grande
taille. Mais, en réalité je travaille sur des fichiers qui contiennent
des centaines des concepts. De plus, je m'intéresse au temps
d'exécution le moins possible.
Je vois que vous préférez la méthode DOM. Est que DOM est simple que
SAX dans le traitement ?

- Est ce que ce mieux d'utiliser DOM ou SAX dans mon cas ?

- Pouvez vous m'expliquer pas à pas (comme par exemple dans le
traitement d'un fichier texte simple: ouvrir, lire, traiter et fermer)
comment je vais travailler avec MSXML (DOM ou SAX selon mon cas) car
je n'arrive pas à exploiter votre solution dans mon problème ?

- Comment je vais trouver les informations déjà citées au dessus en
appliquant votre solution ?

- Pouvez me donner le programme C qui me permet de trouver ces
informations sachant que vous avez le fichier "essai.lat.xml" au
dessus pour que je puisse bien vous comprendre ?

Merci.
Avatar
programmation
On 30 juil, 14:02, programmation wrote:
On 29 juil, 16:49, Christian ASTOR wrote:

> On 29 juil, 16:48, programmation wrote:

> > Je ne sais pas si MSXML implémente la méthoe SAX.

> Oui, je viens juste de répondre dans l'autre thread (tu poses n fois
> la même question..)

Salut,

C'est vraie dans cet exemple "essai.lat.xml" n'est pas de grande
taille. Mais, en réalité je travaille sur des fichiers qui contiennen t
des centaines des concepts. De plus, je m'intéresse au temps
d'exécution le moins possible.
Je vois que vous préférez la méthode DOM. Est que DOM est simple qu e
SAX dans le traitement ?

- Est ce que ce mieux d'utiliser DOM ou SAX dans mon cas ?

- Pouvez vous m'expliquer pas à pas (comme par exemple dans le
traitement d'un fichier texte simple: ouvrir, lire, traiter et fermer)
comment je vais travailler avec MSXML (DOM ou SAX selon mon cas) car
je n'arrive pas à exploiter votre solution dans mon problème ?

- Comment je vais trouver les informations déjà citées au dessus en
appliquant votre solution ?

- Pouvez me donner le programme C qui me permet de trouver ces
informations sachant que vous avez le fichier "essai.lat.xml" au
dessus pour que je puisse bien vous comprendre ?

Merci.



Bonjour,

J'ai lu la documentation de MSXML (DOM et SAX). Mais je ne trouve pas
comment je vais extraire les informations qui existent dans mon
fichier XML à partir du mon programme C.
Vue que la première fois que je parse un fichier XML alors je ne
comprends pas le principe de le faire. par exemple dans la
manipulation de fichier texte. Il faut:
- tester l'existence du fichier
- ouvrir le fichier
- lire le fichier
- traitement
- fermeture.

Par analogie comment je vais lire les informations existant dans la
dernière balise de mon fichier XML ?

Je m'intéresse au cette partie (dernière balise "concep") du mon
fichier :

<Concept>
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>
</Concept>

Je voudrais stocker les valeurs qui existent entre les sous balises
pour les utiliser dans mon programme C.

- <Extent> </Extent>
- <Attribute_Ref> </Attribute_Ref>
- <UpperCovers> </UpperCovers>

Comment je vais extraire ces valeurs ?

C'est urgent. Aidez-moi je suis bloqué.

Merci.
Avatar
programmation
On 4 août, 09:39, programmation wrote:
On 30 juil, 14:02, programmation wrote:



> On 29 juil, 16:49, Christian ASTOR wrote:

> > On 29 juil, 16:48, programmation wrote:

> > > Je ne sais pas si MSXML implémente la méthoe SAX.

> > Oui, je viens juste de répondre dans l'autre thread (tu poses n foi s
> > la même question..)

> Salut,

> C'est vraie dans cet exemple "essai.lat.xml" n'est pas de grande
> taille. Mais, en réalité je travaille sur des fichiers qui contienn ent
> des centaines des concepts. De plus, je m'intéresse au temps
> d'exécution le moins possible.
> Je vois que vous préférez la méthode DOM. Est que DOM est simple que
> SAX dans le traitement ?

> - Est ce que ce mieux d'utiliser DOM ou SAX dans mon cas ?

> - Pouvez vous m'expliquer pas à pas (comme par exemple dans le
> traitement d'un fichier texte simple: ouvrir, lire, traiter et fermer)
> comment je vais travailler avec MSXML (DOM ou SAX selon mon cas) car
> je n'arrive pas à exploiter votre solution dans mon problème ?

> - Comment je vais trouver les informations déjà citées au dessus en
> appliquant votre solution ?

> - Pouvez me donner le programme C qui me permet de trouver ces
> informations sachant que vous avez le fichier "essai.lat.xml" au
> dessus pour que je puisse bien vous comprendre ?

> Merci.

Bonjour,

J'ai lu la documentation de MSXML (DOM et SAX). Mais je ne trouve pas
comment je vais extraire les informations qui existent dans mon
fichier XML à partir du mon programme C.
Vue que la première fois que je parse un fichier XML alors je ne
comprends pas le principe de le faire. par exemple dans la
manipulation de fichier texte. Il faut:
- tester l'existence du fichier
- ouvrir le fichier
- lire le fichier
- traitement
- fermeture.

Par analogie comment je vais lire les informations existant  dans la
dernière balise de mon fichier XML ?

Je m'intéresse au cette partie (dernière balise "concep") du mon
fichier :

<Concept>
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>
</Concept>

Je voudrais stocker les valeurs qui existent entre les sous balises
pour les utiliser dans mon programme C.

- <Extent> </Extent>
- <Attribute_Ref>  </Attribute_Ref>
- <UpperCovers>  </UpperCovers>

Comment je vais extraire ces valeurs ?

C'est urgent. Aidez-moi je suis bloqué.

Merci.



Bonjour,

J'ai lu plusieurs fois la documentation de libxml2 (DOM et SAX). Mais
je ne trouve pas comment je vais extraire les informations qui
existent dans mon
fichier XML à partir du mon programme C.
Vue que la première fois que je parse un fichier XML alors je ne
comprends pas le principe de le faire. par exemple dans la
manipulation de fichier texte. Il faut:
- tester l'existence du fichier
- ouvrir le fichier
- lire le fichier
- traitement
- fermeture.

Par analogie comment je vais lire les informations existant dans la
dernière balise de mon fichier XML ?

Je m'intéresse au cette partie (dernière balise "concept") du mon
fichier :

<Concept>
<ID> 11 </ID>
<Extent>
</Extent>
<Intent>
<Attribute_Ref>d</Attribute_Ref>
<Attribute_Ref>b</Attribute_Ref>
<Attribute_Ref>c</Attribute_Ref>
<Attribute_Ref>a</Attribute_Ref>
</Intent>
<UpperCovers>
<Concept_Ref>10</Concept_Ref>
<Concept_Ref>8</Concept_Ref>
<Concept_Ref>9</Concept_Ref>
<Concept_Ref>7</Concept_Ref>
</UpperCovers>
</Concept>

Je voudrais stocker les valeurs qui existent entre les sous balises
pour les utiliser dans mon programme C.

- <Extent> </Extent>
- <Attribute_Ref> </Attribute_Ref>
- <UpperCovers> </UpperCovers>

Comment je vais extraire ces valeurs ?

C'est urgent. Aidez-moi je suis bloqué.

Merci.