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




You will need to post somewhere (since pasting code into the web-based
nonsense will clearly not work) the *ACTUAL* call you are making to SQL
Server. I am sorry but I am not able to debug your XSLT voodoo magic
through this mode.


On 7/1/09 1:42 PM, in article
E03CE4A8-1D40-4F6B-AA2B-FC0E4CD499FF@xxxxxxxxxxxxx, "Sandeep"
<Sandeep@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Sorry,This is the first time I am posting here. Please bear with me.
I can confirm that in incoming xml message, there is no space between & and
amp and ;.

I have also posted the xml message.

"Aaron Bertrand [SQL Server MVP]" wrote:

Sorry, but I don't think you are understanding. There should not be any
spaces between & and amp and ;. I think part of the problem is that you are
using the web interface and this is causing problems with how HTML-encoded
entities are being displayed. I'd suggest using a real newsreader instead
of the web-based garbage but I'm afraid the real newsreaders are being
forced out.




On 7/1/09 1:26 PM, in article
0686A2FD-374C-47EB-B2DF-E219CFE270AD@xxxxxxxxxxxxx, "Sandeep"
<Sandeep@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

Incoming message has ( ' & amp ; 'appears in the message):

<Comment2>FUNDED PORTION & CPN ON 2002561M - RMS 53359729</Comment2>

Parsing of message is failing even the message has ( ' & amp ; ') in the xml
tag value.

"Aaron Bertrand [SQL Server MVP]" wrote:

Escaping means switching out character sequences so they are accepted by
validators etc. HTML and XML have a very similar set of characters which
are "special" and so need to be escaped or encoded to prevent being
misinterpreted. For the ampersand, you can try this string instead:

<Comment2>FUNDED PORTION & CPN ON 2002561M - RMS 53359729</Comment2>







On 7/1/09 1:10 PM, in article
17E12CD6-85CD-45A9-A586-15EFBF363A1A@xxxxxxxxxxxxx, "Sandeep"
<Sandeep@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

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: XML Parsing: , illegal name character
    ... I can confirm that in incoming xml message, there is no space between & and ... I have also posted the xml message. ... XML message has & character in one of the tag value. ...
    (microsoft.public.sqlserver.programming)
  • Re: XML Parsing: , illegal name character
    ... XML message into column of 'xml' datatype in SQL 2005 database. ... XML message has & character in one of the tag value. ... Can you show us details of your code creating the XML and inserting it into the database? ...
    (microsoft.public.sqlserver.programming)
  • Re: Generate a file and compress it
    ... You just have to create a send port and associate ... already send a XML file with MQ, you have nothing else to do to send ... Problems is we must take the XML message and write it to a file. ... I want to get a XML document and write the document ...
    (microsoft.public.biztalk.general)
  • RE: Create one File Output for every input record ???
    ... because i first map flat to flat and then in another channel flat to ... Do you have a sample how to split uf an xml message into many ...
    (microsoft.public.biztalk.general)
  • Re: Inserting complete XML Message into a SQL Column
    ... Do you want to save the Xml tags or not? ... Microsoft Certified Technology Specialist: BizTalk Server 2006 ... some elements from the XML message and write them to a sql table. ...
    (microsoft.public.biztalk.general)

Loading