Bug #1077

Test report contains invalid XML for method names with & (C++ references)

Added by Owen Ellis over 10 years ago. Updated over 9 years ago.

Status:ClosedStart date:01/13/2014
Priority:NormalDue date:
Assigned To:Knödlseder Jürgen% Done:

100%

Category:-
Target version:1.0.0
Duration:

Description

I am currently adding unit tests for GModelSpectralGauss.
The test/reports/GModel.xml output file contains invalid XML for this method with an & symbol:

eowen@hfm-1307f:~/software/gammalib$ xmllint test/reports/GModel.xml 
test/reports/GModel.xml:338: parser error : xmlParseEntityRef: no name
      <error message="*** ERROR in GOptimizerPar::factor_value(double&): Invalid
                                                                      ^


Recurrence

No recurrence.

History

#1 Updated by Knödlseder Jürgen over 10 years ago

Thanks Owen for reporting. I have recognized this issue already for ” symbols, but I forgot to raise an issue.

#2 Updated by Knödlseder Jürgen over 10 years ago

  • Target version deleted (00-08-00)

#3 Updated by Knödlseder Jürgen over 10 years ago

See http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references for the translation that needs to be done. This implies that the following automatic conversions should be implemented:

Character converted to
&quot;
&
&amp;
'
&quot;
<
&lt;
>
&gt;

A decision needs to be made on when the conversion should be done. Possibilities are during access of the information (e.g. during reading and writing for example attributes), or during parsing. Maybe better during access of the information, so that the GXml object always contains the converted characters.

As the conversion functions are needed in several places, the functions may be implemented in the GTools module.

#4 Updated by Knödlseder Jürgen over 9 years ago

  • Target version set to 1.0.0

This should be done for release version 1.0.0

#5 Updated by Knödlseder Jürgen over 9 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

This is fixed now, merged into devel branch.

Also available in: Atom PDF