[basex-talk] function prof:dump not working

2024-01-22 Thread DK Singh
Hi,
I am using BaseX 9.5 and we are using  the prof:dump() function for
debugging code and data. When a query is run in the BaseX GUI, the output
of prof:dump() is shown in the info view.

When we are calling this function in XQUERY and try to print output of
prof:dump() in the log then it is not printing anything.

As per BaseX documentation, if LOGTRACE is 'ON' and BaseX is being used as
a web-application, then the output of prof:dump() function gets logged in
database logs. Checked on the server, LOGTRACE is 'ON' but the output is
not getting logged in log file..

Also we try it to store output prof:dump() in a variable and print it into
log file but not working

let $_Logs := prof:dump($work/@id || ' (' || $work/*:titleSet/*:title[1] ||
')', 'Excluded from output, as no media found: ')
return admin:write-log('output of function prof:dump is: '|| $_Logs)

Can you please suggest how we can capture output of function prof:dump() in
a XML format or in the BaseX log file?

Thank You
Dharmendra


[basex-talk] Improper use error

2024-01-12 Thread DK Singh
Hi i am executing the simple
command  uri-collection('SYS_CONTENT_METADATA') and i am getting the below
error:

Error:
Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk@mailman.uni-konstanz.de
Version: BaseX 9.5
Java: Oracle Corporation, 1.8.0_151
OS: Windows Server 2012 R2, amd64
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException

Can you please suggest how to resolve this issue?

Thanks
Dharmendra Kumar Singh


Re: [basex-talk] db:lock

2022-12-29 Thread DK Singh
Hi

If any update operation is going on by others query then you won't be able
to read the DB

Please see Basex transaction Management

Thanks

On Fri, 30 Dec, 2022, 1:03 pm Ветошкин Владимир, 
wrote:

> Hi,
>
> Yes, it's opened by client's query first. While that query is in progress,
> I query "db:alter" for the same database.
> How can I query "db:alter" after first query ends?
>
> Thank you
>
> 30.12.2022, 10:28, "DK Singh" :
>
> Hi,
> It seems that might be your DB is opened or your DB has Benn crashed
>
> Thanks
>
> On Fri, 30 Dec, 2022, 12:50 pm Ветошкин Владимир, 
> wrote:
>
> Hello everyone
>
> I have an error "[db:lock] Database 'db' cannot be updated, it is opened
> by another process".
> While client's "reading" query from 'db' in progress, I query
> "db:alter('newdb','db')" for the same database.
> How can I wait for ending client's query and then "db:alter('newdb','db')"?
>
> Thanks for your help!
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>
>
>
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>
>


Re: [basex-talk] db:lock

2022-12-29 Thread DK Singh
Hi,
It seems that might be your DB is opened or your DB has Benn crashed

Thanks

On Fri, 30 Dec, 2022, 12:50 pm Ветошкин Владимир, 
wrote:

> Hello everyone
>
> I have an error "[db:lock] Database 'db' cannot be updated, it is opened
> by another process".
> While client's "reading" query from 'db' in progress, I query
> "db:alter('newdb','db')" for the same database.
> How can I wait for ending client's query and then "db:alter('newdb','db')"?
>
> Thanks for your help!
>
> --
> С уважением,
> Ветошкин Владимир Владимирович
>
>


Re: [basex-talk] Dynamic combination search on specific path in BaseX

2022-11-15 Thread DK Singh
Hi Christian,

Thanks for your suggestion

> a) recursively build a query string, which will be evaluated via
xquery:eval (as proposed on StackOverflow)

on this solution i could work if i get the expected result then will
update on stackoverflow

Thanks for your time
Dharmendra kumar Singh

On Tue, Nov 15, 2022 at 7:35 PM Christian Grün 
wrote:

> > Currently front-end not generating the search combination ( (title =
> "United States" or isbn = "2345371242192") and author ="Jhon" ) just i am
> thinking, if i could  achieve this way, so that i could ask fron-end person
> to send this way.
>
> If your frontend is JavaScript-based, it may be easier and cleaner to
> create a JSON object that contains the search fields. Something like:
>
> {
>   "AND": {
> "OR": {
>   "isbn" : "2345371242192",
>   "title": "United States"
> },
> "author": "Jhon"
>   }
> }
>
> If you POST this snippet as 'application/json' to a RESTXQ backend,
> the resulting XML structure will be:
>
> 
>   
> 
>   2345371242192
>   United States
> 
> Jhon
>   
> 
>
> You can then parse this XML fragment with XQuery to either:
>
> a) recursively build a query string, which will be evaluated via
> xquery:eval (as proposed on StackOverflow), or
> b) process the query tree recursively for each element of your document.
>
> The first variant will probably be more efficient.
>
> You’ll probably need to invest some time to get this realized (I don’t
> think there’s a solution that can be used out of the box).
>
> Best,
> Christian
>


Re: [basex-talk] Dynamic combination search on specific path in BaseX

2022-11-15 Thread DK Singh
Thanks Christian for your kind reply

Currently front-end not generating the search combination ( (title =
"United States" or isbn = "2345371242192") and author ="Jhon" ) just i am
thinking, if i could  achieve this way, so that i could ask fron-end person
to send this way.

As per implementation, the front-end is not going to send XPATH for any
field, I am thinking to generate XPATH on the fly and concatenating it with
the search query which will be sent from front-end, is it possible?

The XPATH will be on assumption as per field e.g.(if user select the field
author then i have to look on XPATH (*:info/*:author)[1]/*:personname)

For  this  search ( (title = "United States" or isbn = "2345371242192") and
author ="Jhon" ) how should i ask to generate the query from front-end so
that combination search can be achieved.

Note:  I have to create REST API for this service.

Thanks






On Tue, Nov 15, 2022 at 6:43 PM Christian Grün 
wrote:

> Hi Dharmendra,
>
> Thanks for writing to the list.
>
> > I want to perform combination (AND OR) search on the basis of the
> provided parameter by the user, where user will select the field name
> e.g.(title, isbn, author) and their value from front-end so here field name
> will be the parameter for the BaseX.
> >
> > Currently i am asking front-end person the generate below combination
> query
> > ( (title = "United States" or isbn = "2345371242192") and author ="Jhon"
> )
>
> Could you please give us more details on how this string is generated
> by the frontend?
>
> Next, your XPath expression differs in many aspects from the frontend
> representation. Some examples:
>
> • It seems that "author" needs to be mapped to:
> normalize-space(string-join((*:info/*:author)[1]/*:personname//text())
> • "isbn" was mapped to $isbn="*:info/isban" (shouldn’t it be
> *:info/*:isbn, and without quotes?)
>
> I assume that it’s not sufficient to map each frontend field to an element
> name?
>
> Thanks in advance,
> Christian
>


[basex-talk] Dynamic combination search on specific path in BaseX

2022-11-14 Thread DK Singh
HI
I want to perform combination (AND OR) search on the basis of the provided
parameter by the user, where user will select the field name e.g.(title,
isbn, author) and their value from front-end so here field name will be the
parameter for the BaseX.

Currently i am asking front-end person the generate below combination query
( (title = "United States" or isbn = "2345371242192") and author ="Jhon" )

Now the all parameter value will be compared to  specific XPATH , like
below.

let $Author := 'David Hare'
let $title := "United States "
let $isbn:= '2345371242192 '

return
db:open('test')/*[((
normalize-space(string-join((*:info/*:author)[1]/*:personname//text())
) = $Author or $title = *:info/*:title ) and
$isbn="*:info/isban")]/base-uri()

In the above code XPATH is hardcoded, but I want it to concatenate  on the
fly once string query comes front-end then it will be passed to Basex .

Is there any other way to achieve this? or how should i ask combinations
query from front-end so that  i could achieve this.

Thanks
Dharmendra Kumar Singh


Re: [basex-talk] Indexes getting removed after update operation in database

2020-06-02 Thread DK Singh
Thanks Christian for you quick response

As i understood after from the index documentation after each
update db:optimize function should be called to rebuild the index
structure. so i will implement that

If i set  AUTOOPTIMIZE and UPDINDEX true in local option ".basex " file so
it should work ?

Regards
Dharmendra Kumar Singh



On Tue, Jun 2, 2020 at 8:55 PM Christian Grün 
wrote:

> Hi Dharmendra,
>
> Please check out our documentation [1]; it will give you more insight
> into how indexes are handled in BaseX.
>
> Best,
> Christian
>
> [1] https://docs.basex.org/wiki/Indexes#Updates
>
>
>
> On Tue, Jun 2, 2020 at 4:55 PM DK Singh  wrote:
> >
> > Hi,
> >
> > I am using Basex version 8.6.6 i am creating full text indexes on
> database from the GUI, when any update operation is happening on the
> database all created indexes getting removed.
> >
> > when i use ft module to search anything then error occurs that database
> "test" has not full text index.
> >
> > I am expecting if index already created then it should not removed,
> please suggest how can i resolve this issue.
> >
> >
> > Regards
> >
> > Dharmendra Kumar Singh
>


[basex-talk] Indexes getting removed after update operation in database

2020-06-02 Thread DK Singh
Hi,

I am using Basex version 8.6.6 i am creating full text indexes on database
from the GUI, when any update operation is happening on the database all
created indexes getting removed.

when i use ft module to search anything then error occurs that database
"test" has not full text index.

I am expecting if index already created then it should not removed, please
suggest how can i resolve this issue.


Regards

Dharmendra Kumar Singh


[basex-talk] Copy data from one database to another(basex)

2020-03-18 Thread DK Singh
Hi
I have to copy content from one database to another database, database
containing xml files and word files. When i try to copy using function
db:copy('test','test1') where 'test' is source database and 'test1' is
destination database then it copies only xml files word files are not
copied, can anyone suggest how can i achieve this.

Regards
Dharmendra Kumar Singh


[basex-talk] Change the default user and its Password

2018-10-11 Thread DK Singh
Hi All,

I have to change the default user credential of BaseX  where should i made
the changes,
when i access the url "http://localhost:8984/dba; now it opens with the
default credentials which is "admin" now i have to change it,

i have made the changes in the web.xml


org.basex.user
dharmendra
  

but it is not working still it is taking the default credentials.

Regards
Dharmendra Kumar Singh


[basex-talk] XML Merging while reading from the DB

2018-08-17 Thread DK Singh
Hi All,

I have ingested the XML into DB having node "include"  and within
"include"  some file referenced, when i read the file from the DB it merges
the each XML , is there any way to disabled include functionality while
reading the file.

Input
==
http://docbook.org/ns/docbook; xmlns:xlink="
http://www.w3.org/1999/xlink; xmlns:mml="http://www.w3.org/1998/Math/MathML;
xmlns:xi="http://www.w3.org/2001/XInclude; version="5.0-extension bp-0.1"
role="fullText" xml:id="b-9781845928315" xml:lang="en"
outputformat='e-Only'>




i am reading the file using fn:doc() or db:open() both the function
Merging  included files.

Note: i don't have to set the option on the DB label to disable xinclude .

Regards
Dharmendra Kumar Sing


[basex-talk] XML Files merging while reading from the DB

2018-08-17 Thread DK Singh
Hi All,

I have ingested the XML into DB having node "include"  and within
"include"  some file referenced, when i read the file from the DB it merges
the each XML , is there any way to disabled include functionality while
reading the file.

Input
==
http://docbook.org/ns/docbook; xmlns:xlink="
http://www.w3.org/1999/xlink; xmlns:mml="http://www.w3.org/1998/Math/MathML;
xmlns:xi="http://www.w3.org/2001/XInclude; version="5.0-extension bp-0.1"
role="fullText" xml:id="b-9781845928315" xml:lang="en"
outputformat='e-Only'>




i am reading the file using fn:doc() or db:open() both the function
Merging  included files.

Note: i don't have to set the option on the DB label to disable xinclude .

Regards
Dharmendra Kumar Singh


Re: [basex-talk] Schematron package error

2018-07-23 Thread DK Singh
Hi All,

I got the solution actually i was using Saxon9ee so i have changed the
Saxon9pe and it worked now schematron running fine.

Regards
Dharmendra Kumar Singh

On Fri, Jul 20, 2018 at 5:07 PM DK Singh  wrote:

> Hi All,
>
> I am doing the schematron validation against XML docuemnt but i am getting
> these errors.
>
> Bad name element: XPath error. No XPath. Bad name element: XPath error. No
> XPath. Error on line 1409 column 61 of iso_dsdl_include.xsl: Too many
> nested template or function calls. The stylesheet may be looping. at
> xsl:call-template name="sch-check:strip-strings"
> (file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
>
>
> it looks like basex schematron pacakge throwing the error to run
> schematron validation.
> can anyone suggest how can i resolve this errors.
>
> Regards
> Dharmendra Kumar Singh
>


Re: [basex-talk] Schematron package error

2018-07-22 Thread DK Singh
Thank U Andy for your response, I have tried but it is giving schematron
compilation error, but when I validate on Oxygen editor xmls got validated,
as github documentation I am doing first schematron compilation then
validating the XML, SO how can I resolve this error Now

On Sun 22 Jul, 2018, 9:39 PM James Ball,  wrote:

> Hello Dharmendra,
>
> Have you made sure that the Schematron is compiled before using it to
> validate? I think this is the error you get if you try to use an
> un-compiled Schematron file to perform a validation.
>
> The necessary steps are outlined with the module documentation on GitHub
> and I had it working successfully just a week ago.
>
> Regards, James
>
> > Date: Fri, 20 Jul 2018 17:07:30 +0530
> > From: DK Singh 
> > To: BaseX 
> > Subject: [basex-talk] Schematron package error
> > Message-ID:
> >twju9kw...@mail.gmail.com>
> > Content-Type: text/plain; charset="utf-8"
> >
> > Hi All,
> >
> > I am doing the schematron validation against XML docuemnt but i am
> getting
> > these errors.
> >
> > Bad name element: XPath error. No XPath. Bad name element: XPath error.
> No
> > XPath. Error on line 1409 column 61 of iso_dsdl_include.xsl: Too many
> > nested template or function calls. The stylesheet may be looping. at
> > xsl:call-template name="sch-check:strip-strings"
> >
> (file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
> >
> >
> > it looks like basex schematron pacakge throwing the error to run
> schematron
> > validation.
> > can anyone suggest how can i resolve this errors.
> >
> > Regards
> > Dharmendra Kumar Singh
> > -- next part --
> > An HTML attachment was scrubbed...
> > URL: <
> http://mailman.uni-konstanz.de/pipermail/basex-talk/attachments/20180720/3801dbc8/attachment-0001.html
> >
> >
>
>


Re: [basex-talk] Schematron package error

2018-07-20 Thread DK Singh
HI  Christial,

i am doing validation like this:

import module namespace schematron = "
http://github.com/Schematron/schematron-basex;;

let $sch := schematron:compile(doc('D:\2018\schemas\docbook-mods.sch'))
let $xml := fn:doc('D:\2018\InthisIssue66.xml')
let $validation := schematron:validate($xml, $sch)

return $validation



then it is giving thease kind of errors.

Error:
Stopped at C:/Program Files
(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/schematron.xqm,
39/31:
[bxerr:BXSL0001] Bad name element: XPath error. No XPath.
Bad name element: XPath error. No XPath.
Bad name element: XPath error. No XPath.
Error on line 1409 column 61 of iso_dsdl_include.xsl:
  Too many nested template or function calls. The stylesheet may be looping.
  at xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
  at xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
  at xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
  at xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
  at xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)

Regards
Dharmendra Kumar Singh




On Fri, Jul 20, 2018 at 5:12 PM Christian Grün 
wrote:

> As usual, send us a little reproducible example. Thanks.
>
> DK Singh  schrieb am Fr., 20. Juli 2018, 13:39:
>
>> Hi All,
>>
>> I am doing the schematron validation against XML docuemnt but i am
>> getting these errors.
>>
>> Bad name element: XPath error. No XPath. Bad name element: XPath error.
>> No XPath. Error on line 1409 column 61 of iso_dsdl_include.xsl: Too many
>> nested template or function calls. The stylesheet may be looping. at
>> xsl:call-template name="sch-check:strip-strings"
>> (file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)
>>
>>
>> it looks like basex schematron pacakge throwing the error to run
>> schematron validation.
>> can anyone suggest how can i resolve this errors.
>>
>> Regards
>> Dharmendra Kumar Singh
>>
>


[basex-talk] Schematron package error

2018-07-20 Thread DK Singh
Hi All,

I am doing the schematron validation against XML docuemnt but i am getting
these errors.

Bad name element: XPath error. No XPath. Bad name element: XPath error. No
XPath. Error on line 1409 column 61 of iso_dsdl_include.xsl: Too many
nested template or function calls. The stylesheet may be looping. at
xsl:call-template name="sch-check:strip-strings"
(file:///C:/Program%20Files%20(x86)/BaseX/repo/http-github.com-Schematron-schematron-basex-1.2/content/iso-schematron/iso_dsdl_include.xsl#1409)


it looks like basex schematron pacakge throwing the error to run schematron
validation.
can anyone suggest how can i resolve this errors.

Regards
Dharmendra Kumar Singh


Re: [basex-talk] XML well-formed error

2018-06-06 Thread DK Singh
it is getting transformed on oxygen, but in the basex GUI not getting
transformed, my req is to transformed file has to be write on the file
system, but on the Basex GUI not getting transformed

Regards
Dharmendra Kumar Singh

On Wed 6 Jun, 2018, 4:26 PM Andy Bunce,  wrote:

> Hi  Dharmendra Kumar,
>
> When I run this in Oxygen, loading the result into an editor window, I get
> the same message that BaseX  gives:
>
> Description: The markup in the document following the root element must be
> well-formed.
> Start location: 1:68199
> URL:
> http://www.saxonica.com/html/documentation/javadoc/net/sf/saxon/trans/SaxonErrorCode.html#SXXP0003
>
>
> Your transform is not generating a valid XML document.
>
> Regards
> /Andy
>
> On 6 June 2018 at 11:07, DK Singh  wrote:
>
>> Hi Christian for your reference i am attaching the XSLT and XML which i
>> am trying to transfom using BaseX GUI
>>
>> QUERY
>> =
>>
>> let $xml := fn:doc('D:\2018\VCLP-A2 - admin.xml')
>> let $xsl := fn:doc('D:\2018\DBK2BloomsburyDbk.xslt')
>> return  xslt:transform($xml,$xsl)
>>
>> Error
>> ==
>> Error:
>> Stopped at D:/2017/BLOOMSBURRY/testing-code/eBloomsbury/file, 3/23:
>> [FODC0002] "" (Line 1): The markup in the document following the root
>> element must be well-formed.
>>
>> you can try out to simply run the query on BaseX GUI , i have attached
>> the XML and  XSLt
>>
>> Regards
>> Dharmendra Kumar Sngh
>>
>>
>>
>> On Wed, Jun 6, 2018 at 3:24 PM, Christian Grün > > wrote:
>>
>>> Hi
>>> ​
>>> Dharmendra Kumar.
>>>
>>> P
>>> lease provide us with a little self-contained example (see
>>> http://sscce.org/ for more information).
>>>
>>> ​
>>> Thanks in advance ;)
>>> Christian
>>>
>>>
>>>
>>> On Wed, Jun 6, 2018 at 11:53 AM, DK Singh  wrote:
>>>
>>>> Hi Christian,
>>>> i am running the simple query on Basex GUI
>>>>
>>>> let $xml := fn:doc('D:\2018\VCLP-A2 - admin.xml')
>>>> let $xsl := fn:doc('D:\2018\DBK2BloomsburyDbk.xslt')
>>>> return  xslt:transform($xml,$xsl)
>>>> Regards
>>>> ​​
>>>> Dharmendra Kumar Singh
>>>>
>>>> On Wed, Jun 6, 2018 at 2:49 PM, Christian Grün <
>>>> christian.gr...@gmail.com> wrote:
>>>>
>>>>> Hi ​Dhamendra Kumar,​
>>>>>
>>>>> As usual,
>>>>> ​​
>>>>> please provide us with a little example (see http://sscce.org/ for
>>>>> more information).
>>>>>
>>>>> ​​
>>>>> Thanks in advance,
>>>>> Christian
>>>>>
>>>>>
>>>>> On Wed, Jun 6, 2018 at 11:16 AM, DK Singh 
>>>>> wrote:
>>>>>
>>>>>> Hi All,
>>>>>> I have a XML file when i apply xslt using xslt:transform function it
>>>>>> is giving well formed error, even i tried on BaseX UI  using
>>>>>> xslt:transform function
>>>>>>
>>>>>> [FODC0002] "" (Line 1): The markup in the document following the root
>>>>>> element must be well-formed.
>>>>>>
>>>>>> but when the same file i transform on the oxygeng editor it getting
>>>>>> transformed, can anyone suggest what going wrong.
>>>>>> Regards
>>>>>> Dharmendra Kumar Singh
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>


Re: [basex-talk] XML well-formed error

2018-06-06 Thread DK Singh
Hi Christian,
i am running the simple query on Basex GUI

let $xml := fn:doc('D:\2018\VCLP-A2 - admin.xml')
let $xsl := fn:doc('D:\2018\DBK2BloomsburyDbk.xslt')
return  xslt:transform($xml,$xsl)
Regards
Dharmendra Kumar Singh

On Wed, Jun 6, 2018 at 2:49 PM, Christian Grün 
wrote:

> Hi ​Dhamendra Kumar,​
>
> As usual, please provide us with a little example (see http://sscce.org/
> for more information).
>
> Thanks in advance,
> Christian
>
>
> On Wed, Jun 6, 2018 at 11:16 AM, DK Singh  wrote:
>
>> Hi All,
>> I have a XML file when i apply xslt using xslt:transform function it is
>> giving well formed error, even i tried on BaseX UI  using xslt:transform
>> function
>>
>> [FODC0002] "" (Line 1): The markup in the document following the root
>> element must be well-formed.
>>
>> but when the same file i transform on the oxygeng editor it getting
>> transformed, can anyone suggest what going wrong.
>> Regards
>> Dharmendra Kumar Singh
>>
>
>


[basex-talk] XML well-formed error

2018-06-06 Thread DK Singh
Hi All,
I have a XML file when i apply xslt using xslt:transform function it is
giving well formed error, even i tried on BaseX UI  using xslt:transform
function

[FODC0002] "" (Line 1): The markup in the document following the root
element must be well-formed.

but when the same file i transform on the oxygeng editor it getting
transformed, can anyone suggest what going wrong.
Regards
Dharmendra Kumar Singh


Re: [basex-talk] Set indent no at database label (globally)

2018-05-18 Thread DK Singh
Thank U  Christian,

It worked now after transformation i was writing the file into filesystem
using file:write() so i defined the third parameter there  map { "method":
"xml", 'indent':no }

again Thank U so much

Regards
Dharmendra Kumar Singh

On Fri, May 18, 2018 at 5:43 PM, Christian Grün <christian.gr...@gmail.com>
wrote:

> hi
> ​
> Dharmendra,
>
> Maybe your database contains whitespace text nodes? If it does, these
> whitespaces will simply be returned as part of your document. Only if it
> doesn’t, the "indent" parameter will add new whitespaces [1].
>
> You can count the number of these text nodes with the following query:
>
>   count(
> for $text in db:open('db')//text()
> where normalize-space($text) = ''
> return $text
>   )
>
> Or (shorter):
>
> count(db:open('db')//text()[not(normalize-space())])
>
> If your database has no whitespace-only nodes, you might need to provide
> us with a step-by-step description.
>
> Best,
> Christian
>
> [1] https://www.w3.org/TR/xslt-xquery-serialization-31/#xml-indent
>
>
>
>
> On Fri, May 18, 2018 at 1:57 PM, DK Singh <dharam.m...@gmail.com> wrote:
>
>> Thanks U Christian,
>>
>> I  have done as you suggested  but problem is still there XML getting
>> indent, after setting i had re-started the HTTP service  and run the query
>> to transform the document after transformation XML getting indent.
>>
>> below is the setting snapshot
>>
>>
>>
>> Regards
>> Dharmendra Kumar Singh
>>
>> On Fri, May 18, 2018 at 4:35 PM, Christian Grün <
>> christian.gr...@gmail.com> wrote:
>>
>>> > I am using HTTP services so as i set chop false like
>>> >
>>> > 
>>> >   org.basex.chop
>>> >   false
>>> > 
>>> >
>>> > so in this format i have to set SERIALIZER = indent=no or other way in
>>> the
>>> > web.xml file.
>>>
>>> Exactly. Try this:
>>>
>>>   
>>> org.basex.serializer
>>> indent=no
>>>   
>>>
>>>
>>>
>>> > On Fri, May 18, 2018 at 3:50 PM, Christian Grün <
>>> christian.gr...@gmail.com>
>>> > wrote:
>>> >>
>>> >> Hi Dharmendra Kumar,
>>> >>
>>> >> You can set this option globally by adding the line
>>> >>
>>> >> SERIALIZER = indent=no
>>> >>
>>> >> at the bottom of your .basex configuration file [1]. If you use HTTP
>>> >> services, you can add an entry to your web.xml file [2].
>>> >>
>>> >> Both solutions will affect all databases; there is currently no way to
>>> >> define serialization parameters for specific databases.
>>> >>
>>> >> Hope this helps,
>>> >> Christian
>>> >>
>>> >> [1] http://docs.basex.org/wiki/Options#SERIALIZER
>>> >> [2] http://docs.basex.org/wiki/Web_Application#Configuration
>>> >>
>>> >>
>>> >> On Fri, May 18, 2018 at 12:13 PM, DK Singh <dharam.m...@gmail.com>
>>> wrote:
>>> >> > Hi All,
>>> >> >
>>> >> > I have to set indent='no' at the database label how can i achieve
>>> this,
>>> >> > i
>>> >> > have gone thorough the  documentation and found that either we can
>>> do:
>>> >> > (1)
>>> >> > declare namespace output =
>>> >> > "http://www.w3.org/2010/xslt-xquery-serialization;;
>>> >> > declare option output:indent "no";
>>> >> >
>>> >> > but the problem is that all the XQUERY module i have library module
>>> so
>>> >> > it is
>>> >> > throwing error.
>>> >> > so is there any option.
>>> >> >
>>> >> > Regards
>>> >> >
>>> ​​
>>> Dharmendra Kumar Singh
>>> >> >
>>> >> >
>>> >
>>> >
>>>
>>
>>
>


Re: [basex-talk] Set indent no at database label (globally)

2018-05-18 Thread DK Singh
Thanks U Christian,

I  have done as you suggested  but problem is still there XML getting
indent, after setting i had re-started the HTTP service  and run the query
to transform the document after transformation XML getting indent.

below is the setting snapshot



Regards
Dharmendra Kumar Singh

On Fri, May 18, 2018 at 4:35 PM, Christian Grün <christian.gr...@gmail.com>
wrote:

> > I am using HTTP services so as i set chop false like
> >
> > 
> >   org.basex.chop
> >   false
> > 
> >
> > so in this format i have to set SERIALIZER = indent=no or other way in
> the
> > web.xml file.
>
> Exactly. Try this:
>
>   
> org.basex.serializer
> indent=no
>   
>
>
>
> > On Fri, May 18, 2018 at 3:50 PM, Christian Grün <
> christian.gr...@gmail.com>
> > wrote:
> >>
> >> Hi Dharmendra Kumar,
> >>
> >> You can set this option globally by adding the line
> >>
> >> SERIALIZER = indent=no
> >>
> >> at the bottom of your .basex configuration file [1]. If you use HTTP
> >> services, you can add an entry to your web.xml file [2].
> >>
> >> Both solutions will affect all databases; there is currently no way to
> >> define serialization parameters for specific databases.
> >>
> >> Hope this helps,
> >> Christian
> >>
> >> [1] http://docs.basex.org/wiki/Options#SERIALIZER
> >> [2] http://docs.basex.org/wiki/Web_Application#Configuration
> >>
> >>
> >> On Fri, May 18, 2018 at 12:13 PM, DK Singh <dharam.m...@gmail.com>
> wrote:
> >> > Hi All,
> >> >
> >> > I have to set indent='no' at the database label how can i achieve
> this,
> >> > i
> >> > have gone thorough the  documentation and found that either we can do:
> >> > (1)
> >> > declare namespace output =
> >> > "http://www.w3.org/2010/xslt-xquery-serialization;;
> >> > declare option output:indent "no";
> >> >
> >> > but the problem is that all the XQUERY module i have library module so
> >> > it is
> >> > throwing error.
> >> > so is there any option.
> >> >
> >> > Regards
> >> > Dharmendra Kumar Singh
> >> >
> >> >
> >
> >
>


Re: [basex-talk] Set indent no at database label (globally)

2018-05-18 Thread DK Singh
Hi Grun,

I am using HTTP services so as i set chop false like


  org.basex.chop
  false


so in this format i have to set SERIALIZER = indent=no or other way in the
web.xml file.


On Fri, May 18, 2018 at 3:50 PM, Christian Grün <christian.gr...@gmail.com>
wrote:

> Hi Dharmendra Kumar,
>
> You can set this option globally by adding the line
>
> SERIALIZER = indent=no
>
> at the bottom of your .basex configuration file [1]. If you use HTTP
> services, you can add an entry to your web.xml file [2].
>
> Both solutions will affect all databases; there is currently no way to
> define serialization parameters for specific databases.
>
> Hope this helps,
> Christian
>
> [1] http://docs.basex.org/wiki/Options#SERIALIZER
> [2] http://docs.basex.org/wiki/Web_Application#Configuration
>
>
> On Fri, May 18, 2018 at 12:13 PM, DK Singh <dharam.m...@gmail.com> wrote:
> > Hi All,
> >
> > I have to set indent='no' at the database label how can i achieve this, i
> > have gone thorough the  documentation and found that either we can do:
> > (1)
> > declare namespace output =
> > "http://www.w3.org/2010/xslt-xquery-serialization;;
> > declare option output:indent "no";
> >
> > but the problem is that all the XQUERY module i have library module so
> it is
> > throwing error.
> > so is there any option.
> >
> > Regards
> > Dharmendra Kumar Singh
> >
> >
>


[basex-talk] Set indent no at database label (globally)

2018-05-18 Thread DK Singh
Hi All,

I have to set indent='no' at the database label how can i achieve this, i
have gone thorough the  documentation and found that either we can do:
(1)
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization

";
declare option output:indent "no";

but the problem is that all the XQUERY module i have library module so it
is throwing error.
so is there any option.

Regards
Dharmendra Kumar Singh


[basex-talk] Implement read lock and write lock

2017-08-17 Thread DK Singh
Hi All,

How can i implement read lock and write lock,  any functions to do this

Regards
Dharmendra Kumar Singh


Re: [basex-talk] Save XMLs into filesystem from DB

2017-07-06 Thread DK Singh
Thanks for your reply Kristian

So I gone through the documentation and I found that function file:write
take parameters path and item so first parameters I am passing the local
directory path where documents has to be saved and second argument I am
passing the item

It will be very helpful if you provide the example

On 06-Jul-2017 11:27 PM, "Kristian Kankainen"  wrote:

> You only provide a path to file:write whichbgets overwritten by each
> for-loop, so you end up with just one file with the contents of the last
> run of the for-loop. You should instead provide a file name for each file
> you want to write.
> 6. juuli 2017 1:42 PM kirjutas kuupäeval Dharmendra Singh <
> dharam.m...@gmail.com>:
>
> Hi All ,
>
> i have to save the XMLs files from  the DB but i am not able to do that
> below is my code, this code is generating only one kb file  so can any one
> tell me where i am doing wrong
>
> let $localpath := 'D:/2017/doctest/xmls'
> for $xmls in db:open('test')
>
> return file:write($localpath,$xmls,map{"method": "xml"})
>
> Note: i am able to do using import command but i don't have to copy all
> data from the DB i have to copy by URI
>
>
> Thanks & Regards
>
> Dharmendra Kumar Singh
>
>