473,394 Members | 1,671 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,394 software developers and data experts.

how to keep xml data inside xml

I have created myDataset which has a dataTable.
This data table has a column called "xmlDate".
I have saved the following data to this field.
<zones><zone>india</zone><zone>france</zone></zones>
When I use myDataset.getXml to get the data to do transformation w/xslt then
I found the output data messed up my xmlDate which means
it become html format (not xml format).
so <zones> become less than / greater than encoding format ()...

The xml string is returned is in a string html format, and the xml
data seems to encode all < and > using < and >. So, what I need to do
is to convert that xml file from a string to a xml nodelist so I can access
all the elements.

Nov 19 '05 #1
5 1200
andrew007 wrote:
I have created myDataset which has a dataTable.
This data table has a column called "xmlDate".
I have saved the following data to this field.
<zones><zone>india</zone><zone>france</zone></zones>
When I use myDataset.getXml to get the data to do transformation w/xslt then
I found the output data messed up my xmlDate which means
it become html format (not xml format).
so <zones> become less than / greater than encoding format ()...

The xml string is returned is in a string html format, and the xml
data seems to encode all < and > using < and >. So, what I need to do
is to convert that xml file from a string to a xml nodelist so I can access
all the elements.


Have you tried wrapping your xml in a CDATA section? This should at
least keep your angle brackets from getting encoded.

--
Rob Schieber
Nov 19 '05 #2
You're making us cry. That is not data. It should never be stored
like that in your database!

create table YourTableZone
YourTableID int not null
ZoneID int not null
go

create table Zone
ZoneID int not null
ZoneName nvarchar(255) not null
go
Now, you can actually use that data for something, and it will be
trivial to pack it back into XML for transport. Never take the lazy
way out. And if you do, NEVER post about it on a newsgroup!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/

---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #3
Jason Kester wrote:
You're making us cry. That is not data. It should never be stored
like that in your database!


IMHO, I don't think there is anything wrong with storing xml data in a
database. If there was something wrong with it, SQL Server 2005
wouldn't have an "XML" datatype.

--
Rob Schieber
Nov 19 '05 #4
Sql server will also let you name a table [Index] or even [Select].
Just because the technology allows you to do foolish things doesn't
mean you should make a habit of doing them.

Data normalization is a good thing. You shouldn't be breaking it
unless you have a really good reason. Laziness doesn't qualify as a
good reason!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #5
Some technical information:

XML is great stuff. It is pure text, which makes it
cross-platform-compatible, and a perfect medium for exchanging data between
a potentially great variety of systems. In addition, XML can be a medium for
just about anything you want, from pure text to binary data to processing
code.

That said, XML is not the best medium for everything. To store a number
properly in an XML document, you need a .XSD schema document to specify the
type-mapping of the text data to a specific numeric data type, and an XML
file with a prolog and at least one set of element tags. So, in terms of
storage, you're storing perhaps a 64-bit value in two text documents
comprising upwards of 1KB of space.

Now, a database is designed to store data in an optimal way. It also has a
schema, but that schema applies to the entire database, and all the tables
in it. In the tables themselves, data is stored in binary format. A 64-bit
number occupies 64 bits of storage space. So, obviously, a database is the
best storage device for storing data.

Today we see the marriage of these 2 great technologies, with databases like
SQL Server that can deliver binarily-stored data in "de-compressed" XML
format. So, you can store the data efficiently, and use XML to do with that
data what XML does so well.

Use the right tool for the right job, and you'll go far.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.

"Jason Kester" <ja*********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Sql server will also let you name a table [Index] or even [Select].
Just because the technology allows you to do foolish things doesn't
mean you should make a habit of doing them.

Data normalization is a good thing. You shouldn't be breaking it
unless you have a really good reason. Laziness doesn't qualify as a
good reason!

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
---
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alex Thomas | last post by:
This is my problem. I want to submit a form to another page to process the data from said form. Then the person can go on to another part of the site or another site altogether. However If the...
2
by: lawrence | last post by:
I had some code that worked fine for several weeks, and then yesterday it stopped working. I'm not sure what I did. Nor can I make out why it isn't working. I'm running a query that should return 3...
4
by: Brian Basquille | last post by:
Hello all, Quick question! How would i keep a point inside a region? For example, the mouse pointer. You should be able to move the mouse around in this region but not anywhere outside it. ...
1
by: Carlos Lozano | last post by:
Hi, The default behavior for Modal forms does not restrict it to go out of the client area of the main MDI container form. I would like to show a modal form and keep it within the application...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
4
by: ckirchho | last post by:
Hallo, In a form I have several text or checkbox inputs with their appropriate labels. I'd like to keep label and input together, so I connect them with a &nbsp;, like: <input type="checkbox"...
0
by: cms3023 | last post by:
I have a DataGrid which displays data with the aid of a procedure. I have tested the procedure inside the database and it is working fine. The table inside the database has data that matches with...
7
by: Garry Freemyer | last post by:
I've researched this question on internet, and I've tried a number of things I found to no avail to solve this problem... I work for a company using Visual Studio 2003 to maintain a website for...
8
by: Rob | last post by:
I have a vector of a class type and when I create an object inside a function and return that and add it to the vector, it doesn't properly keep the data inside it. So I have a few questions: 1....
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.