dominik.aumayr-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2008-Jan-19 16:09 UTC
ActiveResource and XML-issues
Hi! I have a strange problem with ActiveResources: When ActiveResource parses the following XML, it throws a RuntimeError and displays the following Error-message: "can''t typecast "http://example.net/faktura units.xsd"" the xml: <?xml version="1.0" encoding="UTF-8"?> <units type="array" xsi:schemaLocation="http://dpippi.ps1.at/1/faktura units.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://dpippi.ps1.at/1/faktura"> <unit> <id>1</id> <name>kg</name> </unit> <unit> <id>2</id> <name>ltr</name> </unit> </units> When I remove the "xsi:schemaLocation"-attribute it works like it should. I found the Rails-changeset where this message ("can''t typecast...") was introduced, but that did not help me. (http://dev.rubyonrails.org/ changeset/7074?format=html&new=7074) Does anyone know if the "xsi:schemaLocation"-attribute means something special to ActiveResource? Thanks for any help and greetings, - dominik PS: I need this attribute for (pre-Rails) validation and so this is not a good solution! ;) --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
Rails can''t deserialize xml with namespaces. See: http://dev.rubyonrails.org/ticket/6473 On Jan 19, 8:09 am, "dominik.aum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dominik.aum...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi! > > I have a strange problem with ActiveResources: > > When ActiveResource parses the following XML, it throws a RuntimeError > and displays the following Error-message: > "can''t typecast "http://example.net/fakturaunits.xsd"" > > the xml: > <?xml version="1.0" encoding="UTF-8"?> > <units type="array" > xsi:schemaLocation="http://dpippi.ps1.at/1/fakturaunits.xsd" > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > xmlns="http://dpippi.ps1.at/1/faktura"> > <unit> > <id>1</id> > <name>kg</name> > </unit> > <unit> > <id>2</id> > <name>ltr</name> > </unit> > </units> > > When I remove the "xsi:schemaLocation"-attribute it works like it > should. > > I found the Rails-changeset where this message ("can''t typecast...") > was introduced, but that did not help me. (http://dev.rubyonrails.org/ > changeset/7074?format=html&new=7074) > > Does anyone know if the "xsi:schemaLocation"-attribute means something > special to ActiveResource? > > Thanks for any help and greetings, > - dominik > > PS: I need this attribute for (pre-Rails) validation and so this is > not a good solution! ;)--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---