473,385 Members | 1,593 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.

small xml question

Hi
i want to write the follwoing in vb.net in asp.net.How to write it?

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID="80" />
</DictionaryTypes>
</SXPDictionaryItemsGet>

Cuurently i m using the following code

Function GetDictionaryValues()

Dim strmread As StreamReader
Dim str_response As String
Dim sxp_getdictionaryvalues As String

Dim objInProc As Object
Dim dictionayID As String = "80"

sxp_getdictionaryvalues = "<SXPDictionaryItemsGet Revision=""7.5.0"""
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"<DictionaryTypes>"
sxp_getdictionaryvalues = sxp_getdictionaryvalues & " <Item ID>" &
dictionayID & "</Item ID"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</DictionaryTypes"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</SXPDictionaryItemsGet"

but its giving me 50 and not "50" i.e.

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID=50 />
</DictionaryTypes>
</SXPDictionaryItemsGet>

in sxp_getdictionaryvalues variable

which is wrong.Kindly help me

Thanks,
Deepak
kr**********@hotmail.com

Jan 11 '08 #1
3 871
Do you see your double quotes here?: Revision=""7.5.0"""
You need to do the same thing with the "50" or "80" whatever it is.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"deepak" wrote:
Hi
i want to write the follwoing in vb.net in asp.net.How to write it?

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID="80" />
</DictionaryTypes>
</SXPDictionaryItemsGet>

Cuurently i m using the following code

Function GetDictionaryValues()

Dim strmread As StreamReader
Dim str_response As String
Dim sxp_getdictionaryvalues As String

Dim objInProc As Object
Dim dictionayID As String = "80"

sxp_getdictionaryvalues = "<SXPDictionaryItemsGet Revision=""7.5.0"""
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"<DictionaryTypes>"
sxp_getdictionaryvalues = sxp_getdictionaryvalues & " <Item ID>" &
dictionayID & "</Item ID"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</DictionaryTypes"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</SXPDictionaryItemsGet"

but its giving me 50 and not "50" i.e.

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID=50 />
</DictionaryTypes>
</SXPDictionaryItemsGet>

in sxp_getdictionaryvalues variable

which is wrong.Kindly help me

Thanks,
Deepak
kr**********@hotmail.com
Jan 11 '08 #2
sorry,i tried but its not workign as u said.May u try on your side and if it
is working then tell me plz with code....

"Peter Bromberg [C# MVP]" wrote:
Do you see your double quotes here?: Revision=""7.5.0"""
You need to do the same thing with the "50" or "80" whatever it is.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"deepak" wrote:
Hi
i want to write the follwoing in vb.net in asp.net.How to write it?

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID="80" />
</DictionaryTypes>
</SXPDictionaryItemsGet>

Cuurently i m using the following code

Function GetDictionaryValues()

Dim strmread As StreamReader
Dim str_response As String
Dim sxp_getdictionaryvalues As String

Dim objInProc As Object
Dim dictionayID As String = "80"

sxp_getdictionaryvalues = "<SXPDictionaryItemsGet Revision=""7.5.0"""
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"<DictionaryTypes>"
sxp_getdictionaryvalues = sxp_getdictionaryvalues & " <Item ID>" &
dictionayID & "</Item ID"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</DictionaryTypes"
sxp_getdictionaryvalues = sxp_getdictionaryvalues &
"</SXPDictionaryItemsGet"

but its giving me 50 and not "50" i.e.

<SXPDictionaryItemsGet Revision="7.5.0">
<DictionaryTypes>
<Item ID=50 />
</DictionaryTypes>
</SXPDictionaryItemsGet>

in sxp_getdictionaryvalues variable

which is wrong.Kindly help me

Thanks,
Deepak
kr**********@hotmail.com
Jan 12 '08 #3
deepak explained :
Hi
Dim dictionayID As String = "80"
sxp_getdictionaryvalues = sxp_getdictionaryvalues & " <Item ID>" &
dictionayID & "</Item ID"
but its giving me 80 and not "80" i.e.
The value of dictionayID is '80', without the ' s.
If you want to have " in your output, you have to put them in:
sxp_getdictionaryvalues = sxp_getdictionaryvalues & " <Item ID="""
&
dictionayID & """/"
An other approach would be to use an XmlTextWriter:
(Note: C# syntax, but the objects are the same)

StringBuilder sb = new StringBuilder();
using(StringWriter sw = new StringWriter(sb))
{
XmlTextWriter xw = new XmlTextWriter(sw);
xw.WriteStartElement("SXPDictionaryItemsGet");
xw.WriteAttributeString("Revision", "7.5.0");
xw.WriteStartElement("DictionaryTypes");
xw.WriteStartElement("Item");
xw.WriteAttributeString("ID", dictionaryID);
xw.WriteEndElement();
xw.WriteEndElement();
xw.WriteEndElement();
}
sxp_getdictionaryvalues = sb.ToString();
Hans Kesting
Jan 14 '08 #4

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

Similar topics

7
by: Randall Parker | last post by:
Using IE 6.x (whatever is the latest) on Windows 2000. For these two CSS definitions if I remove the 2 lines that have the "mso-" font family definitions (mso-fareast-font-family, and...
7
by: Sharon | last post by:
Hiya I have a small question, I saw this piece of code somewhere (it's for creating a customized context menu) and I was wondering: Why is it that the STYLE and SCRIPT-tags are broken up into...
3
by: Tim | last post by:
Hi Group, Apologies if this is a bit OT (if so, please advise where it should be posted). I was wondering if anyone had any ideas as to what applications could work in a system where the...
5
by: Geoff Cox | last post by:
Hello Would be grateful if someone can make a few things clear for me! I have developed a small app using Java and would like to do the same using C++ but without the need for a runtime...
1
by: Gena | last post by:
Hi , I'm a newbe to programming and have a small question: I made a small program with a class. in the class's header file I have : double *ptr_output; Void main() { double result;
4
by: =?Utf-8?B?VzFsZDBuZTc0?= | last post by:
When one architects a new project one of the first steps in the decision is to decide on the layers. (In my opinion anyway) One architecture that I have used before is to go solid OO and create...
1
by: =?Utf-8?B?cmJiZW5zb24=?= | last post by:
To begin,, the network infactructure- Servers - Server00 - Windows Server 2003/Installed Server01 - Windows Server 2003/plan to install Server10 - Linux RedHat Workstation/Installed ...
169
by: JohnQ | last post by:
(The "C++ Grammer" thread in comp.lang.c++.moderated prompted this post). It would be more than a little bit nice if C++ was much "cleaner" (less complex) so that it wasn't a major world wide...
4
by: ATS16805 | last post by:
Hi. I wonder if it's possible to "force" a browser to "switch to SSR mode" for any given document. Specifically, I'm looking for a solution, not to a User Agent issue (i think), but a coding idea;...
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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?
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...

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.