Need help with xml and xsl design | | |
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"[color=blue]
>some text data </link>[/color]
</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 | | | | re: Need help with xml and xsl design
Rafia Tapia wrote:
[color=blue]
> 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.[/color]
Does this explanation mean you need to produce multiple outputs from single
transformation and that's your problem?
[color=blue]
> In a traditional programming I would have accomplish this task using
> recursion but how can I do this using xsl.[/color]
Never heard of any problem with recursion in XSLT.
--
Oleg Tkachenko http://www.tkachenko.com/blog
Multiconn Technologies, Israel | | | | re: Need help with xml and xsl design
Hello Oleg,
[color=blue][color=green]
> > In a traditional programming I would have accomplish this task using
> > recursion but how can I do this using xsl.[/color]
> Never heard of any problem with recursion in XSLT.[/color]
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 - | | | | re: Need help with xml and xsl design
> 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 | | | | re: Need help with xml and xsl design
"Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
news:bj0brn$e2gsl$1@ID-152440.news.uni-berlin.de...[color=blue][color=green]
> > Still, if you attempt to "maintain a state," it is a[/color][/color]
problem.[color=blue]
>
> You shouldn't.
>
> In XSLT one does not attempt to maintain state -- and this is[/color]
not a problem.[color=blue]
> If you want to use XSLT like you are using Fortran, then it[/color]
is better for[color=blue]
> you to continue to use Fortran.[/color]
You've made this point repeatedly clear. | | | | re: Need help with xml and xsl design
Hello Dimitre,
[color=blue][color=green]
> > Still, if you attempt to "maintain a state," it is a problem.[/color]
>
> You shouldn't.[/color]
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 - | | | | re: Need help with xml and xsl design
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" <jgeretz@nospam.com> wrote in message
news:ubG5FKNcDHA.2632@TK2MSFTNGP12.phx.gbl...[color=blue]
> Hello Dimitre,
>[color=green][color=darkred]
> > > Still, if you attempt to "maintain a state," it is a problem.[/color]
> >
> > You shouldn't.[/color]
>
> 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[/color]
'prove[color=blue]
> my statement' all you need to know is that you can initialize a variable[/color]
but[color=blue]
> 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[/color]
XSLT.[color=blue]
> 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[/color]
it[color=blue]
> is sometimes necessary and when it is, it is difficult.
>
> - Joe Geretz -
>
>[/color] | | | | re: Need help with xml and xsl design
Joseph Geretz wrote:
[color=blue]
> 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.[/color]
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.
[color=blue]
> 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.[/color]
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?
[color=blue]
> 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.[/color]
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 | | | | re: Need help with xml and xsl design
"Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
news:bj167q$e7oo6$1@ID-152440.news.uni-berlin.de...[color=blue]
> 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[/color]
a much more[color=blue]
> straightforward solution than "counting the dots via[/color]
recursion". And no[color=blue]
> 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[/color]
transformation satisfy.[color=blue]
>
>
> Once again, "state maintenance" meaning the capability to[/color]
alter the contents[color=blue]
> of a variable, the value of which is some current state, is[/color]
only needed by[color=blue]
> people, who want to solve a problem in a[/color]
procedural/imperative[color=blue]
> (non-functional) way.[/color]
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. | | | | re: Need help with xml and xsl design
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" <grinder@no.spam.maam.com> wrote in message
news:ubR9k5RcDHA.456@TK2MSFTNGP10.phx.gbl...[color=blue]
>
> "Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
> news:bj167q$e7oo6$1@ID-152440.news.uni-berlin.de...[color=green]
> > 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[/color]
> a much more[color=green]
> > straightforward solution than "counting the dots via[/color]
> recursion". And no[color=green]
> > 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[/color]
> transformation satisfy.[color=green]
> >
> >
> > Once again, "state maintenance" meaning the capability to[/color]
> alter the contents[color=green]
> > of a variable, the value of which is some current state, is[/color]
> only needed by[color=green]
> > people, who want to solve a problem in a[/color]
> procedural/imperative[color=green]
> > (non-functional) way.[/color]
>
> 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.
>
>[/color] | | | | re: Need help with xml and xsl design
> 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.
[color=blue]
> 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.[/color]
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.
[color=blue]
> Once again, "state maintenance" meaning the capability to alter the[/color]
contents[color=blue]
> 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.[/color]
OK, so show us how to solve this in the functional way.
- Joe Geretz - | | | | re: Need help with xml and xsl design
> 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:eKyoj4RcDHA.3044@TK2MSFTNGP11.phx.gbl...[color=blue]
> Joseph Geretz wrote:
>[color=green]
> > 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[/color][/color]
the[color=blue][color=green]
> > 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[/color][/color]
'prove[color=blue][color=green]
> > my statement' all you need to know is that you can initialize a variable[/color][/color]
but[color=blue][color=green]
> > you can't make further asignment to change its value. Thus, it's[/color][/color]
obviously[color=blue][color=green]
> > difficult to track state.[/color]
> Actually that's really bad idea to to solve any problem in XSLT by[/color]
emulating[color=blue]
> assignable variables. Obviously it's difficult to go against the way a
> language is designed to be used.
>[color=green]
> > 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[/color][/color]
of[color=blue][color=green]
> > recursion.[/color]
> All we know educational samples sometimes are really weird :) I'm sure[/color]
there[color=blue]
> 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?
>[color=green]
> > I think that we can all agree that state maintenance is difficult with[/color][/color]
XSLT.[color=blue][color=green]
> > And purists can argue all they want that you shouldn't be tracking[/color][/color]
state,[color=blue][color=green]
> > and I agree that 97% of all my XSLT hasn't needed state maintenance, but[/color][/color]
it[color=blue][color=green]
> > is sometimes necessary and when it is, it is difficult.[/color]
> Well, may be that's not so bad if only 3% of activity can be somewhat[/color]
difficult?[color=blue]
> --
> Oleg Tkachenko
> http://www.tkachenko.com/blog
> Multiconn Technologies, Israel
>[/color] | | | | re: Need help with xml and xsl design
> > I don't think you explained clearly what is the problem.[color=blue]
>
> 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.[/color]
No, you haven't provided:
1. XML source document
2. The exact wanted result
3. Description of what requirements should the transformation satisfy.
[color=blue]
>[color=green]
> > 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.[/color]
>
> Yes, just guesses. Come up with a better solution and post it.[/color]
Better solution to what? To the unspecified problem?
[color=blue]
> The code I
> presented is based on the solution from XSLT 2nd Edition by Kay.[/color]
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?
[color=blue]
>[color=green]
> > Once again, "state maintenance" meaning the capability to alter the[/color]
> contents[color=green]
> > 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.[/color]
>
> OK, so show us how to solve this[/color]
What is "this"?
[color=blue]
> in the functional way.
>
> - Joe Geretz -
>
>[/color] | | | | re: Need help with xml and xsl design
> No, you haven't provided:[color=blue]
>
> 1. XML source document
>
> 2. The exact wanted result
>
> 3. Description of what requirements should the transformation satisfy.[/color]
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 - | | | | re: Need help with xml and xsl design
Hi Chris,
[color=blue]
> As Dimitre does point out (although not particularly clearly in the midst[/color]
of[color=blue]
> 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.[/color]
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 - | | | | re: Need help with xml and xsl design
So you failed to provide any concrete problem that requires maintaining
/altering state.
Although expected it's a pity.
"Joseph Geretz" <jgeretz@nospam.com> wrote in message
news:%230e6izVcDHA.2960@tk2msftngp13.phx.gbl...[color=blue][color=green]
> > No, you haven't provided:
> >
> > 1. XML source document
> >
> > 2. The exact wanted result
> >
> > 3. Description of what requirements should the transformation satisfy.[/color]
>
> 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 -
>
>[/color] | | | | re: Need help with xml and xsl design
> So if you want[color=blue]
> to go ahead and develop a word processor or spreadhseet application in[/color]
XSLT[color=blue]
> go ahead, I won't attempt to stop you. It's probably even 'possible'. Let[/color]
us[color=blue]
> know when you're done.[/color]
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 | | | | re: Need help with xml and xsl design
"Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
news:bj3t5c$f1064$1@ID-152440.news.uni-berlin.de...[color=blue][color=green]
> > So if you want
> > to go ahead and develop a word processor or spreadhseet[/color][/color]
application in[color=blue]
> XSLT[color=green]
> > go ahead, I won't attempt to stop you. It's probably even[/color][/color]
'possible'. Let[color=blue]
> us[color=green]
> > know when you're done.[/color]
>
> No need to let you know.
>
> Much more challenging applications have already been[/color]
developed with[color=blue]
> functional languages by people with imagination.[/color]
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? | | | | re: Need help with xml and xsl design
"Grinder" <grinder@no.spam.maam.com> wrote in message news:<eHVgfSfcDHA.2460@TK2MSFTNGP10.phx.gbl>...[color=blue]
> "Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
> news:bj3t5c$f1064$1@ID-152440.news.uni-berlin.de...[color=green][color=darkred]
> > > So if you want
> > > to go ahead and develop a word processor or spreadhseet[/color][/color]
> application in
> XSLT[color=green][color=darkred]
> > > go ahead, I won't attempt to stop you. It's probably even[/color][/color]
> 'possible'. Let
> us[color=green][color=darkred]
> > > know when you're done.[/color]
> >
> > No need to let you know.
> >
> > Much more challenging applications have already been[/color]
> developed with[color=green]
> > functional languages by people with imagination.[/color]
>
> 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?[/color]
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 | | | | re: Need help with xml and xsl design
Heh,
[color=blue]
> See for example:
>
> http://www.research.avayalabs.com/us...rld/index.html[/color]
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" <dimitren@eurosport.com> wrote in message
news:5f726582.0309030545.15018198@posting.google.c om...[color=blue]
> "Grinder" <grinder@no.spam.maam.com> wrote in message[/color]
news:<eHVgfSfcDHA.2460@TK2MSFTNGP10.phx.gbl>...[color=blue][color=green]
> > "Dimitre Novatchev" <dnovatchev@yahoo.com> wrote in message
> > news:bj3t5c$f1064$1@ID-152440.news.uni-berlin.de...[color=darkred]
> > > > So if you want
> > > > to go ahead and develop a word processor or spreadhseet[/color]
> > application in
> > XSLT[color=darkred]
> > > > go ahead, I won't attempt to stop you. It's probably even[/color]
> > 'possible'. Let
> > us[color=darkred]
> > > > know when you're done.
> > >
> > > No need to let you know.
> > >
> > > Much more challenging applications have already been[/color]
> > developed with[color=darkred]
> > > functional languages by people with imagination.[/color]
> >
> > 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?[/color]
>
> 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[/color] | | | | re: Need help with xml and xsl design
[color=blue]
> OK, but is anyone in the real world actually using any of these programs?[/color]
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. | | | | re: Need help with xml and xsl design
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" <dnovatchev@yahoo.com> wrote in message
news:bj5gkk$f64e4$1@ID-152440.news.uni-berlin.de...[color=blue]
>[color=green]
> > OK, but is anyone in the real world actually using any of these[/color][/color]
programs?[color=blue]
>
> Of course, there are bestsellers.
>
> Millions of people are using Ericsson telecommunications products. All
> communications software of Ericsson is written in the functional[/color]
programming[color=blue]
> language ERLANG.
>
> ERLANG is a dynamically typed concurrent functional programming language[/color]
for[color=blue]
> 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[/color]
few[color=blue]
> 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[/color]
to[color=blue]
> 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,[/color]
existential[color=blue]
> and universal quantification, unboxed types, exceptions, weak pointers,[/color]
and[color=blue]
> 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.
>
>[/color] | | | | re: Need help with xml and xsl design
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" <jgeretz@nospam.com> wrote in message
news:eyMq6slcDHA.1772@TK2MSFTNGP10.phx.gbl...[color=blue]
> OK,
>
> There's obviously a time and place for functional languages. I'm not[/color]
saying[color=blue]
> 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[/color]
it[color=blue]
> 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[/color]
this[color=blue]
> out when I began using XSL.) I did not advise the original poster in any[/color]
way[color=blue]
> to either choose or reject XSL for his particular task. (Although,[/color]
seemingly[color=blue]
> 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[/color]
spreadsheet[color=blue]
> 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[/color]
of[color=blue]
> these. I see several free versions of Haskell and I'd like to take a[/color]
closer[color=blue]
> 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[/color]
strengths[color=blue]
> 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[/color]
what[color=blue]
> confused me on a different thread when you refered to my VB code[/color]
statements[color=blue]
> 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.[/color]
Sometimes[color=blue]
> 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[/color]
operations[color=blue]
> 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[/color]
XSL[color=blue]
> 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" <dnovatchev@yahoo.com> wrote in message
> news:bj5gkk$f64e4$1@ID-152440.news.uni-berlin.de...[color=green]
> >[color=darkred]
> > > OK, but is anyone in the real world actually using any of these[/color][/color]
> programs?[color=green]
> >
> > Of course, there are bestsellers.
> >
> > Millions of people are using Ericsson telecommunications products. All
> > communications software of Ericsson is written in the functional[/color]
> programming[color=green]
> > language ERLANG.
> >
> > ERLANG is a dynamically typed concurrent functional programming language[/color]
> for[color=green]
> > large industrial real-time systems. Erlang is a powerful development
> > environment for real time applications. Ericsson's own telephony[/color][/color]
switches[color=blue][color=green]
> > 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[/color]
> few[color=green]
> > 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[/color][/color]
Haskell[color=blue]
> to[color=green]
> > 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,[/color]
> existential[color=green]
> > and universal quantification, unboxed types, exceptions, weak pointers,[/color]
> and[color=green]
> > 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.
> >
> >[/color]
>
>[/color] |  | Similar .NET Framework bytes | | | /bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,327 network members.
|