Re: [basex-talk] file:write, formatting, and maps in select attributes

2024-02-23 Thread gerrit . imsieke
Hi Graydon,

This might not be a serialization but a parsing problem  The XML parser 
performs attribute value normalization as per 
https://www.w3.org/TR/xml/#AVNormalize

I have often wished that there were a parser option to preserve newlines in 
attribute values, in particular for keeping the indentation of multiline XPath 
expressions in XProc or XSLT in a future XProc 1.0 → 3.0 migration tool.

For such a migration, the XPath expressions may need modifications, too, so I 
thought they need to be parsed and transformed anyway, and then they can be 
re-serialized with indentation (I haven't tried b/c I'm  writing this on the 
phone, but I strongly believe I can have newlines serialized in attribute 
values).

But in your case a parser option would be useful.

An alternative could  be to apply some text preprocessing to the document. For 
example, read it with unparsed-text, use analyze-string to match attribute 
values (difficult even in moderately complex cases), replace each newline with 
a PUA character and serialize this character as newline using a character map 
later on.

Gerrit

Sent from MailDroid

-Original Message-
From: Graydon Saunders 
To: BaseX 
Sent: Fri, 23 Feb 2024 22:50
Subject: [basex-talk] file:write, formatting, and maps in select attributes

Hello --

I'm trying to regularize the formatting of some XSLT files by loading them
(via doc()) and writing them back out via file:write()

I know about the *indent* and *indent-attributes* serialization parameters,
and mostly they're doing what I want.

What I'd like is to preserve a one-line-per-entry format for a map in a
select attribute. For example, I'd like to keep



instead of



I don't think there's a way to do this with the serialization parameters,
but is there a way to do this?

Thanks!
Graydon

-- 
Graydon Saunders  | graydon...@fastmail.com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")


Re: [basex-talk] mapping functions

2023-08-15 Thread gerrit . imsieke
You can import the library module in the evaluated expression. Example: 
https://github.com/transpect/control-backend/blob/main/webapp/control-backend.xqm#L60

Gerrit


Sent from MailDroid

-Original Message-
From: Graydon Saunders 
To: BaseX 
Sent: Wed, 16 Aug 2023 4:42
Subject: [basex-talk] mapping functions

Hello --

I have various databases that will be run through the same code after their
contents is regularized.  So the only different function is the one used
for regularization.

This can be handled by writing a wrapper function and passing in a label to
say which function to use, but I was wondering if there's a way to do it in
the configuration map directly.  The configuration map exists as a text
file and gets run through xquery:eval() at the start of the process.

declare namespace abc='http://some/uri';
'regularizationFunction': map {
 'typeOne': abc:regularizationOne#1,
 'typeTwo': abc:regularizationTwo#1
}

doesn't work, because the abc functions aren't known at evaluation time.
These functions are defined in the library module that's evaluating the
configuration file but xquery:eval() doesn't know that.  I don't see a way
to use bindings to get around this.

Is there a way to map a locally-defined function reference so xquery:eval()
will recognize it?

thanks!
Graydon

-- 
Graydon Saunders  | graydon...@fastmail.com
Þæs oferéode, ðisses swá mæg.
-- Deor  ("That passed, so may this.")


Re: [basex-talk] basex-talk@mailman.uni-konstanz.de

2020-05-30 Thread gerrit . imsieke
Hi Mohamed,

maybe you are using a 32-bit version of Java?

Gerrit


Sent from MailDroid

-Original Message-
From: Noki Vcon 
To: basex-talk@mailman.uni-konstanz.de
Sent: Sat, 30 May 2020 10:59
Subject: [basex-talk] basex-talk@mailman.uni-konstanz.de

Hi,

I have modified BaseX_JVM for GUI to 3072M and Java Runtime
parameter -Xmx3072m. BaseX GUI will not open if the BaseX_JVM value is more
than 1400. Then I have to go to bin and edit the file to 1400 or less so it
will open again.

Please advise how this can be fixed?

Thanks
Mohamed