J'ai un petit problème dans la génération de la balise principale de mon fichier. Cela doit être dans cet ordre:
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 <?xml version="1.0" encoding="UTF-8"?> <FctAssain xsi:schemaLocation="http://xml.sandre.eaufrance.fr/scenario/fct_assain/3 http://xml.sandre.eaufrance.fr/scenario/fct_assain/3/sandre_sc_fct_assain.xsd" xmlns="http://xml.sandre.eaufrance.fr/scenario/fct_assain/3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
mais tout ce que j'arrive à faire c'est:
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 <?xml version="1.0" encoding="utf-8"?> <FctAssain xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xml.sandre.eaufrance.fr/scenario/fct_assain/3 http://xml.sandre.eaufrance.fr/scenario/fct_assain/3/sandre_sc_fct_assain.xsd" xmlns="http://xml.sandre.eaufrance.fr/scenario/fct_assain/3">
l'ordre indiqué en premier doit être rigoureusement respecté car sinon le programme, non développé par la boîte, ne peut pas le lire le fichier XML
Je fait comme ceci:
Code vbnet : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 '* Ajout de l'en-tête XML standard _writer.WriteStartDocument() '* Ajout de l'élément parent et les chemins de schémas _writer.WriteStartElement("FctAssain", "http://xml.sandre.eaufrance.fr/scenario/fct_assain/3") _writer.WriteAttributeString("xmlns", "xsi", Nothing, "http://www.w3.org/2001/XMLSchema-instance") _writer.WriteAttributeString("xsi", "schemaLocation", Nothing, "http://xml.sandre.eaufrance.fr/scenario/fct_assain/3 http://xml.sandre.eaufrance.fr/scenario/fct_assain/3/sandre_sc_fct_assain.xsd")
Je ne vois pas trop comment mettre les différents chemins dans le bon ordre
Partager