Automatic xsd:any resolution#389
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I have slightly changed the solution for this, so that to avoid a dependency between scalaxb.scala and protocol.scala. Now the function to handle non-default cases is passed by the means of implicits rather than the direct access to the protocol.
From my previous PR:
Automatic resolution of xsd:any
Consider the following snippet from
dml-main.xsd, which is a part of OpenOffice schemata:In a
pptxpresentation slide, a XML tree that represents a table goes in place ofxsd:any, for example:a:graphicDataisCT_GraphicalObjectData.Apparently, not only the
CT_Tablecan be used there, hencexsd:any, but often theCT_Table, ora:tblis of interest.The problem is, ScalaXB stores
xsd:anyas barescala.xml.Elem, wrapped intoscalaxb.DataRecord[Any]. Perhaps this is becausexsd:anydoesn't carry any type information, so ScalaXB doesn't know what to bind the element to.However, there is a way to know for sure that
<a:tbl>is aCT_Table, since it is declared in the schema: