|
FORUMS PROFESSIONNELS WINDEV, WEBDEV et WINDEV Mobile |
| | | | | |
Débuté par JUPETON, 05 oct. 2025 19:24 - 3 réponses |
| |
| | | |
|
| |
Membre enregistré 3 messages |
|
Posté le 05 octobre 2025 - 19:24 |
bonjour à tous je vous partage le contenu d'un fichier XML que je souhaite parcourir pour récupérer les valeurs des balises. j'ai des difficultés !
1- voici mon code wlangage
ResRecherche est une chaîne
ResRecherche = fRep(MyConfig_DossierPharmaML+"\Depot\*"+idPrepaCmde+".xml",frFichier) sXML est une chaîne sXML = fChargeTexte(MyConfig_DossierPharmaML+"\Depot\"+ResRecherche) xNbreRecher est un numérique = 0
xNLign, xQtéLiv, xPrixAch, xPrixVte, xNIDcmde, xIdArt, xDiffQte sont des numériques sCodePrdt, sMotifRupture, sTypeCodeCIP sont des chaîne f, b est un entier = 0
SI sXML = "" ALORS Erreur("Le fichier est vide ou introuvable.") RETOUR FIN
SI PAS xmlDocument("DocXML", sXML) ALORS Erreur("Impossible d’analyser le fichier XML : " + ErreurInfo(errComplet)) RETOUR FIN
XMLRacine("DocXML") XMLRecherche("DocXML", Null, XMLElement + XMLSousElément) TANTQUE XMLTrouve("DocXML") SI XMLTypeElement("DocXML") = XMLBalise ALORS
SI XMLNomElément("DocXML") = "LIGNE_N" ALORS xNLign = Val(XMLLit("DocXML","Num_Ligne")) sCodePrdt = XMLLit("DocXML","Code_Produit") xQtéLiv = Val(XMLLit("DocXML","Quantite_livree")) FIN
SI XMLNomElément("DocXML") = "PRIX_N" ALORS sNature est une chaîne = XMLLit("DocXML","Nature") sValeur est une chaîne = XMLLit("DocXML","Valeur") SELON sNature CAS "PHAHT" : xPrixAch = Val(sValeur) CAS "PUBTC" : xPrixVte = Val(sValeur) FIN FIN
SI XMLNomElément("DocXML") = "INDISPONIBILITE_N" ALORS sMotifRupture = XMLLit("DocXML","Additif") FIN
Trace("Ligne : "+ xNLign+ " | sCode : "+ sCodePrdt+" | nQte : "+ xQtéLiv+" | xPrixAch : "+ xPrixAch+" | xPrixVte : "+ xPrixVte+" | sIndispo : "+ sMotifRupture)
FIN XMLSuivant("DocXML") FIN
2- VOICI LE CONTENU DU FICHIER XML
This XML file does not appear to have any style information associated with it. The document tree is shown below. <MESSAGE_REPARTITEURCORPSREP_COMMANDE xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Ref_Cde_Client="24092515500000000186"> <NORMALE xmlns="urn:x-csrp:fr.csrp.protocole:message"> <LIGNE_N Num_Ligne="1" Num_Ligne_Commande="1" Type_Codification="EAN13" Code_Produit="3000000218495" Designation="3000000218495" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="2938.000"/> <PRIX_N Nature="PUBTC" Valeur="4436.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="2" Num_Ligne_Commande="2" Type_Codification="EAN13" Code_Produit="3400933354978" Designation="3400933354978" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1624.000"/> <PRIX_N Nature="PUBTC" Valeur="2450.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="3" Num_Ligne_Commande="3" Type_Codification="CIP39" Code_Produit="5859818" Designation="5859818" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="4" Num_Ligne_Commande="4" Type_Codification="CIP39" Code_Produit="8229676" Designation="8229676" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="799.000"/> <PRIX_N Nature="PUBTC" Valeur="1020.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="5" Num_Ligne_Commande="5" Type_Codification="CIP39" Code_Produit="9997451" Designation="9997451" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="6" Num_Ligne_Commande="6" Type_Codification="CIP39" Code_Produit="2019475" Designation="2019475" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="408.000"/> <PRIX_N Nature="PUBTC" Valeur="620.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="7" Num_Ligne_Commande="7" Type_Codification="EAN13" Code_Produit="3000000550045" Designation="3000000550045" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2426.000"/> <PRIX_N Nature="PUBTC" Valeur="3664.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="8" Num_Ligne_Commande="8" Type_Codification="CIP39" Code_Produit="8419081" Designation="8419081" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="1642.000"/> <PRIX_N Nature="PUBTC" Valeur="2480.000"/> <PRIX_N Nature="TFR" Valeur="42.030"/> </LIGNE_N> <LIGNE_N Num_Ligne="9" Num_Ligne_Commande="9" Type_Codification="EAN13" Code_Produit="3000000397954" Designation="3000000397954" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="3157.000"/> <PRIX_N Nature="PUBTC" Valeur="4770.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="10" Num_Ligne_Commande="10" Type_Codification="EAN13" Code_Produit="3000000706435" Designation="3000000706435" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="2737.000"/> <PRIX_N Nature="PUBTC" Valeur="4130.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="11" Num_Ligne_Commande="11" Type_Codification="EAN13" Code_Produit="3000000381731" Designation="3000000381731" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="12" Num_Ligne_Commande="12" Type_Codification="CIP39" Code_Produit="3271780" Designation="3271780" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2591.000"/> <PRIX_N Nature="PUBTC" Valeur="3910.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="13" Num_Ligne_Commande="13" Type_Codification="EAN13" Code_Produit="3000000460641" Designation="3000000460641" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="6386.000"/> <PRIX_N Nature="PUBTC" Valeur="9640.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="14" Num_Ligne_Commande="14" Type_Codification="CIP39" Code_Produit="8073754" Designation="8073754" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="7754.000"/> <PRIX_N Nature="PUBTC" Valeur="11710.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="15" Num_Ligne_Commande="15" Type_Codification="CIP39" Code_Produit="3412447" Designation="3412447" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2226.000"/> <PRIX_N Nature="PUBTC" Valeur="3361.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="16" Num_Ligne_Commande="16" Type_Codification="CIP39" Code_Produit="8211995" Designation="8211995" Quantite_livree="0" Commentaire="COMPRES STER LABELL 30X30 *NTP"> <INDISPONIBILITE_N Code_Reponse="0002" Additif="Pas en stock - Ne tenons pas"/> </LIGNE_N> <LIGNE_N Num_Ligne="17" Num_Ligne_Commande="17" Type_Codification="CIP39" Code_Produit="8017170" Designation="8017170" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="730.000"/> <PRIX_N Nature="PUBTC" Valeur="1100.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="18" Num_Ligne_Commande="18" Type_Codification="CIP39" Code_Produit="4577644" Designation="4577644" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="19" Num_Ligne_Commande="19" Type_Codification="CIP39" Code_Produit="8054231" Designation="8054231" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="666.000"/> <PRIX_N Nature="PUBTC" Valeur="1010.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="20" Num_Ligne_Commande="20" Type_Codification="EAN13" Code_Produit="3000000197554" Designation="3000000197554" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="21" Num_Ligne_Commande="21" Type_Codification="CIP39" Code_Produit="8091137" Designation="8091137" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="1779.000"/> <PRIX_N Nature="PUBTC" Valeur="2690.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="22" Num_Ligne_Commande="22" Type_Codification="CIP39" Code_Produit="2031068" Designation="2031068" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1843.000"/> <PRIX_N Nature="PUBTC" Valeur="2783.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="23" Num_Ligne_Commande="23" Type_Codification="CIP39" Code_Produit="2030695" Designation="2030695" Quantite_livree="0" Commentaire="GAMALATE B6 SOL F/80ML BF*FA*"> <INDISPONIBILITE_N Code_Reponse="0003" Additif="Ne se fait plus"/> </LIGNE_N> <LIGNE_N Num_Ligne="24" Num_Ligne_Commande="24" Type_Codification="EAN13" Code_Produit="3000000271551" Designation="3000000271551" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="25" Num_Ligne_Commande="25" Type_Codification="EAN13" Code_Produit="3000000941416" Designation="3000000941416" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1633.000"/> <PRIX_N Nature="PUBTC" Valeur="2470.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="26" Num_Ligne_Commande="26" Type_Codification="CIP39" Code_Produit="8644955" Designation="8644955" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="976.000"/> <PRIX_N Nature="PUBTC" Valeur="1470.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="27" Num_Ligne_Commande="27" Type_Codification="CIP39" Code_Produit="8455993" Designation="8455993" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="28" Num_Ligne_Commande="28" Type_Codification="CIP39" Code_Produit="3000000227" Designation="3000000227" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0053" Additif="Code produit incorrect"/> </LIGNE_N> <LIGNE_N Num_Ligne="29" Num_Ligne_Commande="29" Type_Codification="EAN13" Code_Produit="3000000240403" Designation="3000000240403" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="3467.000"/> <PRIX_N Nature="PUBTC" Valeur="5240.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="30" Num_Ligne_Commande="30" Type_Codification="CIP39" Code_Produit="8015550" Designation="8015550" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="693.000"/> <PRIX_N Nature="PUBTC" Valeur="1050.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="31" Num_Ligne_Commande="31" Type_Codification="EAN13" Code_Produit="3000000047255" Designation="3000000047255" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="32" Num_Ligne_Commande="32" Type_Codification="EAN13" Code_Produit="3000000720202" Designation="3000000720202" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="33" Num_Ligne_Commande="33" Type_Codification="CIP39" Code_Produit="3098614" Designation="3098614" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1679.000"/> <PRIX_N Nature="PUBTC" Valeur="2540.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="34" Num_Ligne_Commande="34" Type_Codification="EAN13" Code_Produit="3000000258545" Designation="3000000258545" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1314.000"/> <PRIX_N Nature="PUBTC" Valeur="1980.000"/> <PRIX_N Nature="TFR" Valeur="22.400"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="35" Num_Ligne_Commande="35" Type_Codification="CIP39" Code_Produit="8076190" Designation="8076190" Quantite_livree="3"> <PRIX_N Nature="PHAHT" Valeur="1425.000"/> <PRIX_N Nature="PUBTC" Valeur="2150.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="36" Num_Ligne_Commande="36" Type_Codification="EAN13" Code_Produit="3000000077290" Designation="3000000077290" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="37" Num_Ligne_Commande="37" Type_Codification="EAN13" Code_Produit="3000000718094" Designation="3000000718094" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="38" Num_Ligne_Commande="38" Type_Codification="CIP39" Code_Produit="8050836" Designation="8050836" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1752.000"/> <PRIX_N Nature="PUBTC" Valeur="2645.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"> <PRODUIT_REMPLACANT Type_Remplacement="RL"/> </INDISPONIBILITE_N> </LIGNE_N> <LIGNE_N Num_Ligne="39" Num_Ligne_Commande="39" Type_Codification="CIP39" Code_Produit="8089519" Designation="8089519" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="1916.000"/> <PRIX_N Nature="PUBTC" Valeur="2893.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="40" Num_Ligne_Commande="40" Type_Codification="CIP39" Code_Produit="3945037" Designation="3945037" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="3649.000"/> <PRIX_N Nature="PUBTC" Valeur="5510.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="41" Num_Ligne_Commande="41" Type_Codification="EAN13" Code_Produit="3000000428580" Designation="3000000428580" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="775.000"/> <PRIX_N Nature="PUBTC" Valeur="1170.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="42" Num_Ligne_Commande="42" Type_Codification="EAN13" Code_Produit="3000001228424" Designation="3000001228424" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="43" Num_Ligne_Commande="43" Type_Codification="CIP39" Code_Produit="3179293" Designation="3179293" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1834.000"/> <PRIX_N Nature="PUBTC" Valeur="2770.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="44" Num_Ligne_Commande="44" Type_Codification="CIP39" Code_Produit="1667581" Designation="1667581" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2554.000"/> <PRIX_N Nature="PUBTC" Valeur="3860.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="45" Num_Ligne_Commande="45" Type_Codification="CIP39" Code_Produit="8003245" Designation="8003245" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1186.000"/> <PRIX_N Nature="PUBTC" Valeur="1791.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="46" Num_Ligne_Commande="46" Type_Codification="EAN13" Code_Produit="3400935455048" Designation="3400935455048" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="2600.000"/> <PRIX_N Nature="PUBTC" Valeur="3930.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="47" Num_Ligne_Commande="47" Type_Codification="CIP39" Code_Produit="254556" Designation="254556" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0053" Additif="Code produit incorrect"/> </LIGNE_N> <LIGNE_N Num_Ligne="48" Num_Ligne_Commande="48" Type_Codification="EAN13" Code_Produit="3000000551110" Designation="3000000551110" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="2281.000"/> <PRIX_N Nature="PUBTC" Valeur="3440.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="49" Num_Ligne_Commande="49" Type_Codification="CIP39" Code_Produit="2277378" Designation="2277378" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="3639.000"/> <PRIX_N Nature="PUBTC" Valeur="5495.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="50" Num_Ligne_Commande="50" Type_Codification="EAN13" Code_Produit="3000000403785" Designation="3000000403785" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="867.000"/> <PRIX_N Nature="PUBTC" Valeur="1310.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="51" Num_Ligne_Commande="51" Type_Codification="EAN13" Code_Produit="3000000906200" Designation="3000000906200" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="52" Num_Ligne_Commande="52" Type_Codification="EAN13" Code_Produit="3000000161401" Designation="3000000161401" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="53" Num_Ligne_Commande="53" Type_Codification="CIP39" Code_Produit="8005497" Designation="8005497" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1140.000"/> <PRIX_N Nature="PUBTC" Valeur="1720.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="54" Num_Ligne_Commande="54" Type_Codification="EAN13" Code_Produit="3000000356272" Designation="3000000356272" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="55" Num_Ligne_Commande="55" Type_Codification="EAN13" Code_Produit="3000000787380" Designation="3000000787380" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="2281.000"/> <PRIX_N Nature="PUBTC" Valeur="3440.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="56" Num_Ligne_Commande="56" Type_Codification="CIP39" Code_Produit="36377550" Designation="36377550" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0053" Additif="Code produit incorrect"/> </LIGNE_N> <LIGNE_N Num_Ligne="57" Num_Ligne_Commande="57" Type_Codification="CIP39" Code_Produit="8061633" Designation="8061633" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="466.000"/> <PRIX_N Nature="PUBTC" Valeur="700.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="58" Num_Ligne_Commande="58" Type_Codification="CIP39" Code_Produit="3230901" Designation="3230901" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2080.000"/> <PRIX_N Nature="PUBTC" Valeur="3141.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="59" Num_Ligne_Commande="59" Type_Codification="CIP39" Code_Produit="1134581" Designation="1134581" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="8210.000"/> <PRIX_N Nature="PUBTC" Valeur="12400.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="60" Num_Ligne_Commande="60" Type_Codification="EAN13" Code_Produit="3000000146262" Designation="3000000146262" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="61" Num_Ligne_Commande="61" Type_Codification="CIP39" Code_Produit="3158753" Designation="3158753" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1140.000"/> <PRIX_N Nature="PUBTC" Valeur="1720.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="62" Num_Ligne_Commande="62" Type_Codification="EAN13" Code_Produit="3990000011274" Designation="3990000011274" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="693.000"/> <PRIX_N Nature="PUBTC" Valeur="1050.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="63" Num_Ligne_Commande="63" Type_Codification="EAN13" Code_Produit="3000000202364" Designation="3000000202364" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="64" Num_Ligne_Commande="64" Type_Codification="CIP39" Code_Produit="6691509" Designation="6691509" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2232.000"/> <PRIX_N Nature="PUBTC" Valeur="3400.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="65" Num_Ligne_Commande="65" Type_Codification="CIP39" Code_Produit="8216225" Designation="8216225" Quantite_livree="2"> <PRIX_N Nature="PHAHT" Valeur="985.000"/> <PRIX_N Nature="PUBTC" Valeur="1370.000"/> <PRIX_N Nature="LPPR" Valeur="22.400"/> </LIGNE_N> <LIGNE_N Num_Ligne="66" Num_Ligne_Commande="66" Type_Codification="CIP39" Code_Produit="8654497" Designation="8654497" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="67" Num_Ligne_Commande="67" Type_Codification="CIP39" Code_Produit="6554745" Designation="6554745" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1856.000"/> <PRIX_N Nature="PUBTC" Valeur="2800.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="68" Num_Ligne_Commande="68" Type_Codification="CIP39" Code_Produit="6607370" Designation="6607370" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2367.000"/> <PRIX_N Nature="PUBTC" Valeur="3030.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="69" Num_Ligne_Commande="69" Type_Codification="CIP39" Code_Produit="8906064000" Designation="8906064000" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0053" Additif="Code produit incorrect"/> </LIGNE_N> <LIGNE_N Num_Ligne="70" Num_Ligne_Commande="70" Type_Codification="CIP39" Code_Produit="3316005" Designation="3316005" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="943.000"/> <PRIX_N Nature="PUBTC" Valeur="1420.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="71" Num_Ligne_Commande="71" Type_Codification="EAN13" Code_Produit="3000000164464" Designation="3000000164464" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1250.000"/> <PRIX_N Nature="PUBTC" Valeur="1887.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="72" Num_Ligne_Commande="72" Type_Codification="CIP39" Code_Produit="8296566" Designation="8296566" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1526.000"/> <PRIX_N Nature="PUBTC" Valeur="1820.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"> <PRODUIT_REMPLACANT Type_Remplacement="RL"/> </INDISPONIBILITE_N> </LIGNE_N> <LIGNE_N Num_Ligne="73" Num_Ligne_Commande="73" Type_Codification="CIP39" Code_Produit="6052222" Designation="6052222" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1675.000"/> <PRIX_N Nature="PUBTC" Valeur="1990.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="74" Num_Ligne_Commande="74" Type_Codification="EAN13" Code_Produit="3990000011250" Designation="3990000011250" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2518.000"/> <PRIX_N Nature="PUBTC" Valeur="3800.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="75" Num_Ligne_Commande="75" Type_Codification="CIP39" Code_Produit="8147211" Designation="8147211" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1788.000"/> <PRIX_N Nature="PUBTC" Valeur="2700.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> <LIGNE_N Num_Ligne="76" Num_Ligne_Commande="76" Type_Codification="EAN13" Code_Produit="3400933899783" Designation="3400933899783" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="2700.000"/> <PRIX_N Nature="PUBTC" Valeur="4077.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="77" Num_Ligne_Commande="77" Type_Codification="EAN13" Code_Produit="6181100101256" Designation="6181100101256" Quantite_livree="1"> <PRIX_N Nature="PHAHT" Valeur="1232.000"/> <PRIX_N Nature="PUBTC" Valeur="1710.000"/> </LIGNE_N> <LIGNE_N Num_Ligne="78" Num_Ligne_Commande="78" Type_Codification="EAN13" Code_Produit="3000000155707" Designation="3000000155707" Quantite_livree="0"> <INDISPONIBILITE_N Code_Reponse="0001" Additif="Produit inconnu"/> </LIGNE_N> <LIGNE_N Num_Ligne="79" Num_Ligne_Commande="79" Type_Codification="CIP39" Code_Produit="8022923" Designation="8022923" Quantite_livree="0"> <PRIX_N Nature="PHAHT" Valeur="1322.000"/> <PRIX_N Nature="PUBTC" Valeur="2000.000"/> <INDISPONIBILITE_N Code_Reponse="0005" Additif="Manque rayon"/> </LIGNE_N> </NORMALE> </MESSAGE_REPARTITEURCORPSREP_COMMANDE> |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 4 284 messages |
|
Posté le 06 octobre 2025 - 07:33 |
Bonjour, C'est un question récurrente. Le plus simple est de désérialiser. Je te renvoie vers le post 2 d'un thread qui date d'une quinzaine de jours https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/277903-beaucoup-mal-avec-fonctions-xml-noeuds-277928/read.awp Pour info les structures sont les suivantes, à toi de les transformer en classe pour faciliter la manipulation.
'ST@attributes' est une structure 'xmlns:xsi' est une chaîne 'xmlns:xsd' est une chaîne Ref_Cde_Client est une chaîne xmlns est une chaîne Num_Ligne est une chaîne Num_Ligne_Commande est une chaîne Type_Codification est une chaîne Code_Produit est une chaîne Designation est une chaîne Quantite_livree est une chaîne Nature est une chaîne Valeur est une chaîne Code_Reponse est une chaîne Additif est une chaîne Commentaire est une chaîne Type_Remplacement est une chaîne FIN
STPRIX_N est une structure '@attributes' est un 'ST@attributes' FIN
STPRODUIT_REMPLACANT est une structure '@attributes' est un 'ST@attributes' FIN
STINDISPONIBILITE_N est une structure '@attributes' est un 'ST@attributes' PRODUIT_REMPLACANT est un STPRODUIT_REMPLACANT FIN
STLIGNE_N est une structure '@attributes' est un 'ST@attributes' PRIX_N est un tableau de STPRIX_N INDISPONIBILITE_N est un STINDISPONIBILITE_N FIN
STNORMALE est une structure '@attributes' est un 'ST@attributes' LIGNE_N est un tableau de STLIGNE_N FIN
STMESSAGE_REPARTITEURCORPSREP_COMMANDE est une structure '@attributes' est un 'ST@attributes' NORMALE est un STNORMALE FIN
-- Il y a peut être plus simple, mais, ça tourne Quand tout a échoué, utilise l'option RTFMMessage modifié, 06 octobre 2025 - 07:38 |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 3 messages |
|
Posté le 06 octobre 2025 - 11:55 |
Voroltinquo a écrit :
Bonjour, C'est un question récurrente. Le plus simple est de désérialiser. Je te renvoie vers le post 2 d'un thread qui date d'une quinzaine de jours https://forum.pcsoft.fr/fr-FR/pcsoft.fr.windev/277903-beaucoup-mal-avec-fonctions-xml-noeuds-277928/read.awpPour info les structures sont les suivantes, à toi de les transformer en classe pour faciliter la manipulation. 'ST@attributes' est une structure 'xmlns:xsi' est une chaîne 'xmlns:xsd' est une chaîne Ref_Cde_Client est une chaîne xmlns est une chaîne Num_Ligne est une chaîne Num_Ligne_Commande est une chaîne Type_Codification est une chaîne Code_Produit est une chaîne Designation est une chaîne Quantite_livree est une chaîne Nature est une chaîne Valeur est une chaîne Code_Reponse est une chaîne Additif est une chaîne Commentaire est une chaîne Type_Remplacement est une chaîne FIN
STPRIX_N est une structure '@attributes' est un 'ST@attributes' FIN
STPRODUIT_REMPLACANT est une structure '@attributes' est un 'ST@attributes' FIN
STINDISPONIBILITE_N est une structure '@attributes' est un 'ST@attributes' PRODUIT_REMPLACANT est un STPRODUIT_REMPLACANT FIN
STLIGNE_N est une structure '@attributes' est un 'ST@attributes' PRIX_N est un tableau de STPRIX_N INDISPONIBILITE_N est un STINDISPONIBILITE_N FIN
STNORMALE est une structure '@attributes' est un 'ST@attributes' LIGNE_N est un tableau de STLIGNE_N FIN
STMESSAGE_REPARTITEURCORPSREP_COMMANDE est une structure '@attributes' est un 'ST@attributes' NORMALE est un STNORMALE FIN -- Il y a peut être plus simple, mais, ça tourne Quand tout a échoué, utilise l'option RTFM
MERCI M.VOROLTINQUO j'implémente et vous reviens |
| |
| |
| | | |
|
| | |
| |
Membre enregistré 49 messages |
|
Posté le 06 octobre 2025 - 14:22 |
Bonjour, Vous pouvez aussi utiliser cette méthode :
xml est un xmlDocument=XMLOuvre(xmlSource) SI ErreurDétectée() ALORS RENVOYER Faux FIN
POUR i=1 _À_ xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N..Occurrence Trace("NumLigne : "+xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N[i]..Attribut["Num_Ligne"] + "Code Produit : "+xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N[i]..Attribut["Code_Produit"]) POUR j=1 _À_ xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N[i].PRIX_N..Occurrence Trace(" - Prix "+xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N[i].PRIX_N[j]..Attribut["Nature"] +" : "+ xml.MESSAGE_REPARTITEURCORPSREP_COMMANDE.NORMALE.LIGNE_N[i].PRIX_N[j]..Attribut["Valeur"]) FIN FIN |
| |
| |
| | | |
|
| | | | |
| | |
| | |
| |
|
|
|