Task #8147 (closed)
Opened 7 years ago
Closed 7 years ago
ome.xml indentation
| Reported by: | wmoore | Owned by: | wmoore |
|---|---|---|---|
| Priority: | major | Milestone: | OMERO-4.4 |
| Component: | Bio-Formats | Version: | n.a. |
| Keywords: | n.a. | Cc: | jamoore, ajpatterson |
| Resources: | n.a. | Referenced By: | n.a. |
| References: | n.a. | Remaining Time: | n.a. |
| Sprint: | n.a. |
Description
Discussing with Josh and Andrew today, we should aim to standardise all indentation in XML to 4 spaces.
Generating ome.xml like this:
$ java -Xmx512m loci.formats.tools.ImageInfo -nopix -omexml-only /Path/to/file
produces xml with 3 spaces.
I can subsequently format using
$ export XMLLINT_INDENT=" " # 4 spaces $ xmllint --format path/to/file.xml > formatted_file.xml
but this is not ideal!
Change History (2)
comment:1 Changed 7 years ago by mlinkert
- Owner changed from mlinkert-x to wmoore
comment:2 Changed 7 years ago by wmoore
- Resolution set to fixed
- Status changed from new to closed
This is working great.
E.g. I am now doing this:
$ java -Xmx512m loci.formats.tools.ImageInfo -nopix -omexml-only -no-sas -xmlspaces 4 /Users/will/Documents/biology-data/Test-Import-Images/Martin/Leica-SP2/samples-SP2/samples-SP2.lei
<OME xmlns="http://www.openmicroscopy.org/Schemas/OME/2011-06" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openmicroscopy.org/Schemas/OME/2011-06 http://www.openmicroscopy.org/Schemas/OME/2011-06/ome.xsd">
<Instrument ID="Instrument:0">
<Detector ID="Detector:0:0" Type="PMT"/>
<Detector ID="Detector:0:1" Offset="-34.599999999999994" Type="PMT" Voltage="742.0867526377491"/>
...
Note: See
TracTickets for help on using
tickets.
You may also have a look at Agilo extensions to the ticket.
This commit adds an option to specify the number of spaces:
https://github.com/melissalinkert/bioformats/commit/3e2634e6766837de5202b5b11952b76b7860ac0f
So just add '-xmlspaces 4'. I decided not to make 4 spaces the default, as I didn't want to risk hurting anyone who was relying upon the fact that 3 spaces were being used (e.g. anyone doing a plain diff of the output). If you want, I can wrap all of these new options ('-omexml-only -no-sas -xmlspaces 4') into a single option ('-generate-configuration'?) so that it's easier to work with.
In any case, passing back for validation that this works as desired.