#
# Copyright (C) 2007 Mobio Networks, Inc.
#
# This program is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
# details.
#
# You should have received a copy of the GNU General Public License along with
# this program. If not, see .
#
require 'builder/xmlmarkup'
module Rmobio
module Rxml
class HtmlTransformer < BaseTransformer
def transform(xml, client=nil)
end
def doctype(xml)
xml << '
'
yield xml
xml << ""
end
def body(doc, title,style=nil)
doc << "
\r"
if style
doc << "\r"
end
doc << ""
doc << title
doc << "\r"
doc << "\r"
yield doc
doc << "\r"
end
# Produce a text string. The style will be the tag name, ex, "i" will
# be the xhtml tag.
def text(doc, txt="", id=nil, style=nil, height=nil, width=nil)
doc << txt
end
def textarea(doc, txt="", height=nil, width=nil, attr=nil, id=nil)
doc << "\n'
end
# Tag for user input field. Type can be "text" or "password". For type "submit",
# use submit tag.
def input(doc, name, value, type, attr=nil)
doc << "\n\n"
end
def submit_tag()
end
def form(doc, name, action, method, req_id=nil, replace_id=nil, attr=nil)
doc << "\n'
end
def link(doc)
end
def softBr(doc)
doc.br
end
def image(doc, src, alt=nil, attr=nil)
super(doc, src, alt, attr)
end
def instance_tag(doc, name)
# do nothing, only implemented in xforms
yield doc
end
end
end
end