Source code to XML

I need to generate DocBook ProgramListing xincludes from a source code
file.
How can I escape characters that is not valid in text : < > " &

On Jul 22, 6:17 pm, Tommy N. [email protected] wrote:

I need to generate DocBook ProgramListing xincludes from a source code
file.
How can I escape characters that is not valid in text : < > " &


This sig is dedicated to the advancement of Nuclear Power
Tommy N.
[email protected]

irb(main):020:0> require ‘rexml/text’
=> true
irb(main):021:0> REXML::Text.normalize(“Some & text < foo > " bar”)
=> “Some & text < foo > " bar”

this may help

On Jul 22, 6:17 pm, Tommy N. [email protected] wrote:

I need to generate DocBook ProgramListing xincludes from a source code
file.
How can I escape characters that is not valid in text : < > " &


This sig is dedicated to the advancement of Nuclear Power
Tommy N.
[email protected]

require ‘rexml/text’
REXML::Text.normalize(“Some & text < foo > " bar”)
==> “Some & text < foo > " bar”

i think this may help you

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs