IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

WinDev Discussion :

Génération XML - XSD et Table Hyperfile


Sujet :

WinDev

  1. #1
    Membre confirmé Avatar de _shuriken_
    Homme Profil pro
    Inscrit en
    Mars 2006
    Messages
    543
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2006
    Messages : 543
    Points : 454
    Points
    454
    Par défaut Génération XML - XSD et Table Hyperfile
    Bonjour à tous,

    Je reviens vers vous encore avec un casse tête (je l'espère pas).

    On me demande encore de produire un fichier XML, j'ai juste eu droit à : récupères les infos du SI et sert toi de la structure XSD que voici pour générer ta sortie, deadline : 1 semaine (fourni par la banque centrale, qui a besoin des informations de crédits des clients pour le Mois M-1, 1 semaine ouvrable pendant le mois en cours.)

    Bref, je tâtonne un peu sur la façon de faire :

    • J'ai importé mes infos dans une table HPFSQL.
    • Intégré le XSD fournit par la banque centrale dans le projet


    j'ai commencé le codage et franchement, ma logique ne me semble pas être la bonne. Ci-dessous un bout de code.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    xsdBIC est un xmlDocument , description = "3_BCEAO 25-05-2015"
     
    bRes est un booléen 
     
     
     
    bRes = XMLDocument("Contracts",xsdBIC)
     
    SI bRes = Faux ALORS
    	Erreur("Le problème suivant a été détecté : " + ErreurInfo())
    SINON
     
    	Info("Le document a bien été créé. Il est prêt à être utilisé.")
     
    FIN
     
    //Reconstruction de la chaine XML
     
    sXmlversion est une chaîne
    //xsdBIC.Batch.BatchIdentifier = "DSIBNDA_201506_M_DEF_1_XML"
     
    //Balise principale
    	XMLAjouteAttribut(xsdBIC, sXmlversion,"1.0")
    	XMLAjouteAttribut(xsdBIC,xsdBIC.Batch.BatchIdentifier,"DSIBNDA_201506_M_DEF_1_XML")
    	XMLAjouteAttribut(xsdBIC,xsdBIC.Batch.Contract)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralCode)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralDescription)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralType)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralValue)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralValue.Currency)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.CollateralValue.Value)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Collateral.ValuationDate)
    	XMLAjouteAttribut(xsdBIC,xsdBIC.Batch.Contract.Company)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.BusinessStatus)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.CompanyName)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.Contacts)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.CustomerCode)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.EstablishmentDate)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.IdentificationNumbers)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.IndustrySector)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.LegalForm)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.MainAddress)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.NumberOfEmployees)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.SecondaryAddress)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.Company.TradeName)
    	XMLAjouteAttribut(xsdBIC,xsdBIC.Batch.Contract.ContractCode)
    	XMLAjouteAttribut(xsdBIC,xsdBIC.Batch.Contract.ContractData)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.ContractData.Branch)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.ContractData.ConsentCode)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.ContractData.ContractStatus)
    		XMLAjouteFils(xsdBIC,xsdBIC.Batch.Contract.ContractData.CurrencyOfContract)
    Bien sur, j'envisage de récupérer les valeurs des Tags de la table Hyperfile, le problème qui se pose est que nous avons parfois des balises structurées (composées d'autres balises) .

    Joint, mon xsd en format ZIP XSD_DataStructures_1.3_BCEAO 25-05-2015.zip

    Je voudrai savoir si quelqu'un a une idée que je puisses implémenter rapidement et générer le fichier dans les délais.

    Cordialement,
    _shuriken_
    "When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be."

    Lord Kelvin - 1883.

  2. #2
    Membre confirmé Avatar de _shuriken_
    Homme Profil pro
    Inscrit en
    Mars 2006
    Messages
    543
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2006
    Messages : 543
    Points : 454
    Points
    454
    Par défaut
    Bonsoir,

    Je me permet de vous relancer par rapport à ce sujet.

    Cordialement,
    _shuriken_
    "When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be."

    Lord Kelvin - 1883.

  3. #3
    Membre expert

    Homme Profil pro
    Développeur informatique
    Inscrit en
    Juin 2004
    Messages
    2 325
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 49
    Localisation : France, Calvados (Basse Normandie)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2004
    Messages : 2 325
    Points : 3 838
    Points
    3 838
    Par défaut
    Bonjour,

    Tu as un bel exemple ici pour générer un XML à partir d'un XSD :
    http://doc.pcsoft.fr/fr-FR/?10000191...Gestion_du_XSD

  4. #4
    Membre confirmé Avatar de _shuriken_
    Homme Profil pro
    Inscrit en
    Mars 2006
    Messages
    543
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 39

    Informations professionnelles :
    Secteur : High Tech - Opérateur de télécommunications

    Informations forums :
    Inscription : Mars 2006
    Messages : 543
    Points : 454
    Points
    454
    Par défaut
    Citation Envoyé par Lo² Voir le message
    Bonjour,

    Tu as un bel exemple ici pour générer un XML à partir d'un XSD :
    http://doc.pcsoft.fr/fr-FR/?10000191...Gestion_du_XSD
    Déjà vu.

    Mais je vais y retourner encore.

    Merci !
    "When you can measure what you are speaking about, and express it in numbers, you know something about it; but when you cannot measure it, when you cannot express it in numbers, your knowledge is of a meager and unsatisfactory kind; it may be the beginning of knowledge, but you have scarcely in your thoughts advanced to the state of Science, whatever the matter may be."

    Lord Kelvin - 1883.

Discussions similaires

  1. Génération XML dynamique & trame XSD
    Par mattchoco dans le forum Macros et VBA Excel
    Réponses: 12
    Dernier message: 21/10/2013, 18h56
  2. [XSD] Java et XML: Génération du XSD (Schema XML)
    Par Kroline dans le forum Format d'échange (XML, JSON...)
    Réponses: 5
    Dernier message: 10/08/2006, 19h03
  3. [XSL] comment transformer ce fichier xml en une table html ?
    Par jlassira dans le forum XSL/XSLT/XPATH
    Réponses: 17
    Dernier message: 15/03/2006, 13h15
  4. [Xml/Xsd]valider son fichier Xml avec un schéma xsd
    Par ePoX dans le forum Général JavaScript
    Réponses: 3
    Dernier message: 09/02/2006, 23h30
  5. Lire des ms office via leur schema xml xsd
    Par goblin dans le forum Modules
    Réponses: 1
    Dernier message: 08/02/2006, 22h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo