On 01/07/2017 12:46 PM, Martin A. Brown wrote:
> Hello all,
>
> I have used LyX on and off for many years and, working sporadically with TLDP 
> [0], I have handled a few documents that were written in LyX.  Thank you to 
> the LyX team for your work on this tool over the years.
>
> I have two questions today, after examining the DocBook XML output from the 
> 2.2.x series.
>
> Question 1
> ----------
> Is it possible to change the public identifier for the DocBook XML 4.2 output 
> processor to use:
>
>   -//OASIS//DTD DocBook XML V4.2//EN   # -- my suggestion
>   -//OASIS//DTD DocBook XML//EN        # -- current identifier [1]
>
> I have checked the XML catalogs on several different platforms and I cannot 
> find a reference to the latter identifier, and I think it may simply be an 
> oversight.  The system identifier (the URL [2]) is correct.

This code goes way, way back to 2004. It seems to have been introduced
at 33243f700. It appears that the one without "V4.2" was meant to be for
XML, whereas the other one was meant to be for SGML. It's easy enough to
change it so we output the same thing both times, but let me cc José and
see if he has any thoughts.

> Question 2
> ----------
> When running the DocBook XML export function, I discover that not  all text 
> with '&' is not getting properly escaped with the XML entity &.  There's 
> clearly code to handle that:
>
>   http://www.lyx.org/trac/browser/lyxgit/src/sgml.cpp#L46
>
> To the best of my ability I traced down a case of a Hyperlink whose text is 
> not properly XML-escaped.  I think this is the line, but I'm not certain:
>
>   http://www.lyx.org/trac/browser/lyxgit/src/insets/InsetHyperlink.cpp#L235
>
>   int InsetHyperlink::docbook(odocstream & os, OutputParams const &) const
>   {
>           os << "<ulink url=\""
>              << subst(getParam("target"), from_ascii("&"), 
> from_ascii("&amp;"))
>              << "\">"
>              << getParam("name")
>              << "</ulink>";
>           return 0;
>   }
>
> I think that getParam("name") also needs to be run through sgml::escapeString.

Yes, that seems right. Since you have the git repo, can you make this
change and test it? I'm not sure anyone on the development team actually
uses the docbook classes.

Richard

Reply via email to