Yamlt?

Hi all.

A short question.

XML has XSLT (which is XML itself)
JSON has less-known JSONT (http://goessner.net/articles/jsont/), which also
is JSON itself.

What about YAMLT? Is it exists? Can it be useful? How can it look?

More practically: is it worse trying to write YAMLT implementation in Ruby?

V.

Hi all.

A short question.

XML has XSLT (which is XML itself)
JSON has less-known JSONT (JsonT - Transforming Json), which also
is JSON itself.

What about YAMLT? Is it exists? Can it be useful? How can it look?

I don't think there's anything like that. Can't you just manipulate
the data in-memory?

···

On 6/17/06, Victor 'Zverok' Shepelev <vshepelev@imho.com.ua> wrote:

More practically: is it worse trying to write YAMLT implementation in Ruby?

V.

--
- Simen

I would think you could use marshaling to accomplish this. Just write your own dumper/loader class:

# Create a sample YAML file.
require 'yaml'
tree = { :name => 'ruby',
  :uses => [ 'scripting', 'web', 'testing', 'etc' ] }
File.open("tree.yaml", "w") {|f| YAML.dump(tree, f)}

# A transformer.
require 'nezbit'
require 'yaml'
tree = YAML.load_file("tree.yaml")
File.open("tree.nzb", "w") { |f| Nezbit.dump(tree, f)}

# And finally, a routine to use the transformed data.
require 'nezbit'
tree = Nezbit.load_file("tree.nzb")

Regards,
   JJ

···

On 17-Jun-2006, at 08:51, Victor 'Zverok' Shepelev wrote:

Hi all.

A short question.

XML has XSLT (which is XML itself)
JSON has less-known JSONT (JsonT - Transforming Json), which also
is JSON itself.

What about YAMLT? Is it exists? Can it be useful? How can it look?

More practically: is it worse trying to write YAMLT implementation in Ruby?

V.

---
"America goes not abroad in search of monsters to destroy." -- John Quincy Adams

Victor 'Zverok' Shepelev wrote:

XML has XSLT (which is XML itself)
JSON has less-known JSONT (JsonT - Transforming Json), which also
is JSON itself.

What about YAMLT? Is it exists? Can it be useful? How can it look?

If JSON is YAML (which it pretty much is), then JSONT is YAMLT.

http://redhanded.hobix.com/inspect/yamlIsJson.html
http://redhanded.hobix.com/inspect/jsonCloserToYamlButNoCigarThanksAlotWhitespace.html

Cheers,
Dave

> Hi all.
>
> A short question.
>
> XML has XSLT (which is XML itself)
> JSON has less-known JSONT (JsonT - Transforming Json), which
also
> is JSON itself.
>
> What about YAMLT? Is it exists? Can it be useful? How can it look?
>

I don't think there's anything like that. Can't you just manipulate
the data in-memory?

Of course, I can (as well, as manipulate XML DOM without XSLT).
But in-memory manipulations code can lack declarative look.
Honestly speaking, Ruby's data manipluations (all those sexy
iterators/enumerators, you know) IS declarative enough.

But, if it were YAML subset which can be interpreted as YAML transformations
declaration, it can be useful. Right?

> More practically: is it worse trying to write YAMLT implementation in
Ruby?
>
> V.
- Simen

V.

···

From: Simen Edvardsen [mailto:toalett@gmail.com]
Sent: Sunday, June 18, 2006 2:44 PM

On 6/17/06, Victor 'Zverok' Shepelev <vshepelev@imho.com.ua> wrote:

To: ruby-talk ML
Subject: Re: YAMLT ?

> Hi all.
>
> A short question.
>
> XML has XSLT (which is XML itself)
> JSON has less-known JSONT (JsonT - Transforming Json), which
> also
> is JSON itself.
>
> What about YAMLT? Is it exists? Can it be useful? How can it look?
>
> More practically: is it worse trying to write YAMLT implementation in
> Ruby?
>
> V.
>
>
I would think you could use marshaling to accomplish this. Just write
your own dumper/loader class:

# Create a sample YAML file.
require 'yaml'
tree = { :name => 'ruby',
  :uses => [ 'scripting', 'web', 'testing', 'etc' ] }
File.open("tree.yaml", "w") {|f| YAML.dump(tree, f)}

# A transformer.
require 'nezbit'
require 'yaml'
tree = YAML.load_file("tree.yaml")
File.open("tree.nzb", "w") { |f| Nezbit.dump(tree, f)}

# And finally, a routine to use the transformed data.
require 'nezbit'
tree = Nezbit.load_file("tree.nzb")

Regards,
   JJ

Sorry, but I can't understand the example :frowning:
What is 'Nezbit' ? How it all works?

V.

···

From: John Johnson [mailto:johnatl@mac.com]
Sent: Thursday, June 22, 2006 5:30 AM

On 17-Jun-2006, at 08:51, Victor 'Zverok' Shepelev wrote:

Additionally, this would be wonderful to have for Web-based projects.
I know quite a few folks implement their sites in XML. Going for
Ruby->XML>XSLT chain is an overkill imho

···

On 6/18/06, Victor 'Zverok' Shepelev <vshepelev@imho.com.ua> wrote:

From: Simen Edvardsen [mailto:toalett@gmail.com]
Sent: Sunday, June 18, 2006 2:44 PM
> On 6/17/06, Victor 'Zverok' Shepelev <vshepelev@imho.com.ua> wrote:
> > Hi all.
> >
> > A short question.
> >
> > XML has XSLT (which is XML itself)
> > JSON has less-known JSONT (JsonT - Transforming Json), which
> also
> > is JSON itself.
> >
> > What about YAMLT? Is it exists? Can it be useful? How can it look?
> >
>
> I don't think there's anything like that. Can't you just manipulate
> the data in-memory?

Of course, I can (as well, as manipulate XML DOM without XSLT).
But in-memory manipulations code can lack declarative look.
Honestly speaking, Ruby's data manipluations (all those sexy
iterators/enumerators, you know) IS declarative enough.

But, if it were YAML subset which can be interpreted as YAML transformations
declaration, it can be useful. Right?

> > More practically: is it worse trying to write YAMLT implementation in
> Ruby?
> >