2009-12-03 7 views

Répondre

8

avait à faire

xml.tag!("gx:tour") 
4

Oui, et si vous voulez mettre une certaine valeur, ce serait quelque chose comme

xml.tag!("gx:tour", "value of gx:tour", "attribute1"=>"attribute1val", "attribute2"=>"attribute2val", ..., "attributeN"=>"attributeNval") 
1

Depuis la version 2 du constructeur, il est some support for namespacing.

Alors maintenant, si vous voulez obtenir le même résultat, vous pouvez ajouter un espace avant les deux points:

xml = builder.gx :Tour 
4

Si vous souhaitez ajouter une autre balise dans la balise puis

xml.tag!("tag:name", attribute: "value") do |t| 
    t.title("value for title") 
end 

Et si vous voulez mettre une valeur simple alors

xml.tag!("tag:name","value for tag", attribute: "attribute value")