473,835 Members | 1,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>in dia</zone><zone>fran ce</zone></zones>
When I use myDataset.getXm l 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 1223
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>in dia</zone><zone>fran ce</zone></zones>
When I use myDataset.getXm l 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*********@gm ail.com> wrote in message
news:11******** **************@ z14g2000cwz.goo glegroups.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
3216
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 person later clicks the <back button> enough times they will arrive back at the page that processed the data the first time and the same data will be processed again. How can I prevent this? My first thought was to use a cookie and set it on...
2
2271
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 items from the database. I then get a count of the return, which correctly tells me that I've got 3 items. I then go into a for loop which I expect to loop 3 times and print out the 3 items. Here is where things get strange: it loops 3 times and...
4
4592
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. How would i go about doing this?
1
4208
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 container form as any other non-modal MDI form. I am not able to assign the MDIParent as it give an exception. I will appreciate any suggestions.
7
14825
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 want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
4
17898
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" name="h" value="1" id="chk"/>&nbsp;<label for="chk">Schreibweisentolerant</label> Apparently this doesn't work in Firefox 2. It works in IExplorer and Opera. As well I tried:
0
1776
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 the parameter. I have another procedure which adds another row to the table, which is working fine inside the programming, and in the database. However, I still cannot figure out what am I doing wrong with the DataGrid configurations OR...
7
1601
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 realtors. This webside allows a realtor to fill out a series of forms to get market analysis among other involved stuff. There is a lot of data for the realtor to enter and typically they will
8
1216
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. Is this because it loses scope since it wasn't created with "new"? 2. If I do create it with new, but the vector holds objects not pointers, will the vector's "delete" operator function still handle deleting all those pointers? CODE 1:
0
9652
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10558
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10226
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9343
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7765
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6961
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5631
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3990
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3086
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.