Results 1 to 5 of 5
  1. #1
    Lund01's Avatar
    Lund01 is offline Senior Member
    Join Date
    Sep 2010
    Location
    The Netherlands
    Posts
    149
    Rep Power
    0

    Default How do I add: <?xml version='1.0'>

    How do i add this line above my XML file?

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,964
    Rep Power
    8

    Default

    Your question is way too vague to actually answer. Depending on the context, you could mean several different things:
    Open the file up in a word processor and paste the line in.
    Use a StringBuilder to form the XML.
    Read the file in, then output it with that line at the beginning.
    Something else entirely.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    Lund01's Avatar
    Lund01 is offline Senior Member
    Join Date
    Sep 2010
    Location
    The Netherlands
    Posts
    149
    Rep Power
    0

    Default

    I have a program that makes an XML file, but I wild like to add this line to the document.
    Above the <root>

  4. #4
    KevinWorkman's Avatar
    KevinWorkman is online now Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,964
    Rep Power
    8

    Default

    How are you making the XML file?
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  5. #5
    Jodokus's Avatar
    Jodokus is offline Senior Member
    Join Date
    Jan 2011
    Location
    Amsterdam, the Netherlands
    Posts
    230
    Rep Power
    4

    Default

    @OP:
    You should really answer Kevins' question: An XML-file is just a textfile. Sometimes I just do some parsing and write the result, with the first line as any other String through a stream. But there are a lot of tools that do fancy stuff for you including headers.
    No bug ever had to calculate its fitnessfunction.

Similar Threads

  1. Version 6.0.25
    By alicez in forum New To Java
    Replies: 10
    Last Post: 05-20-2011, 06:48 PM
  2. java -version pointing to older version
    By deepakts in forum New To Java
    Replies: 4
    Last Post: 05-06-2010, 09:59 AM
  3. Which version is best Eclipse 3.2.1 or 3.1.2
    By jaisastha in forum Eclipse
    Replies: 1
    Last Post: 01-13-2009, 12:11 PM
  4. using different JDK version in one IDE
    By happyknappy in forum New To Java
    Replies: 3
    Last Post: 09-02-2008, 02:10 PM
  5. to version
    By Alan in forum New To Java
    Replies: 2
    Last Post: 05-31-2007, 06:05 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •