By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,501 Members | 1,678 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,501 IT Pros & Developers. It's quick & easy.

Need help with xml and xsl design

P: n/a
Hi all
This is what I have in mind and I will appreciate any suggestions.

I am trying to create a xml help system for my application. The schema of
the xml file will be
<helpsystem>
<help id="unique id">
<text>text data</text>
<link
href="optional tag which will hold a reference to a uri"
helpanchor="this is also a optional attribute which will point
to a helpid in the same document or a different document"
helpanchorhtmlfile=" this attribute will only be present if the
helpachor attribute is there and basically will include a html file name"
some text data </link>

</help>
(any number of help tags)
</helpsystem>

At runtime this xml will be read and it will be transform to html. Each help
tag will become a html table and each child of the help tag will become a
row for the html table.

The link tag will either have href attribute or helpanchor attribute but not
both. The link tag trasform to a html <a> tag. The href attribute of the
link tag transform to the href attribute of <a>and the <link> text becomes
the text for the <a> tag. When the helpanchorhtmlfile attribute is present,
the href attribute of <a> will hold the reference given by this tag.

All this is very easy( have already written the xsl stylesheet for it) when
the link tag has the attribute href. My difficulty comes when the link tag
has helpanchor attribute because for this attribute I have to generate a
seperate html file with the name given in the helpanchorhtmlfile attribute.
Since the help id which the helpanchor is pointing itself could have any
number of link, I have to build html files for any number of nested levels.

In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl. If any of you have any
suggestions please let me know and I will greatly appreciate your help.

Rafia Tapia

Rafia Tapia
Nov 11 '05 #1
Share this Question
Share on Google+
22 Replies


P: n/a
Rafia Tapia wrote:
All this is very easy( have already written the xsl stylesheet for it) when
the link tag has the attribute href. My difficulty comes when the link tag
has helpanchor attribute because for this attribute I have to generate a
seperate html file with the name given in the helpanchorhtmlfile attribute.
Since the help id which the helpanchor is pointing itself could have any
number of link, I have to build html files for any number of nested levels. Does this explanation mean you need to produce multiple outputs from single
transformation and that's your problem?
In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl.

Never heard of any problem with recursion in XSLT.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

P: n/a
Hello Oleg,
In a traditional programming I would have accomplish this task using
recursion but how can I do this using xsl.

Never heard of any problem with recursion in XSLT.


Although if you're going to want to maintain state (e.g. recursion level)
you'll need to get creative. XSL is not very friendly toward state
maintenance since templates aren't supposed to produce any side effects
other than their transformation output.

- Joe Geretz -
Nov 11 '05 #3

P: n/a
> Still, if you attempt to "maintain a state," it is a problem.

You shouldn't.

In XSLT one does not attempt to maintain state -- and this is not a problem.
If you want to use XSLT like you are using Fortran, then it is better for
you to continue to use Fortran.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #4

P: n/a

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
Still, if you attempt to "maintain a state," it is a
problem.
You shouldn't.

In XSLT one does not attempt to maintain state -- and this is not a problem. If you want to use XSLT like you are using Fortran, then it is better for you to continue to use Fortran.


You've made this point repeatedly clear.
Nov 11 '05 #5

P: n/a
Hello Dimitre,
Still, if you attempt to "maintain a state," it is a problem.


You shouldn't.


Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove
my statement' all you need to know is that you can initialize a variable but
you can't make further asignment to change its value. Thus, it's obviously
difficult to track state.

If you'd like to see how I solved this problem, here's a nice practical
template which demonstrates A - the possibility of tracking the recursion
level and B - the difficulty in doing so. (No, I did not come up with this
technique myself, I read it in a book.)

<xsl:template name="indent">
<xsl:param name="nodenum"/>
<xsl:param name="pos"/>
<xsl:if test="substring($nodenum, $pos, 1) = '.' ">
<img border="0" src="images/pixel.gif" width="15" height="9"/>
</xsl:if>
<xsl:if test="$pos != string-length($nodenum)">
<xsl:call-template name="indent">
<xsl:with-param name="nodenum" select="$nodenum"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion.

I think that we can all agree that state maintenance is difficult with XSLT.
And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it
is sometimes necessary and when it is, it is difficult.

- Joe Geretz -
Nov 11 '05 #6

P: n/a
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.
Once again, "state maintenance" meaning the capability to alter the contents
of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:ub**************@TK2MSFTNGP12.phx.gbl...
Hello Dimitre,
Still, if you attempt to "maintain a state," it is a problem.
You shouldn't.


Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to

'prove my statement' all you need to know is that you can initialize a variable but you can't make further asignment to change its value. Thus, it's obviously
difficult to track state.

If you'd like to see how I solved this problem, here's a nice practical
template which demonstrates A - the possibility of tracking the recursion
level and B - the difficulty in doing so. (No, I did not come up with this
technique myself, I read it in a book.)

<xsl:template name="indent">
<xsl:param name="nodenum"/>
<xsl:param name="pos"/>
<xsl:if test="substring($nodenum, $pos, 1) = '.' ">
<img border="0" src="images/pixel.gif" width="15" height="9"/>
</xsl:if>
<xsl:if test="$pos != string-length($nodenum)">
<xsl:call-template name="indent">
<xsl:with-param name="nodenum" select="$nodenum"/>
<xsl:with-param name="pos" select="$pos + 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>

In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion.

I think that we can all agree that state maintenance is difficult with XSLT. And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it is sometimes necessary and when it is, it is difficult.

- Joe Geretz -

Nov 11 '05 #7

P: n/a
Joseph Geretz wrote:
Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the
nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove
my statement' all you need to know is that you can initialize a variable but
you can't make further asignment to change its value. Thus, it's obviously
difficult to track state. Actually that's really bad idea to to solve any problem in XSLT by emulating
assignable variables. Obviously it's difficult to go against the way a
language is designed to be used.
In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of
recursion. All we know educational samples sometimes are really weird :) I'm sure there
is a better way to solve that problem. If the level of recursion cannot be
calculated using usual means, why not merely to pass it as a parameter?
I think that we can all agree that state maintenance is difficult with XSLT.
And purists can argue all they want that you shouldn't be tracking state,
and I agree that 97% of all my XSLT hasn't needed state maintenance, but it
is sometimes necessary and when it is, it is difficult.

Well, may be that's not so bad if only 3% of activity can be somewhat difficult?
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #8

P: n/a

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be a much more straightforward solution than "counting the dots via recursion". And no state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.

Once again, "state maintenance" meaning the capability to alter the contents of a variable, the value of which is some current state, is only needed by people, who want to solve a problem in a procedural/imperative (non-functional) way.


The original poster has not responded yet. So far, all but one
of the messages in this conversation is amongst respondents.
It's my best guess that Joseph and I both understand the
stateless nature of XSLT -- so mission accomplished.
Nov 11 '05 #9

P: n/a
Hi all
Thanks for all your post. I was able to accomplish my task using dom. I am
not even sure what you mean by state maintainence. but below I am producing
the simplified version of my xml and xsl

helpsystem.xml

<helpsystem>
<help id="a">
<text>A text</text>
<link href="abc.com">B text</link>
</help>
<help id="b">
<text>C text</text>
<link href="xyz.com">D text</link>
<link helpanchor="a" href="myhtmlfile.html"> E text </link>
</help>
<help id="c">
<link helpachor="b" href="myotherhtml.html" >F text </link>
</help>
</helpsystem>

helpsystem.xsl

<xsl:template match="Link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="@href"/>
</xsl:attribute>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>

<xsl:template match="Text">
<xsl:value-of select="."/>
</xsl:template>

Now I start by looking at help id ="c" which will produce the following html
<a href="myotherhtml.html>F text </a>

The problem is myotherhtml.html file has to be generated dynamically. This
html will look like
C text
<a href="xyz.com">D text</a>
<a href="myhtmlfile.html"> E text </a>

