FIXTradingCommunity / tablature

Easy authoring for rules of engagement using markdown
https://www.fixtrading.org/
Apache License 2.0
11 stars 8 forks source link

[md2orchestra] Actor name may not contains spaces but quote marks #70

Open JThoennes opened 2 years ago

JThoennes commented 2 years ago
## Actors and Flows

### Actor Trading Adapter

This actor connects...

results in

<fixr:actors>
        <fixr:actor name="Trading">
            <fixr:annotation>

And

### Actor "Trading Adapter"

does not help but leads to

<fixr:actors>
        <fixr:actor name="&quot;Trading">
            <fixr:annotation>

Tablature documentation is unclear here and this result is surprising. I would also expect some warning or error message.

donmendelson commented 2 years ago

Currently the markdown parser tokenizes a heading by splitting on whitespace. Being able to use quotes around a name with internal spaces seems like a reasonable request. This will require an enhancement to the underlying md-grammar project.

JThoennes commented 2 years ago

In addition, the documentation could be updated to clearly the define which character are allowed in the actor name. Does the FIX Orchestra Standard define anything about this?

donmendelson commented 2 years ago

In Orchestra v1.0 names are constrained by this XML schema type:

    <xs:simpleType name="Name_t">
        <xs:restriction base="xs:string">
            <xs:minLength value="1"/>
            <xs:maxLength value="255"/>
            <xs:pattern value="([A-Z]|[a-z])([0-9]|[A-Z]|[a-z]|_)*"/>
        </xs:restriction>
    </xs:simpleType>

In other words, names can contain letters, digits, and underscore.

However, the proposal for v1.1 RC1 is as follows:

    <xs:simpleType name="Name_t">
        <xs:annotation>
            <xs:documentation>Names are from 1-64 characters. The XML processor will remove line feeds, carriage returns, tabs, leading and trailing spaces, and multiple spaces. Single internal spaces are allowed by the schema but may be restricted by an external style.</xs:documentation>
        </xs:annotation>
        <xs:restriction base="xs:token">
            <xs:minLength value="1"/>
            <xs:maxLength value="64"/>
        </xs:restriction>
    </xs:simpleType>

Therefore, assuming the proposal is accepted, any character in XML schema token type will be valid, including an internal space (but leading and trailing spaces will be trimmed, and line feeds, carriage returns, and tab characters will be removed).

JThoennes commented 2 years ago

OK, so currently I could use the underscore instead of the space if I want to have longer names.