Problems with option XINCLUDE

Monday, 4 January 2016 · 3 messages
HR
Hans-Juergen Rennau4 Jan 2016 18:27 #
Dear BaseX team, I face unexpected problem when trying to switch off xinclude processing. From the documentation I understand that what I have to do is set the option XINCLUDE to the value "false". But how? Attempt #1 ========= I added to the config file .basex the line: XINCLUDE = false Result: no effect, and these messages: C:/Program Files (x86)/BaseX/.basex: Unknown option 'XINCLUDE'. C:/Program Files (x86)/BaseX/.basex: writing new configuration file. Did I misunderstand the documentation? Attempt #2 ======== I inserted into the query this initial line:
declare option db:XINCLUDE 'false';
Result: Program crash with this message: [FODC0002] "file:///C:/projects/otds/otds-config/h.xml" (Line 1): Vorzeitiges Dateiende.
where the named file (h.xml) is the output (!) file specified either like this:
basex foo.xq > h.xml
or like this:
basex -o h.xml foo.xq
Note. Using neither > ... nor -o ..., I do get the correct output, written to stdout. But I must capture it, and the capturing fails! Attempt #3 ======== Patching the basex.bat file, inserting option -D:
   java -Dorg.basex.XINCLUDE=false -cp "%CP%" %BASEX_JVM% org.basex.BaseX %*
Result: Same as attempt #2 So I'm at a loss. I need to switch off xinclude because my input files use xinclude in combination with xpointer attributes, like this:
<xi:include href="../../../globals/notifications.xml" xpointer="xpointer(/config/*)" parse="xml" />
Applying doc(...) to such a file, yields this result: [FODC0002] "file:///C:/projects/otds/otds-config/branches/path/to/bar.xml" (Line 11): "include" mit href "../../../globals/notifications.xml" nicht erfolgreich, und es wurde kein "fallback"-Element gefunden. Can you help me? Hans-Jürgen PS: Using version: BaseX 8.3 beta 474994c [Standalone]
CG
Christian Grün4 Jan 2016 19:15 #
Hi Hans-Jürgen,
Quoted text · Hans-Juergen Rennau · 4 lines
> Attempt #1 > ========= > I added to the config file .basex the line: > XINCLUDE = false
XINCLUDE is a local option. Did you specify it below the "# Local Options" comment? If yes, I am pretty you are using an older version of BaseX.
Quoted text · Hans-Juergen Rennau · 4 lines
> Attempt #2 > ======== > I inserted into the query this initial line: > declare option db:XINCLUDE 'false';
How does your full query look like? With the latest snapshot, it should also be possible to specify 'xinclude' with functions like fetch:xml or db:add:
  fetch:xml('input.xml', map { 'xinclude': false() })
Hope this helps, Christian [1] http://files.basex.org/releases/latest/
Quoted text · Hans-Juergen Rennau · 19 lines
> So I'm at a loss. I need to switch off xinclude because my input files use > xinclude in combination with xpointer attributes, like this: > > <xi:include href="../../../globals/notifications.xml" > xpointer="xpointer(/config/*)" parse="xml" /> > > Applying doc(...) to such a file, yields this result: > > [FODC0002] "file:///C:/projects/otds/otds-config/branches/path/to/bar.xml" > (Line 11): "include" mit href "../../../globals/notifications.xml" nicht > erfolgreich, und es wurde kein "fallback"-Element gefunden. > > Can you help me? > > Hans-Jürgen > > PS: Using version: > BaseX 8.3 beta 474994c [Standalone] >
HR
Hans-Juergen Rennau4 Jan 2016 20:13 #
Thanks a lot, Christian - shifting the option assignment in the config file below the line "#Local Options" does the job. Hurrah! From what you write I conclude that being local or global is an inherent quality of each option, rather than the scope of a value assignment, as I had thought. And so it depends on this quality where to place the assignment to a given option within .basex - for some options it is above, for some options its is below "# Local Options". If this is not correct, please let me know. Concerning attempts #2 and #3 - that was my mistake. I tried to capture into a file with the extension .xml, which was accordingly initialized to an empty file, which was then found by file:list and to which subsequently doc(...) was applied, of course producing an error. Kind regards,Hans-Jürgen PS: Here the full query, as requested:
Quoted text · Christian Grün · 1 line
Christian Grün <christian.gruen at gmail.com> schrieb am 19:23 Montag, 4.Januar 2016:
Hi Hans-Jürgen,
Quoted text · Christian Grün · 4 lines
> Attempt #1 > ========= > I added to the config file .basex the line: > XINCLUDE = false
XINCLUDE is a local option. Did you specify it below the "# Local Options" comment? If yes, I am pretty you are using an older version of BaseX.
Quoted text · Christian Grün · 4 lines
> Attempt #2 > ======== > I inserted into the query this initial line: > declare option db:XINCLUDE 'false';
How does your full query look like? With the latest snapshot, it should also be possible to specify 'xinclude' with functions like fetch:xml or db:add:
  fetch:xml('input.xml', map { 'xinclude': false() })
Hope this helps, Christian [1] http://files.basex.org/releases/latest/
Quoted text · Christian Grün · 19 lines
> So I'm at a loss. I need to switch off xinclude because my input files use > xinclude in combination with xpointer attributes, like this: > > <xi:include href="../../../globals/notifications.xml" > xpointer="xpointer(/config/*)" parse="xml" /> > > Applying doc(...) to such a file, yields this result: > > [FODC0002] "file:///C:/projects/otds/otds-config/branches/path/to/bar.xml" > (Line 11): "include" mit href "../../../globals/notifications.xml" nicht > erfolgreich, und es wurde kein "fallback"-Element gefunden. > > Can you help me? > > Hans-Jürgen > > PS: Using version: > BaseX 8.3 beta 474994c [Standalone] >

⚡Generated with XQuery