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 }
Perfect! And it’s true, file:write (and other serializing functions) do not consider which global serialization parameters have been set.
again Thank U so much
Regards Dharmendra Kumar Singh
On Fri, May 18, 2018 at 5:43 PM, Christian Grün <christian.gruen@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.mahi@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.gruen@gmail.com> wrote:
I am using HTTP services so as i set chop false like
<context-param> <param-name>org.basex.chop</param-name> <param-value>false</param-value> </context-param>
so in this format i have to set SERIALIZER = indent=no or other way
in the
web.xml file.
Exactly. Try this:
<context-param> <param-name>org.basex.serializer</param-name> <param-value>indent=no</param-value> </context-param>
On Fri, May 18, 2018 at 3:50 PM, Christian Grün <
christian.gruen@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.mahi@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
> >