Re: XML Parsing: <line >, <character> illegal name character

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance




Hi,

Thanks for your response.

Could you please provide more details.

This is the xml tag <Comment2>FUNDED PORTION & CPN ON 2002561M - RMS
53359729</Comment2> in the incoming message and I am trying to insert the
same into table's column whose datatype is xml.


"Aaron Bertrand [SQL Server MVP]" wrote:

Don't you need to escape special characters like &, <, > etc. if they are to
appear inside XML tags?




On 7/1/09 12:47 PM, in article
5203BB33-B00F-4B99-900B-8942B463E756@xxxxxxxxxxxxx, "Sandeep"
<Sandeep@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Hi,
I am using open source Java based application and xslt to insert a complete
XML message into column of 'xml' datatype in SQL 2005 database.
XML message has & character in one of the tag value.

While inserting this message, my application throw exception
"java.sql.SQLException: XML parsing: line 4, character 1346, illegal name
character"
When I change the column datatype from 'xml' to 'text', the same message get
inserted into table. And I tried to insert same message into Oracle database
as CLOB and there are no issues.

I used xalan as well as saxon parser and also variouos encoding options
(UTF-8, ISO-8859-1..), however this did not help me.

Any suggestion is highly appreciated.

Thanks in advance.


.



Relevant Pages

  • Re: I can not read a small file from NTEXT field in the database
    ... new XML datatype instead. ... Are you simply storing the contents of the XML file, ... That wouldn't be a ntext ... If you're working with SQL Server locally, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: XML Parsing: , illegal name character
    ... same into table's column whose datatype is xml. ... XML message into column of 'xml' datatype in SQL 2005 database. ... XML message has & character in one of the tag value. ...
    (microsoft.public.sqlserver.programming)
  • RE: Importing XML files to SQL Database using SSIS.
    ... I was successful to use Data Conversion component. ... the the package get bloced on XML Source component itself.. ... Convert Data to a Different Data Type Using the Data Conversion ... you may try to change datatype of column in XML source by using the ...
    (microsoft.public.sqlserver.dts)
  • Re: XML Parsing: , illegal name character
    ... same into table's column whose datatype is xml. ... XML message into column of 'xml' datatype in SQL 2005 database. ... XML message has & character in one of the tag value. ... While inserting this message, my application throw exception ...
    (microsoft.public.sqlserver.programming)
  • Re: XML Parsing: , illegal name character
    ... appear inside XML tags? ... XML message into column of 'xml' datatype in SQL 2005 database. ... XML message has & character in one of the tag value. ... While inserting this message, my application throw exception ...
    (microsoft.public.sqlserver.programming)