Dear Ruby on Rails Experts,
I''m having difficulties writing XML document. So far i''ve
writen it
using rxml.
Here is my rxml file :
xml.instruct! :xml, :version=>"1.0"
xml.Order( "xmlns" =>
"urn:oasis:names:specification:ubl:schema:xsd:Order-1.0","xmlns:cac"
)
do
xml.tag!("BuyersID",123)
[1] xml.tag!("cbc:LineExtensionTotalAmount",438.50)
xml.tag!("cbc:IssueDate",@order_o.delivery.order_date)
xml.tag!("cac:BuyerParty") do
xml.tag!("cbc:Party") do
xml.tag!("cbc:PartyName") do
xml.tag!("cbc:Name",@order_o.buyer.name)
end
xml.tag!("cbc:Address") do
xml.tag!("cbc:StreetName",@order_o.buyer.address)
xml.tag!("cbc:ContrySubentityCode",@order_o.buyer.country)
end
xml.tag!("cbc:Contact") do
xml.tag!("cbc:name",@order_o.buyer.name)
end
end
end
xml.tag!("cac:SellerParty") do
xml.tag!("cbc:Party") do
xml.tag!("cbc:PartyName") do
xml.tag!("cbc:Name",@order_o.seller.name)
end
xml.tag!("cbc:Address") do
xml.tag!("cbc:StreetName",@order_o.seller.address)
xml.tag!("cbc:ContrySubentityCode",@order_o.seller.country)
end
end
end
xml.tag!("cac:Delivery") do
xml.tag!("cac:RequestedDeliveryDateTime",
@order_o.delivery.order_date)
xml.tag!("cac:DeliveryAddress") do
xml.tag!("cbc:StreetName",@order_o.delivery.address)
xml.tag!("cbc:BuildingNumber","")
xml.tag!("cbc:ContrySubentityCode",@order_o.delivery.country)
end
end
xml.tag!("cac:DeliveryTerms") do
xml.tag!("cac:SpecialTerms",@order_o.delivery.terms)
end
end
end
As you can see at [2], i''m trying to write XML line like this :
<cbc:LineExtensionTotalAmount amountCurrencyCodeListVersionID="0.3"
amountCurrencyID="USD"> 438.50
</cbc:LineExtensionTotalAmount>
But so far i can only write like this :
<cbc:LineExtensionTotalAmount>438.50</cbc:LineExtensionTotalAmount>
Thank You
p.s. Do anyone know an easy example how Ruby on Rails calls
Java/.NET/PHP webservices (other than Ruby) ?
Thank you again :D
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---
Amri Hidayat wrote:> As you can see at [2], i''m trying to write XML line like this : > > <cbc:LineExtensionTotalAmount amountCurrencyCodeListVersionID="0.3" > amountCurrencyID="USD"> 438.50 </cbc:LineExtensionTotalAmount> > > But so far i can only write like this : > > <cbc:LineExtensionTotalAmount>438.50</cbc:LineExtensionTotalAmount> > > > > Thank You > > p.s. Do anyone know an easy example how Ruby on Rails calls > Java/.NET/PHP webservices (other than Ruby) ? > > Thank you again :DHi, You can try something like this to create attributes: xml.div( :class=> "leadNotification") Thanks, Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Michael Modica wrote:> Amri Hidayat wrote: > >> As you can see at [2], i''m trying to write XML line like this : >> >> <cbc:LineExtensionTotalAmount amountCurrencyCodeListVersionID="0.3" >> amountCurrencyID="USD"> 438.50 </cbc:LineExtensionTotalAmount> >> >> But so far i can only write like this : >> >> <cbc:LineExtensionTotalAmount>438.50</cbc:LineExtensionTotalAmount> >> >> >> >> Thank You >> >> p.s. Do anyone know an easy example how Ruby on Rails calls >> Java/.NET/PHP webservices (other than Ruby) ? >> >> Thank you again :D > > Hi, > > You can try something like this to create attributes: > > xml.div( :class=> "leadNotification") > > Thanks, > > MichaelDear Michael, Thanx a lot .. but can i have an example for this one :D please ? coz i''m still new in XML writing Again, Thanx -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
> > Dear Michael, > > Thanx a lot .. but can i have an example for this one :D please ? coz > i''m still new in XML writing > > Again, ThanxHi Amri, Try adding that sample to your existing sample. You should end up with an element called div, with an attribute called class and a value of that attribute as LeadNotification. You can put other elements inside of it before you close it out using a standard end statement. Regards, Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---