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

Help applying XML?

Hi,

I'm writing a .NET winforms app that serves as an email client. Users can
store message templates. This is done via an XML document for loading and
saving the templates. When the template is loaded, it's displayed in the
message textbox. Currently, this is the end of the XML phase. Now the user
can edit the textbox before sending the message and the content of the
textbox will be sent when the user hits send.

Now to thicken the plot, emails (and templates) can contain "replacables."
For example, I could have %Relevant Product% and before the message is sent,
it will contain, in place of that, the value "Wrench". I'm doing this by
simply calling string.replace several times (once for each replacable). The
list of values is populated every time the application is started (a textfile
is generated by another app which starts the mail client and I parse the
values and place them in a templated list object.)

This "replacables" approach is somewhat limiting. Some replaceables are
built from other replaceables. Example: %Customer Full Name% consists of:
%Customer First Name% %Customer Last Name%

Is there a way to instead, implement an XML based solution? My primary
concern is that once the template is loaded, I have no say as to what
characters my users will type into the textbox of the message so they might
not conform to XML standards. Any thoughts?

Thanks...

-Ben
Aug 30 '06 #1
1 1038
Hi Ben,

Based on my understanding, you have put the whole Xml into a Textbox and
let your user edit it to complete the template.

Xml is used for storing data. It is not suitable for data conversion.
Although we can use XSLT to do the conversion, as far as I can see, it
won't be better than using the String.Replace method.

If you have nested replacables, you have to call the replace procedure
recursively to make sure that all the tags have been replaced.

If anything is unclear, please feel free to let me know.

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Aug 31 '06 #2

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

Similar topics

1
by: Jammersplace | last post by:
me and my friend made a media player and we need to know if there is anyway to make a visualisation for it.
40
by: Peter Row | last post by:
Hi all, Here is my problem: I have a SQL Server 2000 DB with various NVarChar, NText fields in its tables. For some stupid reason the data was inserted into these fields in UTF8 encoding. ...
9
by: Daz | last post by:
Hello hello! I'm trying to finish off putting my design into HTML and I've come across a problem that I can't get my head around. I've got divs floating in two columns, but I'm having problems...
4
by: Nick Weg | last post by:
Hello We have a web application developed in .NET using VB.NET. We get the error below every now and then and can't figure out how to correct it. The viewstate this error refers to is pretty...
6
by: Tim Meagher | last post by:
Can anyone help me figure out how to apply a stylesheet to a pushbutton defined in the asp:BoundColumn or asp:EditCommandColumn elements of a datagrid?
53
by: Paul Watt | last post by:
Hi again, Ok so I've got two new problems with this layout http://www.paulwatt.info/test/turn/ 1) When I increase the width of the Maincontent Div from 73% to 74% to line it up with the right...
0
by: Jack Wu | last post by:
Hi I've spent a good majority of my day trying to figure out how to have PIL 1.1.5 working on my OSX 10.3.9_PPC machine. I'm still stuck and I have not gotten anywhere. Could somebody please...
6
by: Orgun | last post by:
Hi, I sent this message to the moderated c++ group too but it is waiting for moderator approval and I wanted to send here too. I am new to Design Patterns. I want to write a simple...
7
by: gubbachchi | last post by:
Hi all, In my application I need to display the data fetched from mysql database after the user selects date from javascript calender. I have written the code in which after the user selects the...
4
by: James Cooke | last post by:
I've just been laid off and I am freaking out (new wife, new baby 2 months away, new house yada yada yada). (not recommended at this time) Apart from the usual jobsites, (dice, monster etc) what...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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...
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.