and again in this dynamically created html above, there is another link for
a dynamically created html. When I said recusion, what I meant that the html
generation should happen at each nested level.

I am not sure if this could be accomplish by plain xslt. I am using xslt
with dom and it is working. but anyway thanks a lot to all of you for your
input.

Rafia

"Grinder" <gr*****@no.spam.maam.com> wrote in message
news:ub*************@TK2MSFTNGP10.phx.gbl...

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
I don't think you explained clearly what is the problem.

From the little I can guess it seems to me that there can be

a much more
straightforward solution than "counting the dots via

recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.

Could you, please, formulate your problem precisely:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the

transformation satisfy.


Once again, "state maintenance" meaning the capability to

alter the contents
of a variable, the value of which is some current state, is

only needed by
people, who want to solve a problem in a

procedural/imperative
(non-functional) way.


The original poster has not responded yet. So far, all but one
of the messages in this conversation is amongst respondents.
It's my best guess that Joseph and I both understand the
stateless nature of XSLT -- so mission accomplished.

Nov 11 '05 #10

P: n/a
> I don't think you explained clearly what is the problem.

There is no problem at all. You asked for a practical example of where state
maintenance would be desirable during a transformation. I've given it to
you. In order to properly indent, you need to know the level of recursion
you are on.
From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.
Yes, just guesses. Come up with a better solution and post it. The code I
presented is based on the solution from XSLT 2nd Edition by Kay.
Once again, "state maintenance" meaning the capability to alter the contents of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.


OK, so show us how to solve this in the functional way.

- Joe Geretz -
Nov 11 '05 #11

P: n/a
> Well, may be that's not so bad if only 3% of activity can be somewhat
difficult?

Not so bad? Who said it was bad? It's EXCELLENT!

- Joe Geretz -

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:eK**************@TK2MSFTNGP11.phx.gbl...
Joseph Geretz wrote:
Hmm, I daresay that I'm not the first or only developer to use XSL to
produce a 'tree-like' HTML structure (e.g. menu) by recursing through the nodes of an XML DOM. But even if I were, this would still be a good
practical example, as you requested. As far as a practical example to 'prove my statement' all you need to know is that you can initialize a variable but you can't make further asignment to change its value. Thus, it's obviously difficult to track state. Actually that's really bad idea to to solve any problem in XSLT by

emulating assignable variables. Obviously it's difficult to go against the way a
language is designed to be used.
In a nutshell, $nodenum gives you the number of the node you're on (e.g.
3.4.6). By parsing this and counting dots, you can figure our the level of recursion. All we know educational samples sometimes are really weird :) I'm sure

there is a better way to solve that problem. If the level of recursion cannot be
calculated using usual means, why not merely to pass it as a parameter?
I think that we can all agree that state maintenance is difficult with XSLT. And purists can argue all they want that you shouldn't be tracking state, and I agree that 97% of all my XSLT hasn't needed state maintenance, but it is sometimes necessary and when it is, it is difficult. Well, may be that's not so bad if only 3% of activity can be somewhat

difficult? --
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel


Nov 11 '05 #12

P: n/a
> > I don't think you explained clearly what is the problem.

There is no problem at all. You asked for a practical example of where state
maintenance would be desirable during a transformation. I've given it to
you. In order to properly indent, you need to know the level of recursion
you are on.
No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.

From the little I can guess it seems to me that there can be a much more
straightforward solution than "counting the dots via recursion". And no
state maintaining (modification) will be necessary.

However, these are just guesses.
Yes, just guesses. Come up with a better solution and post it.


Better solution to what? To the unspecified problem?
The code I
presented is based on the solution from XSLT 2nd Edition by Kay.
You presented just one template with two xsl:param elements with undefined values...

No source xml document.

No desired output.

Really no formulation of the problem.
Shall I beg for you to specify the problem you want solved?
Once again, "state maintenance" meaning the capability to alter the contents
of a variable, the value of which is some current state, is only needed by
people, who want to solve a problem in a procedural/imperative
(non-functional) way.


OK, so show us how to solve this


