[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FpML-AWG-Legacy Fwd: [fpml-arch-modelling-wg] Re: Class name tags



--- In fpml-arch-modelling-wg@xxxxxxxxxxxxxxx, andrew_jacobs@... wrote:



John, et al.

Here are my comments.

p3-4. Personally I would model the product example as 'A product has a
number of payments. Each payment consists of a currency and an amount'.
This leads to the following DTD

<!ELEMENT payment (currency, money)>
<!ELEMENT Product (payment*)>

<Product>
     <payment>
          <currency>USD</currency>
          <amount>10.0</amount>
     </payment>
     <payment>
          <currency>EUR</currency>
          <amount>20.0</amount>
     </payment>
     <payment>
          <currency>JPY</currency>
          <amount>3000.0</amount>
     </payment>
</Product>

There is no ambiguity in the <array> example at the bottom of the
page. You
have two array elements (a,b),(a). The productions you have defined will
only allow an array element fo be a single (b) if it appears first, or
directly after another (b). Any (b) preceded by an (a) will be grouped
with
it.

p5. The introduction of the indices performs the same function as the
<cls>
tag introduced in the previous example. They both change the grammar to
allow (b) to independently follow (a). This is equivalent to the following
production which is warned against in most XML books.

<!element array ((a | b | (a,b))*)>

The grammar you are defining is trying to create an array where the
elements can be either (a), (b) or (ab). I would restructure the
problem by
introducing a tag (c) to repleace the (ab) combination thus.

<!entity % A_MEMBERS "p,q,r">
<!entity % B_MEMBERS "x,y,z">
<!element A (%A_MEMBERS;)>
<!element B (%B_MEMBERS;)>
<!element C (%A_MEMBERS;, %B_MEMBERS)>
<element array ((A | B | C)*)>

The problem with this kind of example is that the (ab) combination
normally
means something slighty different to both (a) and (b). To paraphrase
an old
OO example of multiple inheritance, if (a) was a land vehicle description,
and (b) was at water vehicle description, then (ab) is a amphibious
vehicle
description. In this case I think it is different enough to deserve
its own
tag.

I agree that both explicit indices and the use of ANY are to be avoided.

p9. I agree that the restructing will enlarge the DTD whilst shrinking the
XML, but adding the additional entities and attributes is a one time
design
cost (an probably mostly done by a design tool). The DTD will primarily be
used by a software parser to validate XML messages that doesn't really
care
if its 1000 or 10,000 lines long. The messages themselves will be
inspected
by both humans and machines on a far more regular basis and should be as
easy to read and transform as possible.



Andrew Jacobs, Senior Consultant, IBM UK Ltd., 76 Upper Ground,
London, SE1
9PZ
e-mail: andrew_jacobs@...  home: Andrew@...
Tel: +44 (0)171 202 3861 -- Fax: +44 (0)171 202 5774 -- Mobile: +44 (0)410
304239

--- End forwarded message ---



-------------------------------------------------------------------------------
To unsubscribe: Email majordomo@xxxxxxxx with a blank subject line
In the body include the line: unsubscribe awglegacy youremail@address
To view archives: http://www.fpml.org/_wgmail/_awglegacymail/threads.html