Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. How to generate XML file with serialisation in vb.net

How to generate XML file with serialisation in vb.net

Scheduled Pinned Locked Moved XML / XSL
csharpxmltutorial
2 Posts 2 Posters 10 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 12769618
    wrote on last edited by
    #1

    Hi there, I have a one big prob. I want to generate xml file with a specific format Like this syntax!: 1088081 2016 8 1 1 FF160400146 PRESTATION 2400.00 480.00 2880.00 52803595 LEADER SOFT 001540114000046 20.00 2 2016-08-01 2016-01-30 2 FF160400147 PRESTATION 1500.00 300.00 1800.00 52803595 LEADER SOFT 001540114000046 20.00 So, I've created form with button to generate the xml files and I created this code for That: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim xmlsetting As New XmlWriterSettings 'xmlsetting.ConformanceLevel = ConformanceLevel.Document 'xmlsetting.OmitXmlDeclaration = True Dim writxml As XmlWriter = XmlWriter.Create("mytest.xml", xmlsetting) Try With writxml .WriteStartDocument() .WriteStartElement("DeclarationReleveDeduction") .WriteStartElement("identifiantFiscal") .WriteString("111111") .WriteEndElement() .WriteStartElement("annee") .WriteString("2016") .WriteEndElement() .WriteStartElement("periode") .WriteString("8") .WriteEndElement() .WriteStartElement("regime") .WriteString("1") .WriteEndElement() .WriteStartElement("Relvededution") For i As Integer = 1 To 10 .WriteStartElement("Id") .WriteString(i) .WriteStartElement("Nom") .WriteString("Nom " & i) .WriteEndElement() .WriteStartElement("prenom") .WriteString("Prenom " & i) .WriteEndElement() .WriteStartElement("Adresse") .WriteString("Adresse " & i) .WriteEndElemen

    Richard DeemingR 1 Reply Last reply
    0
    • U User 12769618

      Hi there, I have a one big prob. I want to generate xml file with a specific format Like this syntax!: 1088081 2016 8 1 1 FF160400146 PRESTATION 2400.00 480.00 2880.00 52803595 LEADER SOFT 001540114000046 20.00 2 2016-08-01 2016-01-30 2 FF160400147 PRESTATION 1500.00 300.00 1800.00 52803595 LEADER SOFT 001540114000046 20.00 So, I've created form with button to generate the xml files and I created this code for That: Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click Dim xmlsetting As New XmlWriterSettings 'xmlsetting.ConformanceLevel = ConformanceLevel.Document 'xmlsetting.OmitXmlDeclaration = True Dim writxml As XmlWriter = XmlWriter.Create("mytest.xml", xmlsetting) Try With writxml .WriteStartDocument() .WriteStartElement("DeclarationReleveDeduction") .WriteStartElement("identifiantFiscal") .WriteString("111111") .WriteEndElement() .WriteStartElement("annee") .WriteString("2016") .WriteEndElement() .WriteStartElement("periode") .WriteString("8") .WriteEndElement() .WriteStartElement("regime") .WriteString("1") .WriteEndElement() .WriteStartElement("Relvededution") For i As Integer = 1 To 10 .WriteStartElement("Id") .WriteString(i) .WriteStartElement("Nom") .WriteString("Nom " & i) .WriteEndElement() .WriteStartElement("prenom") .WriteString("Prenom " & i) .WriteEndElement() .WriteStartElement("Adresse") .WriteString("Adresse " & i) .WriteEndElemen

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      You have already posted this in the VB forum: How to generate XML file with serialisation in vb.net - Visual Basic Discussion Boards[^] Posting the same question in different places on the site duplicates work and annoys people.


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups