Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Convert XML Data to String / text Expand / Collapse
Author
Message
Posted Wednesday, June 17, 2009 1:00 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, February 6, 2013 7:52 AM
Points: 47, Visits: 143
Hi

How to convert XML data field to string / text.

Example: data is stored in the field is:

Test Ticket

Thank you,

Regards


 



Thank you,
Regards
Vijji
Post #736900
Posted Wednesday, June 17, 2009 1:34 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, November 13, 2014 9:47 AM
Points: 6,842, Visits: 13,368
What would be the output you're looking for?





Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #736920
Posted Wednesday, June 17, 2009 1:36 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, February 6, 2013 7:52 AM
Points: 47, Visits: 143
It has to be in the Text format.

I need to display this field in SRS report without XML tags.

Thank you,
Regards
Vijji
Post #736922
Posted Wednesday, June 17, 2009 2:09 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, November 13, 2014 9:47 AM
Points: 6,842, Visits: 13,368
It looks a little more like HTML file rather than XML structure.
That's a slightly different story...

You might want to have a look at the following article:
http://www.databasejournal.com/scripts/article.php/3494196/Function-to-strip-HTMLASPPHP-tags-from-text.htm




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #736957
Posted Wednesday, June 17, 2009 2:39 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, February 6, 2013 7:52 AM
Points: 47, Visits: 143
Thx for the reply.

Now it removes the tags.

Now it looks like this:
Test ticket   Thank you,   Regards    

'&' represents next line, those still remains.

Thx
Regards
Vijji
Post #736987
Posted Wednesday, June 17, 2009 2:58 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, November 13, 2014 9:47 AM
Points: 6,842, Visits: 13,368
Well, I just used "strip html" as search criteria on this forums search box. So, no big deal.
Sometimes it's just a matter of finding/knowing the right search string to get the right answer...




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #736999
Posted Wednesday, June 17, 2009 9:08 PM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, October 31, 2013 3:44 AM
Points: 314, Visits: 4,128
This is probably more a question than it is an answer but, if the data is stored in an xml data type what stops you from just using any one of the xml data type methods to retrieve whatever values you want from your xml?

Chim Kalunta
Post #737122
Posted Thursday, June 18, 2009 6:03 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, November 13, 2014 9:47 AM
Points: 6,842, Visits: 13,368
The data as provided in the original post is in html format rather than xml type.
The xml type gives you a data structure whereas html usually includes format information as well (e.g. < b > for text in bold style).
You'd need two different versions of receiving the value for the text depending on the format (< body > < b > text here < /b > < /body> had to be queried different than < body > text here < /body>).




Lutz
A pessimist is an optimist with experience.

How to get fast answers to your question
How to post performance related questions
Links for Tally Table , Cross Tabs and Dynamic Cross Tabs , Delimited Split Function
Post #737441
Posted Thursday, June 18, 2009 8:48 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Thursday, October 31, 2013 3:44 AM
Points: 314, Visits: 4,128
ah right. Thanks for clearing that up, Lutz.

Chim Kalunta
Post #737628
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse