Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > XML in Ruby syntax

Reply
Thread Tools

XML in Ruby syntax

 
 
Trans
Guest
Posts: n/a
 
      09-30-2007
Recently I saw an announcement for an XML/HTML builder lib that
embedded the XML directly in Ruby code. What was it? I can't seem to
find it now.

Thanks,
T.


 
Reply With Quote
 
 
 
 
Jesús Gabriel y Galán
Guest
Posts: n/a
 
      09-30-2007
On 9/30/07, Trans <> wrote:
> Recently I saw an announcement for an XML/HTML builder lib that
> embedded the XML directly in Ruby code. What was it? I can't seem to
> find it now.


Hi,

It was a post/email (I use the mailing list) from Michael Neumann on
September 15th at 12:13 AM (that's the date I received the email). I
have copied that email below. BTW, how do you guys find the link to
the archives for a specific thread?

Jesus.



On 9/15/07, Michael Neumann <> wrote:
> Hi,
>
> While everyone embeds Ruby into HTML code nowadays, I thought why not
> do it the other way round? Vim syntax highlighting included
>
> http://www.ntecs.de/hg-projects/xml_in_ruby/
>
> Uh, and it's soo simple, and you get a lot of goodies for free (for
> example you can split your templates into methods, or inherit from other
> template classes etc.).
>
> Regards,
>
> Michael
>
> --------------------------------
> XML in Ruby - Templating Engine
> --------------------------------
>
> ABOUT
>
> "XML in Ruby" is a simple templating engine that allows you to embed
> XML directly into Ruby.
>
> EXAMPLE
>
> See sample.rbx.
>
> class MyView < View
> def index(title)
> <html>
> <head>
> <title>${title}</title>
> </head>
> <body>
> render_body
> </body>
> </html>
> end
>
> def render_body
> output "Hello World"
> end
> end
>
> puts MyView.render(:index, "Test")
>
> To start:
>
> ruby -r view -e "View.require 'sample.rbx'"
>
> Output:
>
> <html>
> <head>
> <title>Test</title>
> </head>
> <body>
> Hello World</body>
> </html>
>
> You can mix XML and Ruby. Everything that starts with "<" as
> fist non-whitespace character on a line is considered as XML.
> You can also use:
>
> <: This is text
>
> to output the text " This is text", or require other
> "templates" with:
>
> View.require 'another_template.rbx'
>
> In XML you can embed Ruby code with #{...} and ${...}. The second
> performs escaping.
>
>
>


 
Reply With Quote
 
 
 
 
Trans
Guest
Posts: n/a
 
      09-30-2007


On Sep 30, 6:38 am, "Jes=FAs Gabriel y Gal=E1n" <jgabrielyga...@gmail.com>
wrote:

> Hi,
>
> It was a post/email (I use the mailing list) from Michael Neumann on
> September 15th at 12:13 AM (that's the date I received the email). I
> have copied that email below. BTW, how do you guys find the link to
> the archives for a specific thread?


I use the Google Group link. But the archives have different views,
providing the message number is enough for someone to quickly pull up
a post.

Thanks,

T=2E


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Syntax bug, in 1.8.5? return not (some expr) <-- syntax error vsreturn (not (some expr)) <-- fine Good Night Moon Ruby 9 07-25-2007 04:51 PM
[ANN] SqlStatement 1.0.0 - hide the syntax of SQL behind familiarruby syntax Ken Bloom Ruby 3 10-09-2006 06:46 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Syntax highligth with textile: Syntax+RedCloth ? gabriele renzi Ruby 2 12-31-2005 02:44 AM
Checking XML DTD syntax and validating XML Clifford W. Racz XML 8 06-23-2004 08:12 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57