Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2004
    Posts
    2

    Unanswered: XML Datentyp SQL Server 2005 (validation problems)

    Hio,

    I have created a table with a some datatypes and one of them is an XML-DataType

    Now I have a C# programm, which just inserts into this table some data. The XML datatype is just a string I am inserting in the SQl Statement. That all goes well so long.

    The Problem: When i have some Text or Tags with umlauts like " or , ..." and then the SQL server brings a validation Error

    for Example this short XML File brings an Validation error:
    Code:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <daten>
      <person>xel</person>
      <person>Johannes</person>
    </daten>
    This File you can parse in IE or Firefox without any problem and the UTF-8 Format should allow the umlauts. And the problem is the Validation from the SQL server, he don't whant to accept this files.


    I have tested some more and the result is:
    1. When the encoding ist like "iso-8.....", then the SQL server saves the file but instead of the umlauts "" he writes "?" into the database and when I am extracting the file from the Server its now an "?" and not a "".

    2. I have deleted the Header
    Code:
    Code:
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    from the document and now he takes the file, saves it and i can extrackt it too, but thats not an real solution to delete the header from the file.

    someone else got the same Problem or can tell me what i have to chance in the SQL Server 2005 or what i am doing wrong ^^

    thx SquadWuschel
    Last edited by squadwuschel; 08-22-07 at 17:13.

  2. #2
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    I am able to insert the row with a different encoding:
    Code:
    create table test1
    (col1 xml)
    
    insert into test1
    values ('<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
    <daten>
      <person>&#220;xel</person>
      <person>Johannes</person>
    </daten>')
    But I am not sure if that is a sufficient workaround. Does UTF-8 support Umlauts?

  3. #3
    Join Date
    Dec 2004
    Posts
    2
    nope because of he inserts the Table now but, have you seen the text in the Database the "" is now a "?" and when you extrackt it from the DB back to an XML File now its an "?". :-/ i have tested this allready

    and yes UTF-8 supports umlauts because all other valitdation programms say its an valid dokument.

    but you have the same problem if you use some umlauts?

    thx squadwuschel

  4. #4
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Yes, I can reproduce the problem. Unfortunately, I do not know enough about XML to get much further.

Posting Permissions

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