XSLT for WinForms?

  • Thread starter Thread starter Evan Stone
  • Start date Start date
E

Evan Stone

Hello All,

I was just curious to see if there was some analog to XSLT in WinForms.
I'd like to be able to have my data be defined in XML, then process it
with some kind of style sheet/transformation to dyamically "render"
forms and their constituent controls on-the-fly.

Would XAML fit this description, or am I barking up the wrong tree?

Thanks In Advance!

-Evan
 
Evan,

I don't think there is a relation between WinForms and XML. XSLT is an
XML based technology used for transforming infosets into different
representations. WinForms is a presentation layer for .NET. XAML is a
language that is used for Avalon development, which is another presentation
layer based on managed code.

There is little, if any, overlap here.

You can use XSLT to produce anything you want. Perhaps you are
confusing the fact that XSLT generators can output HTML?
 
Evan Stone said:
Hello All,

I was just curious to see if there was some analog to XSLT in WinForms.
I'd like to be able to have my data be defined in XML, then process it
with some kind of style sheet/transformation to dyamically "render" forms
and their constituent controls on-the-fly.

Would XAML fit this description, or am I barking up the wrong tree?

Thanks In Advance!

-Evan

Nicholas (above) is correct. XSLT is a "transform" document for XML data.
You can use it for whatever you like I suppose.

There should be nothing keeping you from either using the DynamicAttributes
property of most objects or deciding on an XML (or other) format that best
describes your Form layout. Then you can create documentation on how to
edit the FormConfig.xml and you have a configurable GUI.

Tom P.
 
Thanks for the info, but I think you need to read my original post again.

I wasn't asking for a way to transform XML into WinForm data using XSLT
specifically, but rather was asking if there was an existing framework
which behaved in a simliar fashion: i.e. a form _description_ in XML
which then gets "compiled" at runtime into a Form with controls.

From what I've read here:

http://www.ondotnet.com/pub/a/dotnet/2004/01/19/longhorn.html

It sounds like XAML comes pretty darn close to that goal, especially if
one opts to compile at runtime. I haven't done any experiments with XAML
yet, so that's pretty much conjecture on my part, but it seems reasonable.

I'm actually a little surprised that there isn't already a framework
that exists to do this (aside from XAML/Avalon), since this is a fairly
common problem to address among metadata-driven UIs.

Perhaps this is an opportunity to create such a system... :)

Thanks!

-Evan
 
I believe you are talking about Avalon. Availability...couple years, if not
longer.

Actually, I believe I that have heard of a company offering a package to do
what you are talking about. I don't recall their name. They are basically
(as I understood it) promoting their package as a way of playing around with
Avalon without having to wait for Avalon. You might try doing a Google
search. Maybe a search term something like "Windows XAML". You might also
try checking Xtras.net as they carry a pretty good selection of 3rd party
software.

If you keep your requirements pretty simple, it may not be too hard to
implement your basic implementation. Something like this for creating the
controls:

for each element in the document
determine the control's type
create the control
set the control's size and location
next element

And then to get the data:

for each control
append the Control.Text to the data
next
return the data

Richard Rosenheim
 
Richard:
Actually, I believe I that have heard of a company offering a package to do
what you are talking about. I don't recall their name. They are basically
(as I understood it) promoting their package as a way of playing around with
Avalon without having to wait for Avalon.

You're referring to Xamlon here, right? I looked at their offering a
little while ago and it didn't exactly fill my need at the time, but
since the topic of XAML is rearing its ugly head again perhaps I'll take
another look, since the context under which I was examining it in the
past was a bit different...

I'll see what Xamlon can do for us, and in the meantime if anyone else
has any more suggestions I'd be open to hearing them. :)

Thanks!

-Evan
 
From what I've read here:
http://www.ondotnet.com/pub/a/dotnet/2004/01/19/longhorn.html

It sounds like XAML comes pretty darn close to that goal, especially if
one opts to compile at runtime. I haven't done any experiments with XAML
yet, so that's pretty much conjecture on my part, but it seems reasonable.

I'm actually a little surprised that there isn't already a framework
that exists to do this (aside from XAML/Avalon), since this is a fairly
common problem to address among metadata-driven UIs.

You could have a look at one of the at least two fairly seroius
"Avalon-lookalikes" for pre-Avalon developers:

MyXAML (free) http://www.myxaml.com
Xamlon (commercial) http://www.xamlon.com

Enjoy!
Marc

================================================================
Marc Scheuner May The Source Be With You!
Berne, Switzerland m.scheuner -at- inova.ch
 
Evan,

I like the way you think. We are similar thinkers. I am currently working on
an XSD defined data framework, and ultimately I will generate GUI's as well
as database schema's and data access layers from this XSD.

Maybe you and I can collaborate and swap ideas a little more.

I did a test case a year back which actually let you edit a running form,
like you could pickup and resize controls. I have a few weird things like
that. Another lets you scrape out the data of a running form and repopulate
it for setting up tests on UI's.

Chris.
 
Back
Top