[DFDL-WG] Fw: schemas and variables example (envelope & payloads) #2

Steve Hanson smh at uk.ibm.com
Wed May 27 11:48:34 CDT 2009


Mike

A couple more comments:

- I think that declaring a targetNamespace without binding it to a prefix, 
coupled with binding the empty prefix "xmlns" to the xsd subset namespace, 
might cause problems. 

- I think the two 'sep' variables should have a default value, then the 
absolute and relative xsds could be used in their own right, without 
envelope.

Here's my simpler version of the example so far, look in the 'markup' 
folder. Changes made implement my various comments, plus assign the 'sep' 
and 'msgKind' variables the same simple type as I've created for the 
corresponding elements (part of action 028). More to come.



Regards

Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh at uk.ibm.com
Phone (+44)/(0) 1962-815848
----- Forwarded by Steve Hanson/UK/IBM on 27/05/2009 17:38 -----

Steve Hanson/UK/IBM
27/05/2009 11:39

To
mbeckerle.dfdl at gmail.com
cc
dfdl-wg at ogf.org, dfdl-wg-bounces at ogf.org
Subject
Re: [DFDL-WG] schemas and variables example (envelope & payloads)





Mike

Some comments on your example (note I used the updated .zip in your other 
mail). 

- The number of variables make it harder than it needs to be to understand 
- see later comments.

- I think it would have been clearer if  the setting of 'sep' and 
'msgKind' was symmetric, I would set the two 'sep' variables on the 
'dirPathSep' element.

- The encoding could be constant to makes things simpler.

- It would have helped if  you had defined 'msgKindType' simple type with 
enums 'A' and 'R', and a 'dirPathSep' simple type with enums '/' and '\'.

- For this example, it would be clearer if 'dirPathSep' and 'msgKind' were 
not set via outputValueCalc and their values were just provided by the 
infoset. Given that they are not hidden this makes more sense. If you want 
to set them using outputValueCalc then I would suggest that you make the 
entire header hidden.

- I'm not sure that the modelling of the paths works. The file name will 
be consumed by the pathPart element, because the delimiters are 
prefix/infix. I think you need to use postfix separators or terminators. 
With postfix separator, failure to find the separator when matching the 
last part to 'pathPart' will cause a backtrack, and we will then try and 
(correctly) match the last part to 'file'. Note that there is just one 
sequence when you do it this way, as the separator also applies to 
'driveLetter'.

<element name="absolutePath">
        <complexType dfdl:representation="text" dfdl:encoding="{$enc}" 
dfdl:lengthKind="delimited">
                <sequence
                  dfdl:separator="{$sep}" 
                  dfdl:separatorPosition="postfix">
                          <element name="driveLetter" type="string" 
                                 dfdl:length="1" 
                                 dfdl:lengthKind="explicit"
                                 dfdl:terminator=":"/>
                          <element name="pathPart" type="string" maxOccurs
="30" minOccurs="0" />
                          <element name="file" type="string" 
                           dfdl:lengthKind="endOfParent"/>
                </sequence>
        </complexType>
</element>

If it can be simplified then I like it as an example to show both payload 
resolution and dynamic markup, and I'd like to build on it for action 028 
(watch this space). 

Regards

Steve Hanson
Programming Model Architect
WebSphere Message Brokers
Hursley, UK
Internet: smh at uk.ibm.com
Phone (+44)/(0) 1962-815848



"Mike Beckerle" <mbeckerle.dfdl at gmail.com> 
Sent by: dfdl-wg-bounces at ogf.org
22/05/2009 19:12
Please respond to
mbeckerle.dfdl at gmail.com


To
<dfdl-wg at ogf.org>
cc

Subject
[DFDL-WG] schemas and variables example (envelop & payloads)






 
I enclosed an eclipse project. If you import this to eclipse (ganymede 
version) it does a pretty good job at validating and helping you work with 
DFDL.
 
The 'variables' subdir contains an example of using variables to bind 
parameters for contained "payloads" of an enclosing envelope.

The example is that the payloads are either absolute or relative path 
names, but the separator is specified by the envelope along with the 
character set.
 
So, for example: the contents could be C:\a\b\c or C:/a/b/c or d\e\f or 
d/e/f.
 
I'm curious as to what people think of this example. It's pretty short.
 
Note: Please do not send sensitive data in unencrypted form in email. We 
cannot provide secure transit for email over the Internet.
Mike Beckerle | CTO | Oco, Inc 
Tel: 781-810-2125 | 100 Fifth Ave, 4th Floor, Waltham, MA 02451 | 
mbeckerle at oco-inc.com | www.oco-inc.com
Blog: cboblog.typepad.com 
TURNING DATA INTO ANSWERS. FASTER THAN YOU EVER IMAGINED.
 [attachment "DFDL-eclipse-project.zip" deleted by Steve Hanson/UK/IBM] --
  dfdl-wg mailing list
  dfdl-wg at ogf.org
  http://www.ogf.org/mailman/listinfo/dfdl-wg






Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU











Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU





-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.ogf.org/pipermail/dfdl-wg/attachments/20090527/4d1a795a/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DFDL-eclipse-project-2009-05-27.zip
Type: application/zip
Size: 25322 bytes
Desc: not available
Url : http://www.ogf.org/pipermail/dfdl-wg/attachments/20090527/4d1a795a/attachment-0001.zip 


More information about the dfdl-wg mailing list