+ Reply to Thread
Results 1 to 5 of 5

Thread: create xml , encoding in uppercase ?

  1. #1
    frankd is offline VB.NET Forum Newbie frankd is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2010
    Age
    35
    Posts
    3
    Reputation
    0

    Default create xml , encoding in uppercase ?

    Hi everybody,

    we are using XmlTextWriter to create an xml-file
    everything works fine,
    The encoding of the xml-file is UTF-8
    we even put the following :
    encoding = System.Text.Encoding.GetEncoding("UTF-8")
    proXmlWriter = New XmlTextWriter(pathResultaat, encoding)

    but in our result xml-file, it says
    <?xml version="1.0" encoding="utf-8"?>
    and it should be
    <?xml version="1.0" encoding="UTF-8"?>
    in upper case !
    what can we do to resolve this problem ?

    thx in advance

  2. #2
    MattP is offline VB.NET Forum All-Mighty MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2008
    Location
    USA
    Posts
    1,016
    Reputation
    533

  3. #3
    frankd is offline VB.NET Forum Newbie frankd is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2010
    Age
    35
    Posts
    3
    Reputation
    0

    Default

    Hi Matt,
    thx for the link, but i had found that one before, but it didn't solve the problem for me

  4. #4
    MattP is offline VB.NET Forum All-Mighty MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute MattP has a reputation beyond repute
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2008
    Location
    USA
    Posts
    1,016
    Reputation
    533

    Default

    This gets me the encoding declaration in upper case.

    Code:
            Dim doc As New XmlDocument
            Dim decl As XmlDeclaration = doc.CreateXmlDeclaration("1.0", "UTF-8", Nothing)
            doc.AppendChild(decl)
            Dim root As XmlElement = doc.CreateElement("root")
            doc.AppendChild(root)
            doc.Save("C:\Temp\xmlDecl.xml")

  5. #5
    frankd is offline VB.NET Forum Newbie frankd is on a distinguished programming path ahead
    .NET Framework
    .NET 3.5
    Join Date
    Mar 2010
    Age
    35
    Posts
    3
    Reputation
    0

    Default

    Thanks a lot !

    I have it working now !

    kind regards

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

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