-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nodes of NewXML do not inherit namespaces from parent document #92
Comments
I think this is the desired behavior, as otherwise the snippet would roundtrip as:
i could add a convenience function that collects namespaces going up the element tree. but that would not be on the newXML element, but on the change element. if that would be helpful. |
Summary of the issueMy suggestion refers to the asymmetry between how Here's how I believe libSEDML works:
For example, here's LXML behaves in the same scenario:
Suggestions for solutionsFrom my perspective, I think the most important thing is for
(1) is likely easier to implement. I think (2) is more consistent with other XML tools (at least LXML). My preference would be (2). But, (1) would work well if pared with a convenience method for collecting the namespaces from all parent XML elements. This convenience method is key for maintaining the abstraction between SED documents and their XML representation. |
I think SED-ML's reliance on XML (XPATHs and changes) is a smart design, at least for XML-based model languages. For this to work well, I think its important for SED-ML to behave consistently with XML and general XML tools. If this is the case, developers can expect that SED-ML works just like XML and minimal additional explanation is needed. Right now, libSED-ML and the SED-ML specs largely inherit from XML, but also deviate in a few key ways. This can generate a lot of confusion and break down the abstraction between models and simulation experiments. I think a few small changes are needed to more closely align SED-ML with XML and bolster the abstraction between models and simulation experiments. |
There already is a function XMLNode construct is a lower level access (and provided by another library), so I would prefer not to have to change it. It is also used in other places (for annotation and notes), just like it is for the |
Thanks for pointing to the Still, I find the asymmetric treatment of SED-ML and non-SED-ML XML nodes surprising. From a XML perspective, I would expect them to behave the same. I think this divergence is important to avoid because it creates a need explain to developers how the interpretation of SED-ML departs from XML conventions. To avoid changing libSEDML's data structures, likely an easy way to address my concern would be to provide a method which returns all namespaces defined on a element or on its parents. Ideally, this would work symmetrically for SED-ML and non-SED-ML XML nodes. This would allow developers to get the namespaces that one would expect to be available for each XML node (per XML conventions) without having to know the XML structure of SED-ML (e.g., what the parents of a child of NewXML are), which would break the abstraction. |
Example document:
The snippet below illustrates the issue. The SED-ML elements inherit the namespaces of the parent document, but the nodes of NewXML do not. This means that namespaces involved in the content of NewXML needs to be defined for each node in NewXML, which is tedious.
Similarly, namespaces for NewXML can't be defined at the level of NewXML. For example, the following isn't supported either.
The text was updated successfully, but these errors were encountered: