Hi Christian, Jason,
Coming back to this older discussion thread.
How does baseX parse XML document, does it do so using the regular "javax.xml.parsers.SAXParserFactory" factory?
In this folder there is a JAR library called "dita-ng.jar":
https://github.com/oxygenxml/dita-relaxng-defaults/tree/master/lib
inside the JAR library's META-INF folder there is a "services" folder in which the JAR library registers a custom "org.apache.xerces.xni.parser.XMLParserConfiguration". If this parser configuration is used when parsing XML documents, and XML documents have references to Relax NG documents, the default attributes defined in the Relax NG schema would start being reported on SAX and DOM parsers parsing the XML documents. But the "xercesImpl.jar" registers the same "org.apache.xerces.xni.parser.XMLParserConfiguration" service.
So in order to test if RNG-based XML parsing works with BaseX we would somehow need a way to add the "dita-ng.jar" to the baseX server's class path but it should also come in the classpath before the "xercesImpl.jar".
But this would work only if the baseX code uses the "javax.xml.parsers.SAXParserFactory" when parsing XML documents instead of using directly implementations from the Xerces library.
Regards, Radu
Radu Coravu <oXygen/> XML Editor http://www.oxygenxml.com
Hi Christian,
Thanks for your response. Understood with regard to Jing. The plugin I linked also uses Jing. I'm just not clear which version. I believe the source for at least the dita-ng.jar is linked from the repository [1].
With regard to the questions asked in this post, after investigation, I believe I have a better understanding of the problem I'm trying to solve. Importing Relzx NG XML into the database was not the problem. The problem exists between the database and the application layer that interfaces with it. I opened a feature request that summarizes it [2].
Thanks, Jason
[1] https://github.com/georgebina/dita-ng [2] https://github.com/BaseXdb/basex/issues/1624
On 9/25/18, 12:38 AM, "Christian Grün" christian.gr...@gmail.com wrote:
Hi Jason, Please note that BaseX uses the Jing RELAX NG validator. It does not embed the DITA Open Toolkit. I didn’t have time to look at the DITA OT plugin so far. It seems that the repository of the oXygen plugin you referenced only contains the JAR file. Do you possibly know where we can find the source files? Cheers Christian PS: It seems that you and your colleague asked different questions in your previous posts. Have these questions been solved? On Mon, Sep 17, 2018 at 9:55 PM Jason Davis <jason.da...@hortonworks.com>
wrote: > > My mistake. It appears I may have misstated my problem. The query I used worked fine for importing resources. The problem appears to be related to how BaseX parses the resources. It doesn’t appear to take into account default attribute values. Given that the Relax NG spec clearly states default attributes are not part of the design, this doesn’t come across as a surprise. However, default attributes are meaningful with regard to DITA and there is a Java framework you can install as a plugin to the DITA Open Toolkit that supports parsing of Relax NG DITA content with default attributes [1]. > > Is it possible to setup databases created in BaseX with Relax NG parsing of default attributes? Is it just a matter of including the dita-ng.jar from the DITA OT plugin in my classpath? > > Thanks, > Jason > > [1] https://github.com/oxygenxml/dita-relaxng-defaults
Hi Radu,
How does baseX parse XML document, does it do so using the regular
"javax.xml.parsers.SAXParserFactory" factory?
Yes, it does [1]!
So in order to test if RNG-based XML parsing works with BaseX we would
somehow need a way to add the "dita-ng.jar" to the baseX server's class path but it should also come in the classpath before the "xercesImpl.jar".
Currently, there is no particular order in which libraries are imported [2], but if the chosen order is wrong, the dita-ng.jar could be added manually to the start script.
Hope this helps, Christian
[1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba... [2] https://github.com/BaseXdb/basex/blob/master/basex-core/etc/basex
Hi Christian,
Thanks for the help.
Regards, Radu
Radu Coravu <oXygen/> XML Editor http://www.oxygenxml.com
On 10/1/2018 9:04 PM, Christian Grün wrote:
Hi Radu,
How does baseX parse XML document, does it do so using the regular "javax.xml.parsers.SAXParserFactory" factory?
Yes, it does [1]!
So in order to test if RNG-based XML parsing works with BaseX we would somehow need a way to add the "dita-ng.jar" to the baseX server's class path but it should also come in the classpath before the "xercesImpl.jar".
Currently, there is no particular order in which libraries are imported [2], but if the chosen order is wrong, the dita-ng.jar could be added manually to the start script.
Hope this helps, Christian
[1] https://github.com/BaseXdb/basex/blob/master/basex-core/src/main/java/org/ba... [2] https://github.com/BaseXdb/basex/blob/master/basex-core/etc/basex
basex-talk@mailman.uni-konstanz.de