ubsicap / usx

Unified Scripture XML
30 stars 6 forks source link

User Defined Attributes throwing a error when using supplied RNG #41

Open jonbitgood opened 4 years ago

jonbitgood commented 4 years ago

When validating a usx 3.0 document with the RNG it can throw a error if the usx files contain elements that have user defined attributes.

Adding a universally allowed wildcard attribute using x-* would solve this if rnc allows allows wildcards.

element char {
    attribute x-* { text }
}
klassenjm commented 4 years ago

@jonBitgood You are suggesting support for user-defined attributed for paragraph types <para>. Currently USX documentation only indicates that user-defined attributes might be added to <char>.

I can see the benefit of supporting and validating additional user-defined attributes for either.

Could you show a sample of how you are using x- for a <para> ?

jonbitgood commented 4 years ago

Sorry about that, I do actually mean char not para

jonbitgood commented 4 years ago

The specific use case is an additional morphological content for w

klassenjm commented 4 years ago

Jon - sadly, it doesn't look easy or obvious how to implement wildcards with Relaxng. I also looked at whether a namespace for attributes would be possible? I have not yet seen a way to do this -- which leaves my disappointed in rnc, rng right now, since we do need to support x-. I'll look into it more, as I can,. If you know more about the possibilities, please let me know.

jonbitgood commented 4 years ago

you cannot specify in any schema language that a certain attribute which has a name starting with a certain prefix should be skipped from validation or validated in a certain way. Radu Coravu

😞

What we might do is ignore validation of attributes for a new char style or for w

<optional>
    <zeroOrMore>
        <attribute>
            <anyName />
        </attribute>
    </zeroOrMore>
</optional>
klassenjm commented 4 years ago

I'll try to get back to this soon, Jon. A colleague may have a suggestion for us, which I need to explore.