I'm trying to set up BaseX to manage a repository of DITA content. The DITA content has been specialized to validate against Relax NG schemas instead of DTDs. While importing content that validate against DTDs is straight forward, I have not yet figured out the best way to import Relax NG based content. So, I have a few questions:
* I see there is the Validation module [1] and that's good because I think XQuery is my best option for managing the imports. However, I need to pass a specific schema to the functions. DITA content utilizes multiple schemas. Is there some way I can pass a directory to these functions instead of just a single file reference? * I currently have the CATFILE option set [2]. Does this help or hinder importing when choosing to validate against Relax NG? Is there some way I can set the global options to make validating against Relax NG easier? * I've seen multiple examples of people actually storing the schema(s) in the database. Is that necessary or help for using the validation module?
Thanks for your help!
[1] http://docs.basex.org/wiki/Validation_Module#RelaxNG_Validation
[2] http://docs.basex.org/wiki/Catalog_Resolver http://docs.basex.org/wiki/Options#CATFILE For reference, here is how Oxygen handles catalog resolutionhttps://www.oxygenxml.com/doc/versions/20.1/ug-editor/topics/using-XML-Catalogs.html. See the bottom of Table 1. Catalog Mappings for a summary of how Relax NG is resolved.
Robert sent this email to the list on my behalf last week. However, it’s not getting any traction. So, I am bumping it.
While I think BaseX is great and shows a lot of promise, my implementation of it is currently dysfunctional and I’m stumped on how to get my project moving. There is very little in the way of documentation regarding managing XML that validates against Relax NG. I’ve made some progress in terms of using XQuery to handle the import (which appears to be the only way of validating against Relax NG) but I keep running into odd errors such as “Resource ‘…’ does not exist” when it in fact does exist. Can someone on the BaseX team please respond to this thread and provide a bit of insight?
Thanks, Jason
From: Robert Crews rcrews@hortonworks.com Date: Wednesday, September 12, 2018 at 12:59 PM To: "basex-talk@mailman.uni-konstanz.de" basex-talk@mailman.uni-konstanz.de Subject: Importing XML (DITA) validated with Relax NG schemas?
I’m trying to set up BaseX to manage a repository of DITA content. The DITA content has been specialized to validate against Relax NG schemas instead of DTDs. While importing content that validate against DTDs is straight forward, I have not yet figured out the best way to import Relax NG based content. So, I have a few questions:
* I see there is the Validation module [1] and that’s good because I think XQuery is my best option for managing the imports. However, I need to pass a specific schema to the functions. DITA content utilizes multiple schemas. Is there some way I can pass a directory to these functions instead of just a single file reference? * I currently have the CATFILE option set [2]. Does this help or hinder importing when choosing to validate against Relax NG? Is there some way I can set the global options to make validating against Relax NG easier? * I’ve seen multiple examples of people actually storing the schema(s) in the database. Is that necessary or help for using the validation module?
Thanks for your help!
[1] http://docs.basex.org/wiki/Validation_Module#RelaxNG_Validation
[2] http://docs.basex.org/wiki/Catalog_Resolver http://docs.basex.org/wiki/Options#CATFILE For reference, here is how Oxygen handles catalog resolutionhttps://www.oxygenxml.com/doc/versions/20.1/ug-editor/topics/using-XML-Catalogs.html. See the bottom of Table 1. Catalog Mappings for a summary of how Relax NG is resolved.
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
From: Jason Davis jason.davis@hortonworks.com Date: Monday, September 17, 2018 at 10:36 AM To: Robert Crews rcrews@hortonworks.com, "basex-talk@mailman.uni-konstanz.de" basex-talk@mailman.uni-konstanz.de Subject: Re: Importing XML (DITA) validated with Relax NG schemas?
Robert sent this email to the list on my behalf last week. However, it’s not getting any traction. So, I am bumping it.
While I think BaseX is great and shows a lot of promise, my implementation of it is currently dysfunctional and I’m stumped on how to get my project moving. There is very little in the way of documentation regarding managing XML that validates against Relax NG. I’ve made some progress in terms of using XQuery to handle the import (which appears to be the only way of validating against Relax NG) but I keep running into odd errors such as “Resource ‘…’ does not exist” when it in fact does exist. Can someone on the BaseX team please respond to this thread and provide a bit of insight?
Thanks, Jason
From: Robert Crews rcrews@hortonworks.com Date: Wednesday, September 12, 2018 at 12:59 PM To: "basex-talk@mailman.uni-konstanz.de" basex-talk@mailman.uni-konstanz.de Subject: Importing XML (DITA) validated with Relax NG schemas?
I’m trying to set up BaseX to manage a repository of DITA content. The DITA content has been specialized to validate against Relax NG schemas instead of DTDs. While importing content that validate against DTDs is straight forward, I have not yet figured out the best way to import Relax NG based content. So, I have a few questions:
* I see there is the Validation module [1] and that’s good because I think XQuery is my best option for managing the imports. However, I need to pass a specific schema to the functions. DITA content utilizes multiple schemas. Is there some way I can pass a directory to these functions instead of just a single file reference? * I currently have the CATFILE option set [2]. Does this help or hinder importing when choosing to validate against Relax NG? Is there some way I can set the global options to make validating against Relax NG easier? * I’ve seen multiple examples of people actually storing the schema(s) in the database. Is that necessary or help for using the validation module?
Thanks for your help!
[1] http://docs.basex.org/wiki/Validation_Module#RelaxNG_Validation
[2] http://docs.basex.org/wiki/Catalog_Resolver http://docs.basex.org/wiki/Options#CATFILE For reference, here is how Oxygen handles catalog resolutionhttps://www.oxygenxml.com/doc/versions/20.1/ug-editor/topics/using-XML-Catalogs.html. See the bottom of Table 1. Catalog Mappings for a summary of how Relax NG is resolved.
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.davis@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
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.gruen@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.davis@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
basex-talk@mailman.uni-konstanz.de