Hmmm...
I wasn't around for 'occursStopValueKind', so excuse me if I miss the
point.
Here's a question and a tentative answer I was playing with recently:
What's the difference between stopValue and terminator?
'terminator' can be used to scan a stream of characters or bits
without parsing elements
'stopValue' can be used to scan a sequence of parsed elements.
Its datatype must be the same as the array element.
If I'm right, then Steve's example is invalid because "done" is not an
integer. To make it valid, either:
- the stopValue must be an 'int' such as -1, or
- the out-of-band value "done" or "|done" must be a terminator for
an enclosing construct as follows.
Change this:
<element name="x" type="int" maxOccurs="unbounded"
dfdl:occursSeparator="|" dfdl:occursKind="stopValue"
dfdl:stopValue="done" dfdl:occursStopValueKind="literal"
dfdl:representation="text"/>
to this:
<sequence dfdl:lengthKind="delimited" dfdl:terminator="|done"
dfdl:applies="hereonly">
<element name="x" type="int" maxOccurs="unbounded"
dfdl:occursSeparator="|" dfdl:occursKind="endOfData"
dfdl:representation="text"/>
</sequence>
If I'm wrong, then what is the correct answer to the question?
---
If we change the name of the property 'stopValue', then I would find
these candidates consistent with similar concepts elsewhere:
occursTerminator
occursTerminatorValue
terminatorValue
Simon
________________________________
From: dfdl-wg-bounces@ogf.org [mailto:dfdl-wg-bounces@ogf.org]
On Behalf Of Mike Beckerle
Sent: 29 August 2007 19:52
To: Steve Hanson
Cc: dfdl-wg@ogf.org; dfdl-wg-bounces@ogf.org
Subject: Re: [DFDL-WG] V3 of length/occurs simplification
proposal
Seems like occursStopValueKind="literal" only applies to
representation="text".
With that caveat, I think I agree we need to be able to say
<element name="x" type="int" maxOccurs="unbounded"
dfdl:occursSeparator="|" dfdl:occursKind="stopValue"
dfdl:stopValue="done" dfdl:occursStopValueKind="literal"
dfdl:representation="text"/>
Then this would be valid 3 occurences for element x.
2|3|4|done
I think we shoudl rename dfdl:stopValue to dfdl:occursStopValue
for consistency.
Mike Beckerle
STSM, Architect, Scalable Computing
IBM Software Group
Information Platform and Solutions
Westborough, MA 01581
direct: voice and FAX 508-599-7148
assistant: Pam Riordan
priordan@us.ibm.com
508-599-7046
Steve Hanson