473,587 Members | 2,580 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help with passing xml tags within an xml file

Let's say I have the following tags in an xml:
<World>
<Country>Canada </Country>
<Hemisphere>Nor th</Hemisphere>
<Weather climate="cold" forecast="snow" >
<CommandAction> $(HOME)\calcula te.py Canada North
snow</CommandAction>
</Weather>
</World>

The CommandAction tag will invoke some python script which takes
Country Hemisphere and forecast as parameters. Is there a way to
generalize the CommandAction tag so that it can look something like the
following:

<CommandAction> $(HOME)\calcula te.py <Country> <Hemisphere>
<forecast></CommandAction>

I'm not very experienced with xml and I would like to know if the above
is a proper way of doing what I want. Any help please?

Thanks
Thierry

Feb 14 '06 #1
5 1866
Thierry wrote:
Let's say I have the following tags in an xml:
<World>
<Country>Canada </Country>
<Hemisphere>Nor th</Hemisphere>
<Weather climate="cold" forecast="snow" >
<CommandAction> $(HOME)\calcula te.py Canada North
snow</CommandAction>
</Weather>
</World>

The CommandAction tag will invoke some python script which takes
Country Hemisphere and forecast as parameters. Is there a way to
generalize the CommandAction tag so that it can look something like the
following:

<CommandAction> $(HOME)\calcula te.py <Country> <Hemisphere>
<forecast></CommandAction>

I'm not very experienced with xml and I would like to know if the above
is a proper way of doing what I want. Any help please?


A more manipulable construction might look something like:

<World>
<Country>Canada </Country>
<Hemisphere>Nor th</Hemisphere>
<Weather climate="cold" forecast="snow" >
<CommandActio n location="home" >
<script>calcula te.py</script>
<param value="Country"/>
<param value="Hemisphe re"/>
<param value="Weather/@forecast"/>
</CommandAction>
</Weather>
</World>

Then you can write some XSLT to create output which some processor
(Python) can execute. XML itself can't run programs, because it is
not itself a programming language.

(In fact, you'd need to write XSLT to write XSLT. The double
indirection is needed because XSLT is not dynamic and cannot re-rig
itself internally during execution to reflect a value it has only
just come across (like the XPath syntax implied in my <param>
elements.)

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Feb 15 '06 #2
Peter Flynn wrote:
Thierry wrote:
Let's say I have the following tags in an xml:
<World>
<Country>Canada </Country>
<Hemisphere>Nor th</Hemisphere>
<Weather climate="cold" forecast="snow" >
<CommandAction> $(HOME)\calcula te.py Canada North
snow</CommandAction>
</Weather>
</World>

The CommandAction tag will invoke some python script which takes
Country Hemisphere and forecast as parameters. Is there a way to
generalize the CommandAction tag so that it can look something like the
following:

<CommandAction> $(HOME)\calcula te.py <Country> <Hemisphere>
<forecast></CommandAction>

I'm not very experienced with xml and I would like to know if the above
is a proper way of doing what I want. Any help please?

A more manipulable construction might look something like:

<World>
<Country>Canada </Country>
<Hemisphere>Nor th</Hemisphere>
<Weather climate="cold" forecast="snow" >
<CommandActio n location="home" >
<script>calcula te.py</script>
<param value="Country"/>
<param value="Hemisphe re"/>
<param value="Weather/@forecast"/>
</CommandAction>
</Weather>
</World>

Then you can write some XSLT to create output which some processor
(Python) can execute. XML itself can't run programs, because it is
not itself a programming language.


XML is used for anything, it can be used like a programming language as well

-don't you think that XSLT is itself a kind of programming language ?
(it reads an input, processes it, and produces an output, even if the
input must be XML)

-I designed myself a general purpose language :)
have a look here :
http://disc.inria.fr/perso/philippe....l/active-tags/
and here :
http://reflex.gforge.inria.fr/
(this is the engine that implement all that stuff)

a nice toy ;)

(In fact, you'd need to write XSLT to write XSLT. The double
indirection is needed because XSLT is not dynamic and cannot re-rig
itself internally during execution to reflect a value it has only
just come across (like the XPath syntax implied in my <param>
elements.)

///Peter

--
Cordialement,

///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
Feb 15 '06 #3
Philippe Poulard wrote:
XML is used for anything, it can be used like a programming language as
well
Not exactly. XML itself is pure syntax. You can use that syntax to
express any kind of data, including program stucture. Think of XML as a
toolkit for writing languages.
-don't you think that XSLT is itself a kind of programming language ?


XSLT is very explicitly a nonprocedural rule-based programming language.

--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Feb 15 '06 #4
Joseph Kesselman wrote:
Philippe Poulard wrote:
XML is used for anything, it can be used like a programming language
as well

Not exactly. XML itself is pure syntax. You can use that syntax to
express any kind of data, including program stucture. Think of XML as a
toolkit for writing languages.


This is exactly what I meant
-don't you think that XSLT is itself a kind of programming language ?

XSLT is very explicitly a nonprocedural rule-based programming language.


You said it ;)

No comment about Active Tags ?

--
Cordialement,

///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
Feb 15 '06 #5
Philippe Poulard wrote:
Peter Flynn wrote:

[...]
XML itself can't run programs, because it is
not itself a programming language.


XML is used for anything, it can be used like a programming language as
well


Read what I wrote. Yes of course XML syntax can be used to represent
programming language constructs -- as you say, XSLT is a programming
language -- but XML *itself* is not a programming language: it's just
a specification for a markup syntax that can be used to identify lots
of different things.

///Peter
--
XML FAQ: http://xml.silmaril.ie/
Feb 15 '06 #6

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

Similar topics

2
5922
by: Chaduke | last post by:
I wrote a simple client/server chat program and the client runs as an activex control within an asp page. I have the users logging into the page using widows authentication and I'm using Request.ServerVariables("AUTH_USER") to get the users name. I'd like to pass this name to the activex chat client thru the page but I'm having some...
2
1961
by: \ | last post by:
Hi...I found your group on the search engine...First you have to know that I'm on a webtv unit.....I am really desperate.. I'm not much on tech terms as most of my pages are found and reworked codes to do what I need....my problem is I am moving my pages from an ad free account to one that has ads as the add free account T/L2 is closing down...
8
5460
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I...
4
13741
by: Pushkar Pradhan | last post by:
I need to pass a struct by reference to a function: The struct: typedef struct tifftags { uint32 imageWidth, ...; ... } TIFFTAGS; typedef TIFFTAGS * TIFFTAGS_PTR; main() { .....
10
2692
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was...
1
3700
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am...
0
5546
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted ******************************************************** For this teeny job, please refer to: http://feeds.reddit.com/feed/8fu/?o=25
3
1642
by: Rob | last post by:
Hi, I've written a small VB application that parses an HTML document and removes code I don't need and re-writes the file. I'm looking for the regex pattern that will remove the following code: <head> <meta http-equiv=Content-Type content="text/html; charset=windows-1252"> <!--> <style> v\:* {behavior:url(#default#VML);}
2
1824
by: deshg | last post by:
Hey everyone, I am a php programmer originally and am just helping a friend of mine update their website that they paid a designer (well that's what he called himself!) to do ages ago. I have built the whole site (ASP.NET using VB.NET) but am having problems on the most basic thing! I have a page which querys an MS SQL database and takes url...
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
6621
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...
1
5713
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...
0
5392
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...
0
3840
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...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.