Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 XML question "URGENT please"

Author  Topic 

jubilanttiger
Starting Member

19 Posts

Posted - 2005-06-03 : 13:52:57
Hi,

I have a sql string like this:

nameid="Jemmy James" home_address_address1="6 Jenny St." home_address_address2="" home_address_city="Boranta" home_address_state="CT" home_address_zip="21211" home_phone="(212) 544-2121" date_of_birth="08/19/1927" answerlist1="-- Select Below -- "


The above is only one string and is stored as a TEXT field in the database. Our application reads the string and parses into question and answer fields and creates a report from it.

We are getting an error, and we suspect it due to some speacial charater.

My questions is:
1. I have heard of some way, where I can post the string on a text pad, save it as a XML file and then open it through IE, so that I can take a good look at the string. Can anyone tell me how I can do this with the above string?

2. What are the special charaters when stored a database which cause error generally.. ??

Thanks a Lottttt for your time and replyyy

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-06-03 : 14:03:13
What is the error? When is it erroring? What are you trying to do with it once the application parses it?

If you want us to help you need to post in more detail :)

Follow these guidlines, very helpful:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Nathan
Go to Top of Page

jubilanttiger
Starting Member

19 Posts

Posted - 2005-06-03 : 14:07:03
I dont know why the error occurs, and that is why I am trying to look at the string through notepad and convert into an xml type and find the error. So can help me do the following:

1. I have heard of some way, where I can post the string on a text pad, save it as a XML file and then open it through IE, so that I can take a good look at the string. Can anyone tell me how I can do this with the above string?

By the way the string which I have posted above is only part of the string. The complete string is longer and there are around 30 of them !
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-06-03 : 14:14:48
Not why, but WHAT is the error? Is it erroring on an INSERT? Is it even a SQL error? Application error?

And convert to xml type?? You could VIEW the string as an xml doc in a browser if it was wellformed... which it is not, but perhaps you left off the header, nodes, etc. when you cut/pasted into the forum.

To do this, just copy it into notepad, save it as [filename].xml and open it in IE. Though, I dont think this will accomplish much of anything. To validate the XML go here:

http://www.w3schools.com/dom/dom_validate.asp



Go to Top of Page

jubilanttiger
Starting Member

19 Posts

Posted - 2005-06-03 : 14:26:22
thanks a lot for your replies, Nathans.
But, I just pasted the below string, saved it as filename.xml and opened it with IE and below is the error which I am getting !!! Can you please test that?

nameid="Jemmy James" home_address_address1="6 Jenny St." home_address_address2="" home_address_city="Boranta" home_address_state="CT" home_address_zip="21211" home_phone="(212) 544-2121" date_of_birth="08/19/1927" answerlist1="-- Select Below -- "


The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Invalid at the top level of the document. Error processing resource 'file:///C:/Documents and Settings/jubilanttiger/Desktop/file...

nameid="Jemmy James" home_address_address1="6 Jenny St." home_address_address2="" home_address_city="Boranta" home_address_s...

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-06-03 : 14:29:04
You can't do this in XML since it isn't well formed. That's why IE is blowing up. It is not why your application is though.

So please post the error from your application.

Tara
Go to Top of Page

nathans
Aged Yak Warrior

938 Posts

Posted - 2005-06-03 : 14:30:21
Where is the node name??

For example:

<customer nameid="Jemmy James" home_address_address1="6 Jenny St." home_address_address2="" home_address_city="Boranta" home_address_state="CT" home_address_zip="21211" home_phone="(212) 544-2121" date_of_birth="08/19/1927" answerlist1="-- Select Below -- " />
Go to Top of Page

jubilanttiger
Starting Member

19 Posts

Posted - 2005-06-03 : 16:16:17
Thanks a lot guys, I fixed the error. Actually I could not post the error, coz i was getting a generic error message from our application.

The error was because the Pre-Defined Enrty & was not stored as & in the database.
Go to Top of Page
   

- Advertisement -