What is "this"?
in the functional way.

- Joe Geretz -

Nov 11 '05 #13

P: n/a
> No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.


Like, do I owe you something dude? Get a job. You'll find that your
fascination with the thoeretical will diminish once you have something
practical to spend your time on.

- Joe Geretz -
Nov 11 '05 #14

P: n/a
Hi Chris,
As Dimitre does point out (although not particularly clearly in the midst of the rising flames) it is nearly always possible [I think Dimitre usually
asserts that it *is* always possible] to achieve something in XSLT without
state that would otherwise in a scripted environment require it.
Dimitre's reference to XSLT as a functional language is correct but
unfortunately the solutions are sometimes so esoteric and bloody difficult
to fathom (nevermind code) that they are usually missed.


Which was exactly my point. I never said that anything was impossible to
accomplish. Just pointed out that sometimes certain tasks are difficult to
accomplish. This is true of any development environment I've ever worked
with. Why choose VB for one task and C++ for another? It's not that
windowing is impossible in C++ or that pointers and callbacks are impossible
with VB. It's just that windowing is more convenient with VB and pointers
and callbacks are more convenient with C++.

The fact that XSL works in a functional, rather than in a procedural manner,
is simply that - a fact. It neither condemns, nor recommends the language.
What it does mean though is that XSL is more suitable to those problems
which can be conveniently solved in a functional manner, and less suitable
to those tasks which cannot be conveniently solved in this manner.

- Joe Geretz -
Nov 11 '05 #15

P: n/a
So you failed to provide any concrete problem that requires maintaining
/altering state.

Although expected it's a pity.
"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
No, you haven't provided:

1. XML source document

2. The exact wanted result

3. Description of what requirements should the transformation satisfy.


Like, do I owe you something dude? Get a job. You'll find that your
fascination with the thoeretical will diminish once you have something
practical to spend your time on.

- Joe Geretz -

Nov 11 '05 #16

P: n/a
> So if you want
to go ahead and develop a word processor or spreadhseet application in XSLT go ahead, I won't attempt to stop you. It's probably even 'possible'. Let us know when you're done.


No need to let you know.

Much more challenging applications have already been developed with
functional languages by people with imagination.
=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #17

P: n/a

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
So if you want
to go ahead and develop a word processor or spreadhseet
application in XSLT
go ahead, I won't attempt to stop you. It's probably even
'possible'. Let us
know when you're done.
No need to let you know.

Much more challenging applications have already been

developed with functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?
Nov 11 '05 #18

P: n/a
"Grinder" <gr*****@no.spam.maam.com> wrote in message news:<eH**************@TK2MSFTNGP10.phx.gbl>...
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
So if you want
to go ahead and develop a word processor or spreadhseet application in
XSLT go ahead, I won't attempt to stop you. It's probably even 'possible'. Let
us know when you're done.


No need to let you know.

Much more challenging applications have already been

developed with
functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?


Compilers and compiler-writing systems

Natural Language Recognition and Speech Recognition Systems

Theorem Provers

Computer Algebra

Games (a chess program, Quake, etc.), a games development kit

Animation

Reactive animation

Musical Composition.

Robotic Control systems

Web Servers

Operating system (smart-card)
See for example:

http://www.research.avayalabs.com/us...rld/index.html

and

http://www.haskell.org/practice.html


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL
Nov 11 '05 #19

P: n/a
Heh,
See for example:

http://www.research.avayalabs.com/us...rld/index.html
And every one a best seller!

Just for kicks I took a look at the link

Functional Programming in the Real World
Here is a list of functional programs applied to real-world tasks...

OK, but is anyone in the real world actually using any of these programs? I
see here that there's a neat FTP client. Hmm, let's check it out:

http://www.research.avayalabs.com/us...d/anonftp.html

LOL, it says here that as of September 1994 there was one person using this.
I bet by now millions of people are using this. Probably the author is too
busy distributing this popular FTP client to update the page since 1994.

ROTFLMHO!

