You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by "Costello, Roger L." <co...@mitre.org> on 2018/11/07 19:51:28 UTC

Daffodil doesn't support the XPath lower-case() function ... so what to use instead?

Hello DFDL community,

In the below snippet I use the XPath lower-case() function. I discovered, however, that Daffodil doesn't support lower-case(). Is there an alternative?  /Roger

<xs:element name='signature' type='xs:string' dfdl:inputValueCalc='{
    if (lower-case(xs:string(../Hidden_signature)) eq "5a4d") then "Portable Executable (PE) file"
    else xs:string(../Hidden_signature)
    }' />

Re: Daffodil doesn't support the XPath lower-case() function ... so what to use instead?

Posted by Steve Lawrence <sl...@apache.org>.
Daffodil does support the lower-case function, but you need to be
explicit about the namespace. So you need to define

  xmlns:fn="http://www.w3.org/2005/xpath-functions"

and use the namespace prefix when calling the function, e.g.

  if (fn:lower-case(...)) ...

On 11/7/18 2:51 PM, Costello, Roger L. wrote:
> Hello DFDL community,
> 
> In the below snippet I use the XPath lower-case() function. I discovered, however, that Daffodil doesn't support lower-case(). Is there an alternative?  /Roger
> 
> <xs:element name='signature' type='xs:string' dfdl:inputValueCalc='{
>     if (lower-case(xs:string(../Hidden_signature)) eq "5a4d") then "Portable Executable (PE) file"
>     else xs:string(../Hidden_signature)
>     }' />
>