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. C#
  4. Xml writing

Xml writing

Scheduled Pinned Locked Moved C#
tutorialxmlhelpquestion
4 Posts 3 Posters 0 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.
  • N Offline
    N Offline
    Naveed727
    wrote on last edited by
    #1

    I Google my problem but not succeed can anybody guide me how can i write xml like following...

    this is sample

    How can i write the first line. When I put it into

    writer.WriteStartElement("Parent xmlns=\"http://www.example.org\"");

    then it produce output like this

    parent xmlns="http://www.example.org">
    /parent xmlns="http://www.example.org">
    /pre>

    How can I write the first line.....

    I don't know how I will do it.

    S B 2 Replies Last reply
    0
    • N Naveed727

      I Google my problem but not succeed can anybody guide me how can i write xml like following...

      this is sample

      How can i write the first line. When I put it into

      writer.WriteStartElement("Parent xmlns=\"http://www.example.org\"");

      then it produce output like this

      parent xmlns="http://www.example.org">
      /parent xmlns="http://www.example.org">
      /pre>

      How can I write the first line.....

      I don't know how I will do it.

      S Offline
      S Offline
      SeMartens
      wrote on last edited by
      #2

      Hi, try this:

      writer.WriteStartElement("Parent");
      writer.WriteAttributeString("xmlns", "", null, "http://www.example.org");
      writer.WriteElementString("this is sample");
      writer.WriteEndElement();

      Take a look at this site: http://msdn.microsoft.com/de-de/library/system.xml.xmltextwriter(VS.80).aspx[^] Regards Sebastian

      It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

      N 1 Reply Last reply
      0
      • S SeMartens

        Hi, try this:

        writer.WriteStartElement("Parent");
        writer.WriteAttributeString("xmlns", "", null, "http://www.example.org");
        writer.WriteElementString("this is sample");
        writer.WriteEndElement();

        Take a look at this site: http://msdn.microsoft.com/de-de/library/system.xml.xmltextwriter(VS.80).aspx[^] Regards Sebastian

        It's not a bug, it's a feature! Check out my CodeProject article Permission-by-aspect. Me in Softwareland.

        N Offline
        N Offline
        Naveed727
        wrote on last edited by
        #3

        Thanks buddy

        1 Reply Last reply
        0
        • N Naveed727

          I Google my problem but not succeed can anybody guide me how can i write xml like following...

          this is sample

          How can i write the first line. When I put it into

          writer.WriteStartElement("Parent xmlns=\"http://www.example.org\"");

          then it produce output like this

          parent xmlns="http://www.example.org">
          /parent xmlns="http://www.example.org">
          /pre>

          How can I write the first line.....

          I don't know how I will do it.

          B Offline
          B Offline
          benjymous
          wrote on last edited by
          #4

          Try replacing your **<**s with **<**s in the post - then we'll be able to see the html you're trying to achieve!

          Help me! I'm turning into a grapefruit! Buzzwords!

          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