Bottom line - it's important not to confuse possibility with suitability.
Unless of course, you live in an ivory tower.

(It's an odd sort of agenda, to be promoting functional programming as being
suitable for as broad a range of development tasks as are declarative
languages.)

- Joe Geretz -

"Dimitre Novatchev" <di******@eurosport.com> wrote in message
news:5f**************************@posting.google.c om... "Grinder" <gr*****@no.spam.maam.com> wrote in message

news:<eH**************@TK2MSFTNGP10.phx.gbl>...
"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
> So if you want
> to go ahead and develop a word processor or spreadhseet

application in
XSLT
> go ahead, I won't attempt to stop you. It's probably even

'possible'. Let
us
> know when you're done.

No need to let you know.

Much more challenging applications have already been

developed with
functional languages by people with imagination.


Sincerely, I would like to see a word processor or spreadsheet
that's been written in a functional language, or something much
more challenging -- what did you have in mind when you wrote
this?


Compilers and compiler-writing systems

Natural Language Recognition and Speech Recognition Systems

Theorem Provers

Computer Algebra

Games (a chess program, Quake, etc.), a games development kit

Animation

Reactive animation

Musical Composition.

Robotic Control systems

Web Servers

Operating system (smart-card)
See for example:

http://www.research.avayalabs.com/us...rld/index.html

and

http://www.haskell.org/practice.html


=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

Nov 11 '05 #20

P: n/a
OK, but is anyone in the real world actually using any of these programs?


Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming
language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language for
large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony switches
are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a few
minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles Haskell to
either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables, existential
and universal quantification, unboxed types, exceptions, weak pointers, and
so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.
Nov 11 '05 #21

P: n/a
OK,

There's obviously a time and place for functional languages. I'm not saying
otherwise. However, it's just as obvious (to me at least) that functional
languages will lend themselves better to some tasks, and procedural
languages will lend themselves better to other tasks.

Which was the original premise; you can go back along the thread and look it
up. Simply my advice to the original poster that tracking state would be
difficult with XSL. (I remember how surprised I was personally to find this
out when I began using XSL.) I did not advise the original poster in any way
to either choose or reject XSL for his particular task. (Although, seemingly
others on the thread automatically jumped to the conclusion that that one
remark (which is after all, factual) reflected a condemnation of the
language for any purpose.)

