Skip to content
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

Fix xml namespace #344

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Fix xml namespace #344

wants to merge 5 commits into from

Conversation

pieterbos
Copy link
Collaborator

@pieterbos pieterbos commented Aug 18, 2021

Fixes #343 . Adds the http://schemas.openehr.org/v1 namespace to the JAXB-bindings.

note that this is a breaking change:

  • parsing XML documents without a namespace will no longer work, unless a namespace unaware XMLReader is passed to JAXB
  • generated XML documents will now have a namespace
  • the RMQueryContext automatically adds namespaces for element/node names, but NOT in predicates, because it does not know what is an element and what is an element. So XPath lookup with element predicates such as [name/value = '...'] will have to be changed to `[openehr:name/openehr:value = '...']. The regular path lookup remains unchanged.

The alternative:

  • just keep ignoring namespaces. Then add a SaxFilter to process any XML Output, adding the namespace to the root element by hand.

might be better than this actually...

@pieterbos pieterbos requested a review from J3173 August 18, 2021 10:55
@codecov
Copy link

codecov bot commented Aug 18, 2021

Codecov Report

Merging #344 (6568e46) into master (e82cfbb) will increase coverage by 0.10%.
The diff coverage is 50.98%.

❗ Current head 6568e46 differs from pull request most recent head 56718a2. Consider uploading reports for the commit 56718a2 to get more accurate results
Impacted file tree graph

@@             Coverage Diff              @@
##             master     #344      +/-   ##
============================================
+ Coverage     70.28%   70.38%   +0.10%     
- Complexity     6314     6347      +33     
============================================
  Files           628      629       +1     
  Lines         21266    21350      +84     
  Branches       3411     3425      +14     
============================================
+ Hits          14946    15028      +82     
+ Misses         4713     4708       -5     
- Partials       1607     1614       +7     
Impacted Files Coverage Δ
...ain/java/com/nedap/archie/aom/LanguageSection.java 100.00% <ø> (ø)
...chie/xml/adapters/ArchetypeTerminologyAdapter.java 88.88% <ø> (ø)
...rchie/xml/adapters/StringDictionaryMapAdapter.java 0.00% <0.00%> (ø)
...nedap/archie/xml/types/XmlResourceDescription.java 93.47% <ø> (+19.56%) ⬆️
...java/com/nedap/archie/rm/composition/Activity.java 36.66% <ø> (ø)
...in/java/com/nedap/archie/rm/datavalues/DvText.java 60.00% <ø> (ø)
...om/nedap/archie/query/ArchieNamespaceResolver.java 33.33% <25.00%> (-4.17%) ⬇️
...java/com/nedap/archie/aom/OperationalTemplate.java 54.54% <29.54%> (-25.89%) ⬇️
.../com/nedap/archie/query/UniqueNodePathBuilder.java 82.60% <50.00%> (-7.40%) ⬇️
.../com/nedap/archie/query/APathToXPathConverter.java 76.56% <62.50%> (+0.19%) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e82cfbb...56718a2. Read the comment docs.

@pieterbos
Copy link
Collaborator Author

Needs some extra work for the classes in #346 - not doing it there because it will cause nasty conflicts

Comment on lines +1 to +3
@javax.xml.bind.annotation.XmlSchema(namespace = "http://schemas.openehr.org/v1", /*xmlns = {@XmlNs(prefix = "", namespaceURI = "http://schemas.openehr.org/v1")

}*/ elementFormDefault = XmlNsForm.QUALIFIED, attributeFormDefault = javax.xml.bind.annotation.XmlNsForm.UNQUALIFIED)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some commented out things here, are they still needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XML namespace for JAXB not correctly set
2 participants