Omar Siam | 27 Mar 11:05 2015
Picon

xmlns shuffling

Hello list!

For our projects we have an XSLT library to do some transforms. These 
XSLT files are version controlled using git. We now see changes where 
just the  <at> xmlns:* are shuffled around. Moreover if you format a dozen or 
so  <at> xmlns:* for better readability each on a new line that is also lost. 
This is a disturbing feature. Is there anything (planned) to change this?

Regards
Omar Siam

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Alexander Henket | 27 Mar 11:04 2015
Picon
Picon

eXist-db LTS production down. Cannot install/db corrupt?

Hi,

I'm having a production down issue. Our main package that drives all other packages is not installing anymore.

In the logging I get a load of errors like this one:
	INFO | jvm 1 | 2015/03/27 11:01:35 | Loading mime table from file
/usr/local/exist_atp_21_20141104/tools/wrapper/bin/../../../mime-types.xml 
	INFO | jvm 1 | 2015/03/27 11:02:03 | java.io.IOException: Cannot backup binary resource for journal to
/usr/local/exist_atp_21_20141104/webapp/WEB-INF/data/fs.journal/txn.8/db/apps/art/icon.png 

What's my next move?

Regards

Alexander Henket

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Adam Retter | 26 Mar 16:49 2015

Re: Is there a simple way to specify a bounce address with mail:send-email ?

> Yes I would be interested to. I didn't do some Java coding for long time now, but maybe I would be able to
update the SendEmailFunction.java myself.
>
> Since I am still running eXist-1.4.3, have you changed the SendEmailFunction.java since that time ?

Yup - https://github.com/eXist-db/exist/commits/develop/extensions/modules/src/org/exist/xquery/modules/mail/SendEmailFunction.java

> Is there an ant target to just recompile the extensions modules like the mail module ? Is it possible to
recompile just the mail module ?
>

The ant target is `exenstion-modules`

--

-- 
Adam Retter

eXist Developer
{ United Kingdom }
adam <at> exist-db.org
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
Adam Retter | 26 Mar 13:49 2015

Re: Is there a simple way to specify a bounce address with mail:send-email ?