In order to demonstrate the suitability of various languages for various
tasks, my original challenge was to produce a word processor or spreadsheet
application using XSL as the language medium. The premise is obviously
absurd (although I won't say impossible ;-). You answered showing that
functional languages (although not necessarily XSL) could be used to solve
such problems. I thank you for that, and I'll take a closer look at some of
these. I see several free versions of Haskell and I'd like to take a closer
look at this.

Once the flames die down (and I hope they have), hopefully we can all take
away the impression that different language mediums have different strengths
and weaknesses, and are threfore suitable for different types of tasks.
Personally, the application I am currently working on is a Win32 UI
application, however many areas of the UI display are actually embedded
browser areas which display HTML which is produced as the result of
XML/XSLT. So I use XSL for presentation purposes, however much of the
processing is performed in-code (VB6) before XML is emitted. (Which is what
confused me on a different thread when you refered to my VB code statements
as 'script'. I'm not working in a scripting environment (e.g. ASP, etc.))
Ultimately, in my current environment, for any given operation I have the
'luxury' of choosing to implement it at the presentation layer in XSL, or
further down in the business or data layers using procedural code. Sometimes
I'll choose to place even a UI operation at the highest level of my
procedural code (just before XML is emitted). It's not that these operations
are impossible to perform in XSL, it's just that often I'll get more 'bang
for the buck' by a procedural implementation, than by a functional one.

And sometimes it's vice versa. Obviously - otherwise I wouldn't be using XSL
in the first place to generate my UI. I don't need to. I can develop
standard Win32 forms. But I chose to take the XSL approach because it does
offer certain strengths.

- Joe Geretz -

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
OK, but is anyone in the real world actually using any of these
programs?
Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language for large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony switches
are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a few minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles Haskell to either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables, existential and universal quantification, unboxed types, exceptions, weak pointers, and so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.

Nov 11 '05 #22

P: n/a
Ice
I'm interested to hear how you are using XML/XSL to generate your screens,
if you could give me more information, I'd appreciate it!

ice
"Joseph Geretz" <jg*****@nospam.com> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
OK,

There's obviously a time and place for functional languages. I'm not saying otherwise. However, it's just as obvious (to me at least) that functional
languages will lend themselves better to some tasks, and procedural
languages will lend themselves better to other tasks.

Which was the original premise; you can go back along the thread and look it up. Simply my advice to the original poster that tracking state would be
difficult with XSL. (I remember how surprised I was personally to find this out when I began using XSL.) I did not advise the original poster in any way to either choose or reject XSL for his particular task. (Although, seemingly others on the thread automatically jumped to the conclusion that that one
remark (which is after all, factual) reflected a condemnation of the
language for any purpose.)

In order to demonstrate the suitability of various languages for various
tasks, my original challenge was to produce a word processor or spreadsheet application using XSL as the language medium. The premise is obviously
absurd (although I won't say impossible ;-). You answered showing that
functional languages (although not necessarily XSL) could be used to solve
such problems. I thank you for that, and I'll take a closer look at some of these. I see several free versions of Haskell and I'd like to take a closer look at this.

Once the flames die down (and I hope they have), hopefully we can all take
away the impression that different language mediums have different strengths and weaknesses, and are threfore suitable for different types of tasks.
Personally, the application I am currently working on is a Win32 UI
application, however many areas of the UI display are actually embedded
browser areas which display HTML which is produced as the result of
XML/XSLT. So I use XSL for presentation purposes, however much of the
processing is performed in-code (VB6) before XML is emitted. (Which is what confused me on a different thread when you refered to my VB code statements as 'script'. I'm not working in a scripting environment (e.g. ASP, etc.))
Ultimately, in my current environment, for any given operation I have the
'luxury' of choosing to implement it at the presentation layer in XSL, or
further down in the business or data layers using procedural code. Sometimes I'll choose to place even a UI operation at the highest level of my
procedural code (just before XML is emitted). It's not that these operations are impossible to perform in XSL, it's just that often I'll get more 'bang
for the buck' by a procedural implementation, than by a functional one.

And sometimes it's vice versa. Obviously - otherwise I wouldn't be using XSL in the first place to generate my UI. I don't need to. I can develop
standard Win32 forms. But I chose to take the XSL approach because it does
offer certain strengths.

- Joe Geretz -

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bj************@ID-152440.news.uni-berlin.de...
OK, but is anyone in the real world actually using any of these programs?

Of course, there are bestsellers.

Millions of people are using Ericsson telecommunications products. All
communications software of Ericsson is written in the functional programming
language ERLANG.

ERLANG is a dynamically typed concurrent functional programming language

for
large industrial real-time systems. Erlang is a powerful development
environment for real time applications. Ericsson's own telephony

switches are programmed in the language.
ERLANG provides facilities for developing fault-tolerant, distributed
applications.

Because this software is used by so many clients, the fault tolerant
requirements are extremely important -- AFAIK the downtime allowed is a

few
minutes per year. And they are successfully met by the software produced
using this FP language.

Another massively used product is GHC (Glasgow Haskell Compiler).
The Glasgow Haskell Compiler is a robust, fully-featured, optimising
compiler and interactive environment for Haskell 98, GHC compiles

Haskell to
either native code or C. It implements numerous experimental language
extensions to Haskell 98; for example: concurrency, a foreign language
interface, multi-parameter type classes, scoped type variables,

existential
and universal quantification, unboxed types, exceptions, weak pointers,

and
so on. GHC comes with a generational garbage collector, and a space and
time profiler.

GHC is itself written in Haskell. It is the most popular compiler and
programming environment for Haskell programmers and is used massively in
their daily work.


Nov 11 '05 #23

This discussion thread is closed

Replies have been disabled for this discussion.