search for: xmlmarkup

Displaying 20 results from an estimated 36 matches for "xmlmarkup".

Did you mean: mcmarkup
2005 May 01
5
Example using Builder::XmlMarkup and .rxml files?
Greetings, I''m a newby to both "R"s in RoR. I would like to use Builder::XmlMarkup to generate my pages. If there is a working downloadable example somewhere, that would probably be enough. Otherwise, here''s what I want to do: With the following controller: class AccountsController < ApplicationController layout ''accounts'' model :account d...
2007 Jun 11
2
Builder::XmlMarkup and dashes
Has anyone hacked Builder::XmlMarkup to dasherize underscore tags by default? I know I can use tag!, but I''d like to find a way for it to translate underscores to dashes automatically. In other words: xml.department_manager do "fred end #=> <department-manager>fred</department-manager> I tried hackin...
2007 Nov 21
4
Builder::XmlMarkup adds <inspect/> on printing and <clone/> on saving
...s "<clone/>" are added at the end of filetransfer.data. How can I avoid these entries? Printing has a similar effect. In that case "<inspect/>" is added every time I print. Locking forward to your hints SUzB **** code example **** filetransfer.data = Builder::XmlMarkup.new myxml = Builder::XmlMarkup.new(:target=>filetransfer.data, :indent=>2) myxml.instruct! #:xml, :version=>"1.0" myxml.OpenShipments("xmlns"=>"x-schema:OpenShipments.xdr"){ for row in parsed # contains rows of a parsed .csv file...
2009 Jan 21
1
AR to_xml problem with associations, Builder::XmlMarkup#to_a
When I do a to_xml(with a block) on an association of a model I got a Builder::XmlMarkup#to_ary should return Array Example that does not work. @intervenant = Intervenant.find(params[:id]) output = @intervenant.to_xml( :skip_types => false, :dasherize => false) do |xml| @intervenant.individu.to_xml( :builder => xml, :skip_instruct => true, :skip_types =>...
2009 Feb 19
0
Can't seem to instantiate Builder::XmlMarkup.new?
I am unable to instantiate the Builder::XmlMarkup.new on one development machine ( Windows ) and upon my CentOS server. When I run the same code on my Ubuntu 8.10 VMWare machine, everything runs great? In the Builder documentation ( http://builder.rubyforge.org/ ) it shows to put this at the top of the controller; require ''rubygems'...
2006 Apr 27
3
XML output
...ethod showme_xml in my controller manager_controller.rb class ManagerController < ApplicationController def shome_xml @from = params[:from] render :action => "showme_xml", :layout => nil end end I have got a shome_xml.rxml template in my view section. xml = Builder::XmlMarkup.new xml.response(:status => "NOT_AVAILABLE") xml.message("Some text") if @from != "none" <from>@from</from> end Am i understanding the use of Builder right? I am new to this and would love some feedback and/or pointers. Thanks. -- Pos...
2006 Jul 14
2
how to get builder 2.0 to escape attributes in rxml
I am using rxml to produce opml files and need to escape ampersands in the attributes. builder 2.0 docs found at http://builder.rubyforge.org/ show the following xml = Builder::XmlMarkup.new xml.sample(:escaped=>"This&That", :unescaped=>:"Here&amp;There") xml.target! => <sample escaped="This&amp;That" unescaped="Here&amp;There"/> I tried to install and repeat this result, but attributes are not escapi...
2006 Jul 03
2
XML Builder - xml header...
for some reason, i am getting an extra: <?xml version = "1.0"?> in my xml file.. i am using a file called: lastLogins.rxml and the code looks like: xml = Builder::XmlMarkup.new xml.instruct! :xml, :version=>"1.0", :encoding => ''ISO-8859-1'' xml.loginData do @lastLogins.each do |login| xml.entry do xml.user(login.user) xml.timestamp(login.timestamp) end end end this ends up inserting both headers:...
2006 Jan 30
5
a RJS problem/patch
...;'s better to set it forcely. --- add_rjs_to_action_view.rb.old 2006-01-31 01:42:59.000000000 +0900 +++ add_rjs_to_action_view.rb 2006-01-31 01:43:29.000000000 +0900 @@ -50,10 +50,10 @@ body = case extension.to_sym when :rxml "xml = Builder::XmlMarkup.new(:indent => 2)\n" + - "@controller.headers[''Content-Type''] ||= ''text/xml''\n" + + "@controller.headers[''Content-Type''] = ''text/xml''\n" + template...
2006 Jul 31
2
is it possible to make to_xml use underscore instead of dash?
Hi all, I am getting ActiveRecord to produce XML with render :xml => @user.to_xml However, on the client end it is a bit annoying for me to deal with attributes like first-name. I would much rather have first_name. Is there any way for me to turn off the behavior of converting _ to -? This seems to be done by a call to dasherize inside the to_xml of
2006 Jul 26
0
embedded DTD using Builder
Hello - I would like to include an embedded DTD in generated XML output. I am attempting to use the Builder::XmlMarkup class to do this. A simplified example follows: xml = Builder::XmlMarkup.new(:indent => 2) xml.declare! :DOCTYPE,:logs do xml.declare! :ELEMENT,:logs,''(log*)'' end The problem that I am encountering is the that second declare! call above is not generati...
2007 Jul 09
1
Changes to vendor/builder?
...e files in this folder? I just submitted my first patch (a doc patch) to a file in this folder, and I just realized it could be an external project. Then I noticed the XML Builder project in RubyForge. I also just noticed that most of the files under the builder folder are marked with nodoc, though XmlMarkup and BlankSlate are currently viewable in the rails documentation. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To post to this group, send email to rubyonrails-core@googlegrou...
2006 Nov 21
1
RXML vs form_tag etc
...ecause some of my generating code mixes Ruby and HTML so densely that the code is full of %><% markers. Dropping down to only one language would be a blessing. However, this documentation invariably avoids mentioning one tiny, insignificant detail: How do you inject raw HTML into a Builder::XmlMarkup builder? Each time I try, the Builder escapes everything, as if my users wanted to see my <form> tags and such, raw in their browser. So if I wanted to put form_tag and other view helpers into a Builder, how do I unescape the HTML they create? -- Phlip http://c2.com/cgi/wiki?ZeekLand...
2007 Oct 10
1
rxml cdata problem!!!!!
source) xml.list {xml.cdata! "test"} result) <list> <![CDATA[test]]> </list> but I want to <list><![CDATA[test]]></list> (because firefox don''t understand first result) how to????? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 May 17
0
ActiveResource 3 on MRI 191: NameError (uninitialized constant Builder::XmlBase::Symbol)
...ll to an AR.create will trigger it. Seems like a strategically placed require or include did the trick but I''m probably misremembering. The offending code in Builder is xmlbase:40: sym = "#{sym}:#{args.shift}" if args.first.kind_of?(Symbol) Why that method_missing is firing off xmlmarkup:239 is a bit of a mystery to me, as 239 is just: _ensure_no_block block_given? the backtrace: builder (2.1.2) lib/builder/xmlbase.rb:40:in `method_missing'' builder (2.1.2) lib/builder/xmlmarkup.rb:239:in `instruct!'' relock/gems/activesupport-3.0.0.beta3/lib/active_support/core_...
2006 Aug 05
1
XML from Builder without the to_s element
Hi All, I''m trying to return XML from a Rails view of an object I built up using Builder::XmlMarkup and I find an annoying side effect is that I get an extra <to_xml/> or <to_s/> element back which makes REXML hiccup thinking I''m adding a recond root element when I try to parse the return. How can I return the XML without this last element? Thanks, Vince
2009 Aug 04
1
Output XML to File
...fine; I read the info, I create the xml and even spit "stuff" out to file. The issue is that the "stuff" I am writing to a file is a xml/html cross cluster #@%$ of stuff. Here is some code: if !params[:id].blank? @user = User.find_by_id(params[:id]) @xml = ::Builder::XmlMarkup.new @unusedtickets = Unusedticket.find(:all, :conditions => [''user_id = ? and updated = true'', @user.id]) end @xml.DocumentElemnts{ for unusedticket in @unusedtickets @xml.unusedtickets do @xml.account_id(unusedticket.account_id) @xml.lo...
2007 Mar 26
2
Issue generating XML with hyphenated element names
Hello... I''m trying to generate and XML file using .rxml and I''m having a problem with element names that contain a hyphen. Here is a chunk of the .rxml file: xml.instruct! :xml, :version=>"1.0" xml.properties do @properties.each do |p| xml.property do xml.location do xml.street-address(p.street_address) xml.city-name(p.city) .. end end end
2006 Mar 19
2
Pretty-Printing (X)HTML Output
I''ve gone down (hopefully the correct) route of breaking up my layout(s) into common/generic elements such as the html head etc, but when the page renders there is no consistency in indenting - it''s all over the place (I''ve de-tabbed everything with the same result). Is there a standard/existing way of pretty-printing output? I''ve searched without any real
2009 Jan 09
2
Confused about to_xml() in ActiveRecord::Base subclass
..."Mon Nov 03 00:00:00 -0600 2008", # and I cannot seem to force a different behavior, I want to create my own to_xml. # Examples online show the following as how to override to_xml: def to_xml(options = {}) options[:indent] ||= 2 xml = options[:builder] ||= Builder::XmlMarkup.new(:indent => options[:indent]) xml.instruct! unless options[:skip_instruct] # v v v xml.level_one do xml.tag!(:second_level, ''content'') end # ^ ^ ^ end end The code between the v and ^ markers is where the body of each XML object is...