> So just to check, using your new API,  to implement my use case should I  pass the following 1st parameter to
mail:send-email :
>
> <envelope>
> <MAIL-FROM>{ $bounce }</MAIL-FROM>
> <mail>
>   <from>please-do-not-reply <at> mydomain.com</from>
>   <reply-to>{ $sender }</reply-to>
>   <to>{ normalize-space($to) }</to>
>   <subject>{ if ($subject) then $subject else 'no subject' }</subject>
>   <message><text>{ if ($content) then $content else 'no content' }</text></message>
> </mail>
> </envelope>
>
> If this is correct then I vote for (even if you lower case MAIL-FROM or find any other trick to turn "MAIL
FROM:" into an xml element name) !

Yes that is my suggested approach, and yes I would lower-case the
element names. Is this something you would be interested to try and
add into the send-email code?

--

-- 
Adam Retter

eXist Developer
{ United Kingdom }
adam <at> exist-db.org
irc://irc.freenode.net/existdb

------------------------------------------------------------------------------
(Continue reading)

Adam Retter | 26 Mar 12:38 2015

Re: Is there a simple way to specify a bounce address with mail:send-email ?

Hi Stephane,

I wanted to keep the <mail> XML as representation of a message, and
therefore disjoint from the SMTP protocol itself (e.g. MAIL FROM, HELO
etc). I could see however, extending the mail:send-email function to
take either a <mail> element or a <envelope> element which would give
some control over the SMTP conversation and also include a <mail>
element within it.

How does that sound?

On 26 March 2015 at 11:14, Stephane S. <s.sire <at> oppidoc.fr> wrote:
> Thank you Adam,
>
> This is something I certainly would like to have.
>
> Just to be more explicit here is my use case.
>
> I have a kinda workflow application sending e-mails on behalf of users to other users through the system.
>
> Initially I naively passed the mail:send-email function a mail configuration element such as :
>
> <mail>
>   <from>{ $sender }</from>
>   <to>{ $to }</to>
>   <subject>{ if ($subject) then $subject else 'no subject' }</subject>
>   <message><text>{ if ($content) then $content else 'no content' }</text></message>
> </mail>
>
> Where $sender is the e-mail address of the user on-behalf of who the e-mail is sent by the application, and
(Continue reading)

Birnbaum, David J | 25 Mar 15:52 2015
Picon

differences between new and old range indexes

Dear eXistentialists,

eXist version information:

project.version=2.2
project.built=20141228062718
scm.branch=develop
scm.revision=af2fe83

While experimenting with the new range index (by wrapping <range> tags
around my old range index declarations) I noticed a discrepancy. The old
range index atomizes its contents automatically, which means that if I
create an xs:string range index on

    <word>m<stress>a</stress>ma</stress>

it gets used when I look for

    //word[. eq 'mama']

This is the behavior I need for my project.

The new range index, though, seems to index "m" and "ma", but not "mama".
That is, it seems to index each text() node child of the index target as a
separate index entry, it seems to ignore any text() nodes inside child
elements inside the index target, and it doesn't seem to index the entire
atomized value. In this respect it behaves like the Lucene full text
index, except that the Lucene full text index would let me use <inline> to
modify the behavior, and I don't see that option in the documentation for
the new range index.
(Continue reading)

Marc van Grootel | 25 Mar 00:17 2015
Picon

Fwd: Generalizing a function

forgot to cc the list

--Marc

Begin forwarded message:

From: Marc van Grootel <marc.van.grootel <at> gmail.com>
Date: 25 maart 2015 00:15:13 CET
To: Joe Wicentowski <joewiz <at> gmail.com>
Subject: Re: [Exist-open] Generalizing a function

... at first glance
Both provide a more or less XSLT-like transformations. In Origami this is xf:transform. John's library uses a pattern parser. I use fn:eval as I wanted to avoid parsing XPath. John's is more complete I think. Mine focuses on simple templating and at the moment I don't even handle namespaces properly. In Origami I use two types of "transforms", xf:transform processes the whole tree whereas xf:extract does only extraction of nodes (which is simpler). Within those I use simple node transformation functions such as xf:wrap, xf:unwrap and xf:replace that can be composed.

--Marc

On 24 mrt. 2015, at 22:57, Joe Wicentowski <joewiz <at> gmail.com> wrote:

Thanks very much for pointing me to this, Marc.  I remember coming across this a few months ago and wanting to take a closer look.  This provides a good reason to do so!  I also wanted to look into John Snelson's transform.xq (project home https://github.com/jpcs/transform.xq and slides https://prezi.com/a2m05knqfmie/transformxq-a-transformation-library-for-xquery-30/).  If you've looked at that before, do you have any comment on similarities or differences between origami and transform.xq?

Thanks again,
Joe

On Tue, Mar 24, 2015 at 5:05 PM, Marc van Grootel <marc.van.grootel <at> gmail.com> wrote:
Hi Joe,

Though I do not have a solution for your exact problem I did create a small xquery templating library that uses some techniques using higher order functions [1]. Alas it's currently BaseX specific but maybe the tutorial blog posts give you some ideas [2]. Currently the library has issues and I am going to pick it up again the next months.


On 24 mrt. 2015, at 17:40, Joe Wicentowski <joewiz <at> gmail.com> wrote:

Hi all,

I am transforming some TEI into HTML, and trying to fix some patterns that are legal in TEI but not in HTML, using XQuery.  For example, in TEI it's legal to have a <list> inside a <p>, but in HTML, <p> cannot contain a <ul>.  I've written a function that fixes instances of this, but now I've encountered a second case (<blockquote> is not allowed inside of <p>), and I am trying to think of a way to generalize the function, so that I can pass it a set of parameters for in-memory transformation.  However, I can't think of a way to do this.  

Does anyone have suggestions?  If not, I'll send this to xquery-talk, but I thought I'd give this a shot here first.

Thanks,
Joe


Here's my current code:
--
xquery version "3.0";

declare namespace xhtml = "http://www.w3.org/1999/xhtml"; 

(: pull lists from within paragraphs out, constructing new paragraphs around non-list nodes as needed 
   newly constructed 'interior' nodes are given a <at> class of "continued-from-before-list" :)
declare function local:fix-lists($node) {
    if ($node/self::xhtml:p/xhtml:ul) then
        let $nodes := $node/node()
        let $lists := $node/xhtml:ul
        (: iterate through lists by their position within the sequence of nodes :)
        let $positions := $lists ! index-of($nodes, .)
        for $position at $n in $positions
        (: surround preceding and following nodes with <p> tags :)
        let $before := 
            if ($position gt 1) then 
                <p xmlns="http://www.w3.org/1999/xhtml">{
                    if ($n = 1) then () else attribute class {'continued-from-before-list'},
                    $nodes[position() = ($positions[$n - 1] + 1 to $position - 1)]
                }</p> 
            else 
                ()
        let $list := $lists[$n]
        let $after := if ($n = count($lists) and $position lt count($nodes)) then 
            <p xmlns="http://www.w3.org/1999/xhtml">{
                attribute class {'continued-from-before-list'}, 
                $nodes[position() gt $position]
            }</p> else ()
        return
            ( $before, $list, $after )
    else 
        typeswitch ($node)
        case text() return $node
        default return element {QName(namespace-uri($node), $node/local-name())} { $node/ <at> *, for $child in $node/node() return local:fix-lists($child) }
};

let $node := 
    <p>blah
      <ul/>
      blah
     </p>
  </div>
return 
    local:fix-lists($node)
--

this query returns the desired form:

  <p>blah</p>
  <ul/>
  <p class="continued-from-before-list">blah</p>
</div>

What I'd like is to turn this into a more generalizable function, like:

  local:fix-html($node, $parameters) 

where node is the HTML node I'd like to transform, and $parameters is a map containing a filter for selecting matches and a function to transform:

  filter-a: html:p[html:ul]
  transform-a: for each html:ul, split the html:p and thereby promote the html:ul as a following- and preceding-sibling of the two new html:p elements

  filter-b: html:p[html:blockquote]
  transform-b: for each html:blockquote, split the html:p and thereby promote the html:blockquote as a following- and preceding-sibling of the two new html:p elements 

However, I can't think of how to do this.  Perhaps via higher order functions?  

It seems XSLT makes this pretty trivial (see Michael Kay's suggestion at http://stackoverflow.com/questions/4779871/xslt-move-node-one-level-up), but is there a good way in XQuery?

Thanks,
Joe
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Joe Wicentowski | 24 Mar 17:40 2015
Picon

Generalizing a function

Hi all,

I am transforming some TEI into HTML, and trying to fix some patterns that are legal in TEI but not in HTML, using XQuery.  For example, in TEI it's legal to have a <list> inside a <p>, but in HTML, <p> cannot contain a <ul>.  I've written a function that fixes instances of this, but now I've encountered a second case (<blockquote> is not allowed inside of <p>), and I am trying to think of a way to generalize the function, so that I can pass it a set of parameters for in-memory transformation.  However, I can't think of a way to do this.  

Does anyone have suggestions?  If not, I'll send this to xquery-talk, but I thought I'd give this a shot here first.

Thanks,
Joe


Here's my current code:
--
xquery version "3.0";

declare namespace xhtml = "http://www.w3.org/1999/xhtml"; 

(: pull lists from within paragraphs out, constructing new paragraphs around non-list nodes as needed 
   newly constructed 'interior' nodes are given a <at> class of "continued-from-before-list" :)
declare function local:fix-lists($node) {
    if ($node/self::xhtml:p/xhtml:ul) then
        let $nodes := $node/node()
        let $lists := $node/xhtml:ul
        (: iterate through lists by their position within the sequence of nodes :)
        let $positions := $lists ! index-of($nodes, .)
        for $position at $n in $positions
        (: surround preceding and following nodes with <p> tags :)
        let $before := 
            if ($position gt 1) then 
                <p xmlns="http://www.w3.org/1999/xhtml">{
                    if ($n = 1) then () else attribute class {'continued-from-before-list'},
                    $nodes[position() = ($positions[$n - 1] + 1 to $position - 1)]
                }</p> 
            else 
                ()
        let $list := $lists[$n]
        let $after := if ($n = count($lists) and $position lt count($nodes)) then 
            <p xmlns="http://www.w3.org/1999/xhtml">{
                attribute class {'continued-from-before-list'}, 
                $nodes[position() gt $position]
            }</p> else ()
        return
            ( $before, $list, $after )
    else 
        typeswitch ($node)
        case text() return $node
        default return element {QName(namespace-uri($node), $node/local-name())} { $node/ <at> *, for $child in $node/node() return local:fix-lists($child) }
};

let $node := 
    <p>blah
      <ul/>
      blah
     </p>
  </div>
return 
    local:fix-lists($node)
--

this query returns the desired form:

  <p>blah</p>
  <ul/>
  <p class="continued-from-before-list">blah</p>
</div>

What I'd like is to turn this into a more generalizable function, like:

  local:fix-html($node, $parameters) 

where node is the HTML node I'd like to transform, and $parameters is a map containing a filter for selecting matches and a function to transform:

  filter-a: html:p[html:ul]
  transform-a: for each html:ul, split the html:p and thereby promote the html:ul as a following- and preceding-sibling of the two new html:p elements

  filter-b: html:p[html:blockquote]
  transform-b: for each html:blockquote, split the html:p and thereby promote the html:blockquote as a following- and preceding-sibling of the two new html:p elements 

However, I can't think of how to do this.  Perhaps via higher order functions?  

It seems XSLT makes this pretty trivial (see Michael Kay's suggestion at http://stackoverflow.com/questions/4779871/xslt-move-node-one-level-up), but is there a good way in XQuery?

Thanks,
Joe
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Joern Turner | 24 Mar 10:31 2015
Picon

LAST CALL: removal of SOAP API

This is the last call before we remove the long deprecated SOAP API.

If someone's relying on that please let us know NOW - otherwise this API will get removed from the codebase.

Thanks for the attention,

Joern
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Birnbaum, David J | 23 Mar 04:18 2015
Picon

database tuning?

Dear eXistentialists,

I've run out of ideas while trying to improve the performance of a
configuration and I was wondering whether someone might be able to advise.
eXist version:

project.version=2.2
project.built=20141228062718
scm.branch=develop
scm.revision=af2fe83

I'm running on a server with 2G of RAM and I've set the JVM memory to
-Xms512m -Xmx1024m. The cache configuration in conf.xml reads:

<db-connection cacheSize="256M" checkMaxCacheSize="true"
collectionCache="64M" database="native"
        files="webapp/WEB-INF/data" pageSize="4096" nodesBuffer="1000"
cacheShrinkThreshold="10000"
        doc-ids="default" minDiskSpace="128M">

The profiler reports that my query is making full use of the new range
index, and the index file is (for this query I'm using only the range
index and only for <form> and <content>):

<collection xmlns="http://exist-db.org/collection-config/1.0">
    <index>
        <!-- New full text index based on Lucene -->
        <lucene>
            <text qname="unstressed"/>
            <text qname="remainder"/>
        </lucene>
         <!-- Range indexes -->
        <create qname="unstressed" type="xs:string"/>
        <create qname="remainder" type="xs:string"/>
        <create qname="form" type="xs:string"/>
        <create qname="content" type="xs:string"/>
        <!-- N-gram indexes -->
        <ngram qname="unstressed"/>
        <ngram qname="remainder"/>
    </index>
</collection>

A query nonetheless can take 1-2 minutes to return. The data is about 500k
records (will be about 2M when completed), distributed over several files
in the same collection, that look roughly like:

      <form>
         <categories>
            <category case="N" number="sg"/>
            <category case="A" number="sg"/>
         </categories>
         <content>абаж<stress>у</stress>р</content>
      </form>

The general query logic (I can post the query file, if that would be
helpful; I've left it out now just for brevity) is to take plain-text
input, tokenize it into words, find the <content> elements that are
string-equal to the words, and return the <content> elements (there may be
more than one, in which I case I return them all). The point is to input
unstressed text and return the same data with the <stress> elements added.
At the moment the only part of the data I'm using is the <content>
element, but I expect to be making use of the <categories> element at a
later time.

The cache reports in Monex after running the same query with the same
input several times are:

dom.dbx (BTree)Size: 1639 / Used: 1639 / Fails: 27032 / Hits: 57385
structure.dbx (BTree)Size: 5530 / Used: 5530 / Fails: 104869 / Hits:
39433869
collections.dbx (BTree)Size: 64 / Used: 64 / Fails: 176 / Hits: 3361

values.dbx (BTree)Size: 216 / Used: 216 / Fails: 7265 / Hits: 30928

I don't know whether this is a database tuning problem or a query tuning
problem or a hardware problem or something else, but after having read the
tuning guide at http://exist-db.org/exist/apps/doc/tuning.xml and tried
what I could from there, I'm not sure where the problem lies. Suggestions
welcome!

Thanks,

David

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Stephane S. | 20 Mar 19:52 2015
Picon

Is there a simple way to specify a bounce address with mail:send-email ?

Hi,

Does anybody know if there is a mean to specify a bounce address for errors raised during email transmission
sent with the mail:send-email function ? 

I have found the <reply-to> element in mail:send-email description but as far as I understand it is only to
specify a different address for replying in the email client user agent of the recipient. 

Searching on the web I came to the conclusion that this can be achieved either by adding a Return-Path:
header in the message payload, or by setting the bounce address with the MAIL FROM: command when talking to
the smtp server. Thus my impression is that this requires to adapt the SendEmailFunction.java function.

Has anyone does something like that before and could give me some clues ?

Thanks in advance,

Stéphane S.
---

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/

Gmane