473,385 Members | 1,402 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Format XML output from .NET Service

1
I am new to creating .NET Services. I have created a service that does a database query and produces an XML file in OPML format. The service is being called call from a DHTML web page using XMLHttp. Everything is working great except for the service is html encoding my "<" and ">" characters to "&lt;" and "&gt;". For my XML output I need these characters to remain what they are. How do I tell the service not to perform the html encoding? I was wondering if this was in the Globalization setting in web.config? responseEncoding is currently set to utf-8.

I am using Visual Studio 2003 with .Net 1.1.

OPML example

Expand|Select|Wrap|Line Numbers
  1. <opml version="1.0">
  2. <head>
  3. </head>
  4. <body>
  5.   <outline text="fruit">
  6.     <outline text="orange"/>
  7.     <outline text="apple">
  8.       <outline text="red delicious"/>
  9.       <outline text="braeburn"/>
  10.     </outline>
  11.   </outline>
  12. </body>
  13. </opml>
I need my XML output to look like the above example. All my "<" and ">" symbols are getting html encoded.

Web service:

Expand|Select|Wrap|Line Numbers
  1. [WebMethod]
  2. public string EntityTable()
  3. {
  4.     try
  5.     {
  6.         StringBuilder xmlString = new StringBuilder();
  7.         //Add a bunch of XML text to string here
  8.         return xmlString.ToString();
  9.     }
  10.     catch (Exception ex)
  11.     {
  12.         return ex.ToString();
  13.     }
  14. }
.NET is also adding this before and after the OPML:

Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="utf-8" ?> 
  2.   <string xmlns="http://localhost/webservices/">
  3.   </string>
I need the <?xml version="1.0" encoding="utf-8" ?> bit but I dont need the <string> tags. Is this a key to my problem?

Any help appreciated. Thanks
Sep 6 '06 #1
0 2090

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Laurence Neville | last post by:
This is regarding a change in the Short Date format under Hebrew Regional Settings, that has caused huge problems in our ASP web application. The change appears to have been introduced sometime...
10
by: .Net_Newbie | last post by:
Hello, gurus I have a problem about format XML I use ms data access building block to get a data set from stored procedure. the dataset's save xml give me data with the elements. Is there any...
0
by: Brendan Reynolds | last post by:
I have a web service that takes the XML representation of a dataset and uses XSLT to transform it to the format required to open a disconnected ADODB recordset on the XML, and returns the...
6
by: Stuart McGraw | last post by:
I am looking for a VBA "format" or "template" function, that is, a function that takes a format string and a varying number of arguments, and substitutes the argument values into the format string...
7
by: Sobhan | last post by:
Hi all, Iam writing a small C program to print a array of numbers in Comma Separated Values in VC++ editor. Lets say: Title Title1 Title2 ----- ------ ------ 10,20,30 50,90,100 120,180,300
5
by: siliconwafer | last post by:
Hi All, What does a 'format specifier' do? Suppose I do, int a = 43; //decimal number printf("%x",a); I will get hex equivalent of 43. Does the format specifier do an implicit "decimal to hex"...
4
by: ziondreams | last post by:
I'm currently working on a system that will allow our 175+ clients that store their data on our databases to export the data to their systems (via webservice) and also call other web services to...
1
by: Wendy Elizabeth | last post by:
I wrote a visual Basic .net xml web service that returns xml information back to a classic ASP page. When the classic ASP page receives the response, the xml has been returned in a format that that...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.