David Kahn
2010-Dec-09 17:20 UTC
[OT] Embed xml doc within an xml doc from untruted source?
Off topic but I am sure someone here might have seen this: I have a web service which returns an xml document. Within this document I embed an xml document from a foreign source (so I dont want the validity of my xml to be predicated on whatever this provider happens to return. This foreign xml doc by the way contains a CDATA within it, so wrapping the full xml doc in CDATA does not work. The best I can come up with is to escape the entire foreign xml with <lt; and <gt;. Is there another better way to go about this? David -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Marnen Laibow-Koser
2010-Dec-09 18:38 UTC
Re: [OT] Embed xml doc within an xml doc from untruted source?
David Kahn wrote in post #967475:> Off topicThen don''t post it here!> but I am sure someone here might have seen this: > I have a web service which returns an xml document. Within this document > I > embed an xml document from a foreign source (so I dont want the validity > of > my xml to be predicated on whatever this provider happens to return. > This > foreign xml doc by the way contains a CDATA within it, so wrapping the > full > xml doc in CDATA does not work. The best I can come up with is to escape > the > entire foreign xml with <lt; and <gt;. Is there another better way to go > about this?I''ve seen the suggestion to just escape the ]]> in the inner CDATA to ]]> But this seems like a dreadful way to go about the problem. If you can reanalyze your design so you don''t need the nested XML documents, do; otherwise, take this discussion to an XML community where it will be on topic and where more XML gurus will be able to answer your question.> > DavidBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.