Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

URLEncode with FOR XML Explicit

 
   Database Forums (Home) -> XML RSS
Next:  MS SQL Server 2005 Express edition  
Author Message
mfairchild

External


Since: Nov 08, 2005
Posts: 3



(Msg. 1) Posted: Tue Nov 08, 2005 5:18 am
Post subject: URLEncode with FOR XML Explicit
Archived from groups: microsoft>public>sqlserver>xml (more info?)

Maybe I missed something simple, but is there a way to URLEncode the data
generated by FOR XML EXPLICIT within the SQL statement itself?

 >> Stay informed about: URLEncode with FOR XML Explicit 
Back to top
Login to vote
mfairchild

External


Since: Nov 08, 2005
Posts: 3



(Msg. 2) Posted: Tue Nov 08, 2005 5:31 am
Post subject: RE: URLEncode with FOR XML Explicit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

To be more specific, I'm creating an XML document with an attribute that has
a value similar to "Háaleitisbraut" and the special character is causing an
error downstream.

"mfairchild" wrote:

> Maybe I missed something simple, but is there a way to URLEncode the data
> generated by FOR XML EXPLICIT within the SQL statement itself?

 >> Stay informed about: URLEncode with FOR XML Explicit 
Back to top
Login to vote
Michael Rys MSFT

External


Since: Jan 21, 2004
Posts: 497



(Msg. 3) Posted: Wed Nov 16, 2005 11:00 pm
Post subject: Re: URLEncode with FOR XML Explicit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

What encoding does your XML document pretend to have? Note that FOR XML
returns the data in UTF-16 encoding (unless you set a different output
encoding on the provider).

How do you get the XML back?

Thanks
Michael

"mfairchild" wrote in message

> To be more specific, I'm creating an XML document with an attribute that
> has
> a value similar to "Háaleitisbraut" and the special character is causing
> an
> error downstream.
>
> "mfairchild" wrote:
>
>> Maybe I missed something simple, but is there a way to URLEncode the data
>> generated by FOR XML EXPLICIT within the SQL statement itself?
 >> Stay informed about: URLEncode with FOR XML Explicit 
Back to top
Login to vote
mfairchild

External


Since: Nov 08, 2005
Posts: 3



(Msg. 4) Posted: Wed Nov 23, 2005 7:11 am
Post subject: Re: URLEncode with FOR XML Explicit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The process uses FOR XML to send an XML document to C# which builds a string
and simply turns around and sends it as a parameter to a stored procedure in
an external SQL Server. The destination SQL Server returns "XML parsing
error: An Invalid character was found in text content." Manually changing
the "á" to an "a" fixes the problem. Maybe it's a setting in the OPENXML
statement in the destination stored procedure? I'm not really sure at this
point.

"Michael Rys [MSFT]" wrote:

> What encoding does your XML document pretend to have? Note that FOR XML
> returns the data in UTF-16 encoding (unless you set a different output
> encoding on the provider).
>
> How do you get the XML back?
>
> Thanks
> Michael
>
> "mfairchild" wrote in message
>
> > To be more specific, I'm creating an XML document with an attribute that
> > has
> > a value similar to "Háaleitisbraut" and the special character is causing
> > an
> > error downstream.
> >
> > "mfairchild" wrote:
> >
> >> Maybe I missed something simple, but is there a way to URLEncode the data
> >> generated by FOR XML EXPLICIT within the SQL statement itself?
>
>
>
 >> Stay informed about: URLEncode with FOR XML Explicit 
Back to top
Login to vote
Michael Rys MSFT

External


Since: Jan 21, 2004
Posts: 497



(Msg. 5) Posted: Sun Dec 18, 2005 10:34 pm
Post subject: Re: URLEncode with FOR XML Explicit [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Sorry for the late reply.

If you just send it pack to a stored proc, you may have send it to a
parameter of the wrong type (text,varchar instead of ntext/nvarchar)...
Also, you may want to add an XML declaration that explicitly gives the
encoding before sending it back...

Best regards
Michael

"mfairchild" wrote in message

> The process uses FOR XML to send an XML document to C# which builds a
> string
> and simply turns around and sends it as a parameter to a stored procedure
> in
> an external SQL Server. The destination SQL Server returns "XML parsing
> error: An Invalid character was found in text content." Manually changing
> the "á" to an "a" fixes the problem. Maybe it's a setting in the OPENXML
> statement in the destination stored procedure? I'm not really sure at
> this
> point.
>
> "Michael Rys [MSFT]" wrote:
>
>> What encoding does your XML document pretend to have? Note that FOR XML
>> returns the data in UTF-16 encoding (unless you set a different output
>> encoding on the provider).
>>
>> How do you get the XML back?
>>
>> Thanks
>> Michael
>>
>> "mfairchild" wrote in message
>>
>> > To be more specific, I'm creating an XML document with an attribute
>> > that
>> > has
>> > a value similar to "Háaleitisbraut" and the special character is
>> > causing
>> > an
>> > error downstream.
>> >
>> > "mfairchild" wrote:
>> >
>> >> Maybe I missed something simple, but is there a way to URLEncode the
>> >> data
>> >> generated by FOR XML EXPLICIT within the SQL statement itself?
>>
>>
>>
 >> Stay informed about: URLEncode with FOR XML Explicit 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
FOR EXPLICIT - i don't think the docvmentation covld be more confvsing. Consider: CREATE TABLE MyNewsEntries( gvid vniqveidentifier, title varchar(200), description text, pvbDate datetime,...

Help with FOR XML EXPLICIT - I am try to create an XML doc that is a debit note consisting of many debit items (3 in this example). This is the desired o&#118;tp&#118;t ... <DebitNote> <DebitNoteDoc&#118;mentDate>2005-02-13</DebitNoteDoc&#118;ment...

For XML Explicit - k. I'm going crazy here. I have some for xml explicit sql working (created a test against the adventureworks database) but how can I get the results of this sql into an xml variable. I have tried inserting it into a table variable or setting an xml..

Need help formatting XML using for XML explicit - Hi, Whenever I exec&#118;te the following: select 1 as tag,n&#118;ll as parent, '2.0' as [Doc&#118;ment!1!Version], n&#118;ll as [Doc&#118;mentBody!2!Doc&#118;mentIdentifier], n&#118;ll as [Doc&#118;mentBody!2!] &#11...

SQLXML for xml explicit - Hi ppl, I am a newbie,a rookie in to the database world.I've got my first job now in a small company who couldnt offord a full fledged DBA. We have a requirement in which we need to query a lot of tables and form numerous XML with those data. I..
   Database Forums (Home) -> XML All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]