fatty- / daisy-pipeline

Automatically exported from code.google.com/p/daisy-pipeline
0 stars 0 forks source link

Sequences on output ports #288

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. $ dp2 help dtbook-validator
Usage: dp2 dtbook-validator [options]
        --i-source input             A DTBook document. Supported versions are 2005-1,-2,-3; and 1.1.0.
        --i-html-report output       An HTML-formatted version of the validation report.
        --i-report output1,output2,output3
                                     Raw output from all types of validation used (RelaxNG, Schematron, custom).
        --i-result output            A copy of the input document; may include PSVI annotations.
        [...]

2. $ dp2 dtbook-validator --i-source hauy_valid.xml --i-html-report report.html 
--i-result result.xml --i-report report1.xml,report2,report3.xml
3. $ dp2 dtbook-validator --i-source hauy_valid.xml --i-html-report report.html 
--i-result result.xml                

It is a bit awkward that you have to specify a comma-separated list of reports 
because you might not know in advance how many document there are in the output 
sequence. You might even get none, but if you don't specify `--i-report` you 
get `[ERROR] Outptut empty: report`. 

Possible enhancements:
1. Create a folder structure instead of a single file when more than one 
documents appear on the output port:

report.xml
  +-- report_1.xml
  +-- report_2.xml
  +-- report_3.xml

2. Make --i-xxxxx optional when it is an output port

(Note: actually, the report output on dtbook-validator always returns exactly 
one document. But I'm using it as an example anyway.)

Original issue reported on code.google.com by bertfrees on 3 Apr 2013 at 12:01

GoogleCodeExporter commented 9 years ago
It's a bad formatted help issue

--i- should be --o- for outputs(now it's fixed)
Sequence Allowed for outputs is hidden now, as they behave in the say way for 
the user.

The enhancement you propose in 1. is how it actually works ( I have to do more 
thorough tests though in local mode).

I wouldn't be really comfortable making output ports optional but we could 
discuss this more deeply

Original comment by capitan....@gmail.com on 3 Apr 2013 at 6:19

GoogleCodeExporter commented 9 years ago
Ok, didn't realize it was already implemented this way. Great. About the 
optional ports: I had this idea because you might have an output sequence that 
can have one or zero documents depending on some option. Or an input port could 
be a sequence or zero or more documents. But maybe that is too far fetched.

Original comment by bertfrees on 3 Apr 2013 at 7:34