You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@daffodil.apache.org by "Mike Beckerle (Jira)" <ji...@apache.org> on 2020/08/05 17:47:00 UTC
[jira] [Closed] (DAFFODIL-587) namespace prefixes (e.g. "dfdl",
"xs") should be configurable and not hardcoded anywhere
[ https://issues.apache.org/jira/browse/DAFFODIL-587?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Beckerle closed DAFFODIL-587.
----------------------------------
Resolution: Not A Problem
This is not significant enough to want to fix.
> namespace prefixes (e.g. "dfdl", "xs") should be configurable and not hardcoded anywhere
> ----------------------------------------------------------------------------------------
>
> Key: DAFFODIL-587
> URL: https://issues.apache.org/jira/browse/DAFFODIL-587
> Project: Daffodil
> Issue Type: Bug
> Components: Back End, Clean Ups, Front End, Middle "End"
> Reporter: Jessie Chab
> Priority: Minor
> Labels: beginner
> Fix For: 3.0.0
>
>
> While creating a test where all namespace prefixes, terminators, element names, etc. were the same string, I got "Invalid annotation found!" errors when defining a namespace prefix other than "dfdl" for the dfdl namespace. I brought this up with Mike and this was his response.
> Note from Mike:
> "[The dfdl prefix] definitely should NOT be wired in.
> Imagine a future dfdl v2.0. Users may want their schemas to use prefixes like dfdl1 and dfdl2 for clarity about when the dfdl v2.0 features are being used.
> Or given different dfdl implementations, they may want to use prefixes to signify things that depend on what has been implemented in one implementation or another, e.g., dfdlDaf vs dfdlIBM for example. So as to make non-portability of the schema more obvious."
> ---------
> I briefly looked through the code and there are definitely places that hardcode this prefix. It's riddled throughout the error messages (e.g."dfdl:checkConstraints may only be called on simple types.") which isn't too bad, but around line 143 of
> daffodil-core/src/main/scala/edu/illinois/ncsa/daffodil/dsom/SchemaComponent.scala
> /**
> Used as factory for the XML Node with the right namespace and prefix etc.
> *
> Given "element" it creates <dfdl:element /> with the namespace definitions
> based on this schema component's corresponding XSD construct.
> *
> Makes sure to inherit the scope so we have all the namespace bindings.
> */
> def newDFDLAnnotationXML(label: String) = { scala.xml.Elem("dfdl", label, emptyXMLMetadata, xml.scope) }
> I looked through briefly and I'm not entirely sure how often this actually gets used or if it's even still relevant, but this is the type of thing that would need to be changed.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)