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*)'

The problem that I am encountering is the that second declare! call
is not generating what I need for a proper DTD. It produces:

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE logs [
   <!ELEMENT logs "(log*)">

Instead what I believe I requires is:

 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE logs [
   <!ELEMENT logs (log*)>

The difference is the removal of the quotes.

Reading through the documentation and other resources that I have been
able to locate, including the source to declare!, has not yielded any
ideas about how to do this. Can anyone please make suggestions?

Thanks in advance - Marc

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