Unable to include a left angle bracket in table with docbook backend

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to include a left angle bracket in table with docbook backend

apnadkarni
I have a table describing the operators in a programming language. Sample below:

= Numbers and expressions

[cols="25a,75a"]
|===
|{lt}
|More blah blah
|===

The row is supposed to document the "<" operator. This works fine for the html5 backend but for docbook it generates the line

<entry align="left" valign="top"><simpara><</simpara></entry>

which generates the following error from asciidoctor-fopub due to the literal "<" character before </simpara>

SystemID: file:/c:/src/tcl-on-windows/modern/docbook/example.xml; Line#: 17; Column#: 44
javax.xml.transform.TransformerException: The content of elements must consist of well-formed character data or markup.

Replacing the {lt} with "<" does not change the result. I could replace it with & l t ; (which works) but then that would not work with other backends like latex I presume.

Am I going about this the wrong way or is this a bug?

Thanks

/Ashok
Reply | Threaded
Open this post in threaded view
|

Re: Unable to include a left angle bracket in table with docbook backend

mojavelinux
Administrator
In this case, Asciidoctor is doing what you are asking it to do. The value of the lt attribute is the literal, unencoded left angle bracket. That will indeed break XML. You should either be using the < directly (which Asciidoctor will encode as &lt;) or you can use &lt; (which will be left as is).

In other words, you should only use {lt} if you intend to output a literal < sign...which is for a very special use case.

Cheers,

-Dan

On Mon, Sep 26, 2016 at 8:11 AM, apnadkarni [via Asciidoctor :: Discussion] <[hidden email]> wrote:
I have a table describing the operators in a programming language. Sample below:

= Numbers and expressions

[cols="25a,75a"]
|===
|{lt}
|More blah blah
|===

The row is supposed to document the "<" operator. This works fine for the html5 backend but for docbook it generates the line

<entry align="left" valign="top"><simpara><</simpara></entry>

which generates the following error from asciidoctor-fopub due to the literal "<" character before </simpara>

SystemID: file:/c:/src/tcl-on-windows/modern/docbook/example.xml; Line#: 17; Column#: 44
javax.xml.transform.TransformerException: The content of elements must consist of well-formed character data or markup.

Replacing the {lt} with "<" does not change the result. I could replace it with < (which works) but then that would not work with other backends like latex I presume.

Am I going about this the wrong way or is this a bug?

Thanks

/Ashok


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/Unable-to-include-a-left-angle-bracket-in-table-with-docbook-backend-tp5010.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux