473,466 Members | 1,646 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

XML as a script replacement

I need to use XML file as a replacement for a script file. The XML file is is created by a (graphical) editor and the XML file then drives a runtime engine as in WorkFlow or VoiceMail systems

Beeing new to XML, how do I bes
a) create the XML file from .net business objects in the editor
b) parse and interprete the XML file in the runtime system

Or is it better to stay with a serialized object model as the intermediate file format

VB.NET examples preferred

thanks, herber

Nov 12 '05 #1
1 1307
If there is a simple one to one mapping from your business objects to the
XML format you want then the XmlSerializer is the easiest way. If the
mapping is more complicated you may have to use other classes in the
System.Xml namespace as follows:

1) The XmlSerializer uses the XmlTextReader for reading and the
XmlTextWriter for writing. You could write directly to these classes also
which give you the best performance. The only down side here is you may end
up writing a lot of code, WriteStartElement, WriteAttribute,
WriteEndElement, and so on.

2) Alternately, you could serialize your business objects into an
XmlDocument, then use XslTransform to transform this into the desired XML
format. Another XslTransform can be written to do the reverse transform.
Another approach to the output side of this equation is to bypass
XmlDocument by using the ObjectXPathNavigator, that you can find on MSDN, to
pump your business objects directly through an XslTransform and produce your
output that way. But ObjectXPathNavigator is just a sample code, you would
have to be comfortable with owning/improving that code as needed.

3) Another clever approach is to make your business objects a "wrapper" on
top of XmlNode, so the data is actually stored in an XmlNode (XmlElement,
XmlAttribute, XmlText, etc), but your app gets a strongly typed programming
model via your wrapper classes. This is a "databinding" approach. Here the
"binding" process walks the XmlDocument that you loaded, and populates
collections of your "bound" business objects. The XmlDataDocument is an
example of this concept, where in this case the "bound" objects are
DataTables and DataRows in a DataSet.
"herbert" <an*******@discussions.microsoft.com> wrote in message
news:3A**********************************@microsof t.com...
I need to use XML file as a replacement for a script file. The XML file is is created by a (graphical) editor and the XML file then drives a runtime
engine as in WorkFlow or VoiceMail systems.
Beeing new to XML, how do I best
a) create the XML file from .net business objects in the editor?
b) parse and interprete the XML file in the runtime system?

Or is it better to stay with a serialized object model as the intermediate file format?
VB.NET examples preferred.

thanks, herbert

Nov 12 '05 #2

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

Similar topics

12
by: hokiegal99 | last post by:
Is there a forum where one could post a Python script and have it critiqued by others? Something like: Y would be more efficent if you did it this way, or doing it that way could cause problems...
9
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
3
by: Vibha Tripathi | last post by:
Hi Folks, I put a Regular Expression question on this list a couple days ago. I would like to rephrase my question as below: In the Python re.sub(regex, replacement, subject)...
11
by: rajarao | last post by:
hi I want to remove the content embedded in <script> and </script> tags submitted via text box. My java script should remove the content embedded between <script> and </script> tag. my current...
2
by: kpg | last post by:
Hi all, This should be simple... I have a TextBox1 and a customvalidation control linked to it. I use a client side script to validate the textbox. If the data is not valid I want to return...
1
by: lawrence k | last post by:
Want to replace the limit clause in a query, but can't get it right. What's wrong with this: $pattern = "(.*)limit (.*)"; $replacement = '$1'; $replacement .= "LIMIT $limit"; $replacement .=...
17
by: PJ | last post by:
Greetings... I have stumbled upon a small problem. I use Ajax to retrieve part of a page I need to update. I update a DIV element with the HTML contents I get from another page. It works...
9
by: Synapse Syndrome | last post by:
Hi I've been given what I am told is a PHP script to be used on my server. I do not know any PHP. I am trying to use a feature of a program called ArchiCAD. This feauture allows CAD drawing...
0
by: Derek Hart | last post by:
Is there a dotnet class that can be a replacement for the Microsoft Script Control, so the following text could be evaluated, as examples: "1=1" "True And False Or True"
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
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...
0
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,...
0
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.