# Valid RDFa in XHTML

**URL:** <https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460>\
**Category:** Rails\
**Created:** [June 17, 2009, 8:11pm UTC](https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460 "2009-06-17T20:11:35Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![cephas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@cephas](https://www.ruby-forum.com/u/cephas)\
**Post date:** [June 17, 2009, 8:11pm UTC](https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460/1 "2009-06-17T20:11:35Z")

</div>

I am tying to create pages with RDFa.

The two ways I have looked into is:

1. Use builder to create the page

2. Use the RDFa gem

3. Works except that there are some things that I can’t seem to do  
with the Builder syntax

4. Works except that it does not create valid XHTML. (Maybe I am using  
it incorrectly)

How are people creating valid RDFa pages?

Any recommendations?

Thanks!

- Pete

---

<div class="post-metadata">

**Author:** ![cephas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@cephas](https://www.ruby-forum.com/u/cephas)\
**Post date:** [June 17, 2009, 9:17pm UTC](https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460/2 "2009-06-17T21:17:54Z")

</div>

Hi Pete,  
On Wed, 2009-06-17 at 11:10 -0700, Pete wrote:

> How are people creating valid RDFa pages?
> 
> Any recommendations?

I haven’t worked with RDFA yet but you might try REXML. It’s a typical  
next step when builder falls short.

HTH,  
Bill

---

<div class="post-metadata">

**Author:** ![cephas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@cephas](https://www.ruby-forum.com/u/cephas)\
**Post date:** [June 17, 2009, 9:45pm UTC](https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460/3 "2009-06-17T21:45:34Z")

</div>

bill walton wrote:

> Hi Pete,  
> On Wed, 2009-06-17 at 11:10 -0700, Pete wrote:
> 
> > How are people creating valid RDFa pages?
> > 
> > Any recommendations?
> 
> I haven’t worked with RDFA yet but you might try REXML. It’s a typical  
> next step when builder falls short.

I haven’t worked with RDFa either, but it’s worth remembering that ERb  
and Haml will generate XML just as easily as HTML.

> HTH,  
> Bill

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![cephas](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e0b2c6/32.png) [@cephas](https://www.ruby-forum.com/u/cephas)\
**Post date:** [July 2, 2009, 2:38am UTC](https://www.ruby-forum.com/t/valid-rdfa-in-xhtml/170460/4 "2009-07-02T02:38:05Z")

</div>

I think I discovered why I was not able to create some more complex  
XHTML structures, including those for RDFa in builder

The syntax was not what I expected.

For instance:

I thought that this should work, but it does not.

xml.td(:class =\> “family\_title”, “Family”) would get me this Family

However, this does work. You need to have the

xml.td(“Family”, :class =\> “family\_title”) this will get you this Family

One things that I already knew about, but may trip other up is that  
you need to also make sure that you have the right mimetype set in  
your config/initializers.

Hope this helps someone else 🙂

- Pete
