lengthKind 'implicit' is mostly for binary types. Like "xs:int" has 32 bit 
length with lengthKind 'implicit' and dfdl;binaryNumberRep="binary"

Consider this C struct:

struct {
   int x;
   int y;
}

Imagine that data written to a file from a 32-bit computer/compiler.

The natural way to model this in DFDL is

<sequence>
   <element name="x" type="xs:int" dfdl:lengthKind="implicit"/>
   <element name="y" type="xs:int" dfdl:lengthKind="implicit"/>
</sequence>

For your text case, if you really want to say the first element is a number, 
the second is a string, and that string WILL NOT start with digits, to achieve 
that you use lengthKind="pattern" and a regex that captures digits only.

________________________________
From: Costello, Roger L. <[email protected]>
Sent: Thursday, February 6, 2020 2:03 PM
To: [email protected] <[email protected]>
Subject: A text data value with an implicit length?

Hi Folks,

Consider this input:

8John Doe

The number indicates the length of the following string.

So there are two data items: the first data item is an integer and the second 
data item is a string.

I figured that for the first data item I could specify it this way

type = integer
lengthKind = implicit

Alas, I discovered: Type Integer cannot have lengthKind='implicit' when 
representation='text'

Table 18 in the specification confirms that.

I am seeking an example of a text data value with an implicit length, i.e.,

<xs:element name="example" type="???" dfdl:lengthKind="implicit" />

 Does such a thing exist? Is there ever a text data value whose length is 
implicit?

/Roger

Reply via email to