Skip to content

edge cases of parameter handling: empty string input #9

@lueck

Description

@lueck

How should the handling of parameters be done in the edge case of empty string input?

Currently, the use of the pattern test="$start and $identifier eq $start" handles empty string input the same way as (), since $start evaluates to false when $start is the empty string.

Examples:

 target/bin/xslt.sh -config:saxon.he.xml -s:test/john.xml -xsl:xsl/document.xsl tree=page-hateoas start='' end=p.2 -ea:on
ERROR: bad parameter combination: start required end and vice versa
Error at xsl:value-of on line 55 column 50 of tree.xsl:
  XTMM9000  Processing terminated by xsl:message at line 55 in tree.xsl
During lazy evaluation of map:merge(...) on line 64 of file:/home/clueck/src/scdh/tei-processing/dts-transformations/xsl/tree.xsl
In function dts:validate-parameters on line 35 column 95 of tree.xsl:
     invoked by function call at file:/home/clueck/src/scdh/tei-processing/dts-transformations/xsl/document.xsl#106
In template document on line 104 column 52 of document.xsl:
     invoked by xsl:call-template (tail calls omitted) at file:/home/clueck/src/scdh/tei-processing/dts-transformations/xsl/document.xsl#101
Processing terminated by xsl:message at line 55 in tree.xsl

The following consequently returns the whole document:

target/bin/xslt.sh -config:saxon.he.xml -s:test/john.xml -xsl:xsl/document.xsl tree=page-hateoas ref='' -ea:on

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions