[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DocBook files: tag attributes must use "

From: Thibaut Cuvelier
Subject: DocBook files: tag attributes must use "
Date: Sun, 26 Sep 2021 19:23:35 +0200

Dear list,

While working on supporting LilyPond from within LyX' DocBook support, I
stumbled upon a poorly defined behaviour: if the attributes are set using '
instead of ", then LilyPond ignores them.

Example (*file.lyxml*):

<?xml version="1.0" encoding="UTF-8"?>
<!-- This DocBook file was created by LyX 2.4.0dev
  See https://www.lyx.org/ for more information -->
<article xml:lang="en_US" xmlns="http://docbook.org/ns/docbook";
xmlns:xlink="http://www.w3.org/1999/xlink"; xmlns:m="
http://www.w3.org/1998/Math/MathML"; xmlns:xi="
http://www.w3.org/2001/XInclude"; version="5.2">
<title>LilyPond-book and LyX</title>
<programlisting language='lilypond' role='fragment verbatim staffsize=16
ragged-right relative=2'>
\relative c'' {  g a b c}

To test, run *lilypond-book --format=docbook file.lyxml*.

If the attributes of programlisting are encoded with ", running *lilypond-book
--format=docbook file.lyxml* works as expected. Otherwise, LilyPond doesn't
do anything.

This is surely due to the way the DocBook parsing is done, as it only uses
regular expressions instead of real XML parsing (XPath is available in
ElementTree, lxml, and libxml2 modules in Python). A quick fix would be to
add the possibility to have " or ' in

Thibaut Cuvelier

reply via email to

[Prev in Thread] Current Thread [Next in Thread]