[DFDL-WG] How to parse an email address

Mike Beckerle mbeckerle.dfdl at gmail.com
Fri Feb 22 19:11:01 EST 2013


If you want the infoset to contain dfdl-wg at ogf.org, but also to contain
localPart and domain, then you are putting the same data into multiple
fields, which can only be accomplished using inputValueCalc.

I suggest parse the data into localPart and domain by using the @ as
terminator for localPart, and whatever the boundary is for the domain.

then have another element which you inputValueCalc which contains the
concatenation of those fields with an '@' in the middle.

I choose this way, parse the pieces, compute the concatenation of them,
versus the other way round because the expression for the inputValueCalc
will be dead simple in this case, and you will get an ordinary error of
'delimiter not found' if the @ is missing from the data.

Contrast if you had one field which contains the whole email address and
two calculated elements which take substrings of that. Now you have two
inputValueCalc's. And if the @ isn't there in the string, you'll get errors
evaluating expressions, not ordinary parsing, etc.

On Fri, Feb 22, 2013 at 11:11 AM, Garriss Jr., James P.
<jgarriss at mitre.org>wrote:

>  Suppose I want to model an email address:****
>
> ** **
>
>   dfdl-wg at ogf.org****
>
> ** **
>
> It’s a sequence of a string, an a character (@), and a string.****
>
> ** **
>
> In the MBTK it might look like this:****
>
> ** **
>
> ****
>
> ** **
>
> The problem, of course, is that the parser will grab all of “
> dfdl-wg at ogf.org” instead of just “dfdl-wg”.  Setting validation facets
> doesn’t help, b/c validation happens after parsing.  Setting @ as a
> separator or terminator would work, but that doesn’t seem right either, as
> the @ is part of the email address, and I would want to keep it in the
> infoset.****
>
> ** **
>
> How do I think about this problem?****
>
> ** **
>
> TIA****
>
> --
>   dfdl-wg mailing list
>   dfdl-wg at ogf.org
>   https://www.ogf.org/mailman/listinfo/dfdl-wg
>



-- 
Mike Beckerle | OGF DFDL Workgroup Co-Chair | Tresys Technology |
www.tresys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130222/215b54f9/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 2914 bytes
Desc: not available
URL: <http://www.ogf.org/pipermail/dfdl-wg/attachments/20130222/215b54f9/attachment.png>


More information about the dfdl-wg mailing list