Hi Jason (cc to the list),
I set the CP variable like so: CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH
This appears to be slightly different than the example you linked Christian. I’m using BaseX 9.0.2. Does this make a difference?
The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different.
I added an echo $CLASSPATH line under the CP variable. When I run the script, the echo statement is blank.
In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn’t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty.
Is there a way to see how the classpath is set when running this script?
To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument:
exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@"
If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1].
Christian
Hi Christian, Radu,
I’ve tried adding the dita-ng.jar to the lib/custom dir of basex and then manually modified the startup script to load it first. I can even confirm that it’s the first jar on the path using:
proc:property('java.class.path')
However, the database still fails to parse the XML with default attributes applied. I find myself having to cobble together an undesirable workaround whereby I manually supply the default attribute values myself in order to get my project to work with BaseX. Do you have any further suggestions for how I might get this to work?
Thanks, Jason
On 10/3/18, 3:24 AM, "Christian Grün" christian.gruen@gmail.com wrote:
Hi Jason (cc to the list),
> I set the CP variable like so: > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > This appears to be slightly different than the example you linked Christian. I’m using BaseX 9.0.2. Does this make a difference?
The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different.
> I added an echo $CLASSPATH line under the CP variable. When I run the script, the echo statement is blank.
In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn’t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty.
> Is there a way to see how the classpath is set when running this script?
To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument:
exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@"
If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1].
Christian
Hi Radu,
Do you think the DITA parsing should work if dita-ng.jar is placed first in the classpath?
Cheers, Christian
Jason Davis jason.davis@hortonworks.com schrieb am Mo., 15. Okt. 2018, 17:46:
Hi Christian, Radu,
I’ve tried adding the dita-ng.jar to the lib/custom dir of basex and then manually modified the startup script to load it first. I can even confirm that it’s the first jar on the path using:
proc:property('java.class.path')
However, the database still fails to parse the XML with default attributes applied. I find myself having to cobble together an undesirable workaround whereby I manually supply the default attribute values myself in order to get my project to work with BaseX. Do you have any further suggestions for how I might get this to work?
Thanks, Jason
On 10/3/18, 3:24 AM, "Christian Grün" christian.gruen@gmail.com wrote:
Hi Jason (cc to the list), > I set the CP variable like so: >
CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > This appears to be slightly different than the example you linked Christian. I’m using BaseX 9.0.2. Does this make a difference?
The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different. > I added an echo $CLASSPATH line under the CP variable. When I run
the script, the echo statement is blank.
In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn’t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty. > Is there a way to see how the classpath is set when running this
script?
To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument: exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1]. Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property
Hi Christian,
Sorry for the delay, I installed a BaseX server on my side just to test things out but I have not used BaseX before.
So:
- I created a new database. - Added an XML document to the database, the XML document containing a reference to the RNG schema. - Add an extra XML catalog to the BaseX configuration. In the ".basex" config file I added:
CATFILE=file:/D:/projects/eXml/frameworks/dita/DITA-OT2.x/catalog-dita.xml
Did I correctly add the reference to the XML catalog or should it be a file-like path instead? For example if I
- Added the "dita-ng.jar" to the "lib/custom" folder. I thought things out and the "dita-ng.jar" does not need to be added with high priority in the class path, just adding it there should be enough.
- Create a new XQuery which loads the XML document and tries to list the root element (in order to see if the default attributes are loaded or not).
- Run the XQuery and I can do that as well as I installed an add-on for Oxygen XML Editor which allows me to run an XQuery:
After running the XQuery the returned XML content does not contain the default attributes expanded. So it does not work.
I will try to find more time to add some System.err's in the Java code of the "dita-ng.jar" and re-pack it, restart the server. Will I find that extra logging in the console I used to start "basexhttp.bat"? Or do I need to first configure the logging?
Regards, Radu
Radu Coravu <oXygen/> XML Editor http://www.oxygenxml.com
On 10/18/2018 12:16 AM, Christian Grün wrote:
Hi Radu,
Do you think the DITA parsing should work if dita-ng.jar is placed first in the classpath?
Cheers, Christian
Jason Davis <jason.davis@hortonworks.com mailto:jason.davis@hortonworks.com> schrieb am Mo., 15. Okt. 2018, 17:46:
Hi Christian, Radu, I’ve tried adding the dita-ng.jar to the lib/custom dir of basex and then manually modified the startup script to load it first. I can even confirm that it’s the first jar on the path using: proc:property('java.class.path') However, the database still fails to parse the XML with default attributes applied. I find myself having to cobble together an undesirable workaround whereby I manually supply the default attribute values myself in order to get my project to work with BaseX. Do you have any further suggestions for how I might get this to work? Thanks, Jason On 10/3/18, 3:24 AM, "Christian Grün" <christian.gruen@gmail.com <mailto:christian.gruen@gmail.com>> wrote: Hi Jason (cc to the list), > I set the CP variable like so: > CP=$MAIN/BaseX.jar:$MAIN/lib/custom/dita-ng.jar:$MAIN/lib/*:$MAIN/lib/custom/*:$CLASSPATH > > This appears to be slightly different than the example you linked Christian. I’m using BaseX 9.0.2. Does this make a difference? The start scripts in the official distributions are created from the GitHub examples I linked, so they are slightly different. > I added an echo $CLASSPATH line under the CP variable. When I run the script, the echo statement is blank. In the script, no value will be bound to the $CLASSPATH variable. Instead, you can assign values to this variable by yourself, which will then be appended to the $CP variable. If you didn’t do so, and if your Linux environment does not have any other values assigned to this variable (which is the default), the output will necessarily be empty. > Is there a way to see how the classpath is set when running this script? To answer the "how": It will be set via the line that you will find some lines below in the script, and the -cp Java argument: exec java -cp "$CP" $BASEX_JVM org.basex.BaseX "$@" If you want to know which value is bound to $CP, try "echo $CP". In Java, the full user class path at runtime will be bound to the "java.class.path" system property. It can e.g. be retrieved via proc:property('java.class.path') [1]. Christian [1] http://docs.basex.org/wiki/Process_Module#proc:property
Hi Radu,
Thanks for trying to get this working.
- I created a new database.
- Added an XML document to the database, the XML document containing a
reference to the RNG schema.
Just a guess: You may need to supply the catalog before adding the document to the database. In the GUI, if you open the Database → New… dialog, you can specify the file via the parser dialog. Adding the path in the .basex file should work as well (it doesn’t matter if you specify a local file path or a file:// URI).
Will I find that extra logging in the console I used to start "basexhttp.bat"? Or do I need to first configure the logging?
If you start basex instances with the -d flag, you’ll get some more feedback.
Hope this helps, further questions are welcome, Christian
Hi Christian,
Thanks for the help, today I had more time to look into this, I added my observations on the opened issue:
https://github.com/BaseXdb/basex/issues/1624#issuecomment-432572494
Regards, Radu
Radu Coravu <oXygen/> XML Editor http://www.oxygenxml.com
On 10/19/2018 7:26 PM, Christian Grün wrote:
Hi Radu,
Thanks for trying to get this working.
- I created a new database.
- Added an XML document to the database, the XML document containing a
reference to the RNG schema.
Just a guess: You may need to supply the catalog before adding the document to the database. In the GUI, if you open the Database → New… dialog, you can specify the file via the parser dialog. Adding the path in the .basex file should work as well (it doesn’t matter if you specify a local file path or a file:// URI).
Will I find that extra logging in the console I used to start "basexhttp.bat"? Or do I need to first configure the logging?
If you start basex instances with the -d flag, you’ll get some more feedback.
Hope this helps, further questions are welcome, Christian
basex-talk@mailman.uni-konstanz.de