Tonya-Marie Howe | 26 Oct 02:55 2014

joining x and y with more than one instance of each

Hello, list!

I think I'm making a little progress on this, but I have reached the point where I'm pulling my hair. I have XML files with two (or potentially 3) <resp> and <name> elements--for instance, one person is responsible for transcription, and another is responsible for both transcription and markup. Something like this: 

<respStmt>
  <resp>Transcription and correction</resp>
  <name>Elizabeth Ricketts</name>
</respStmt>
  <resp>Correction, editorial commentary, and markup</resp>
  <name>Tonya Howe</name>
</respStmt>

I want the lines to display as follows:

Transcription and correction by Elizabeth Ricketts
Correction, editorial commentary, and markup by Tonya Howe

Here's what I'm currently trying:

{
                for $respStmt in $header
                let $respCount := count($header//tei:respStmt)
                return 
                    if ($respCount > 1) then
                        <p>{string-join(($titleStmt/tei:respStmt/tei:resp, $titleStmt/tei:respStmt/tei:name), ' by ')}</p>
                    else
                        concat($titleStmt/tei:respStmt/tei:resp, ' by', $titleStmt/tei:respStmt/tei:name)
            }

This gives me:

Transcription and correction by Correction, editorial commentary, and markup by Elizabeth Ricketts by Tonya Howe

And this:

                for $resp in $resps
                return
                    <p>{string-join(($titleStmt/tei:respStmt/tei:resp, $titleStmt/tei:respStmt/tei:name), ' by ')}</p>
               
            }

Gives me:

Transcription and correction by Correction, editorial commentary, and markup by Elizabeth Ricketts by Tonya Howe

Transcription and correction by Correction, editorial commentary, and markup by Elizabeth Ricketts by Tonya Howe

I know the solution has to do with nesting FLOWRs, but I can't seem to make it out. :(

Thank-you, eXist forum, for your generosity and patience,
Tonya




--
Associate Professor of Literature
------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Andreas Jung | 25 Oct 15:07 2014

Indexes used only for queries?


Hi there,

we have content with like this:

<dghodoc>
   <meta name="XX">
     <value>a</value>
   </meta>
   <meta name="YYY">
     <value>1</value>
     <value>2</value>
   </meta>

For report we have script like this:

<items> {
    let $data-collection := '/db/onkopedia'
    for $doc in collection($data-collection)[ends-with(base-uri(.), '.xml')]
    return
        <item>
            <uri>{base-uri($doc)}</uri>

<title>{local:trim($doc//meta[ <at> name="Titel"]/value/text())}</title>

        </item>
}
</items>

Will exist-db make use of indexes for generating the output (e.g. <meta>
or <value> would be indexed) or are indexes only used
for query purposes?

Andreas

Ari Nordström | 24 Oct 10:07 2014
Picon

XProc package and xsl:formatter step problem

Hi all,

Me again, testing the XProc package in eXist and hoping that Dmitriy and others can help.

I'm trying to run a pipeline to output PDF using XEP as the formatting engine. The xsl:formatter step looks like this:

    <!-- PDF output from FO -->
    <p:xsl-formatter content-type="application/pdf" name="cos-fo">
        <p:input port="source">
            <p:pipe port="result" step="xml2fo"/>
        </p:input>
        <p:with-option name="href" select="$pdf"/>
        <p:with-param name="CONFIG" select="'xmldb:exist:///db/xep.xml'">
            <p:empty/>
        </p:with-param>
        <p:input port="parameters">
            <p:empty/>
        </p:input>
    </p:xsl-formatter>

The XQ looks like this:

xquery version "1.0";
import module namespace xproc="http://exist-db.org/xproc";

let $opts2 := (<input type="xml" port="document" url="http://localhost:8080/exist/rest/db/work/docs/pdftest/test-root.xml"/>,
<input type="xml" port="stylesheet" url="http://localhost:8080/exist/rest/db/work/system/cosml/fo/cos-fo-internal.xsl"/>,
<input type="xml" port="stylesheet-norm" url="xmldb:exist:///db/work/system/cosml/xslt/normalize-2.xsl"/>,
<option name="normalized" value="xmldb:exist:///db/work/tests/normalized-test.xml"/>,
<option name="pdf" value="xmldb:exist:///db/work/tests/pdftest-out.pdf"/>)

let $result := xproc:process('xmldb:exist:///db/work/system/cosml/xproc/publish-cosml-pdf.xpl',$opts2)
return
   $result

The pipeline basically normalises a modularised XML file using an XSLT, converts it to FO using another, and finally uses XEP to output PDF. The $pdf option, above, is what's interesting here and tells xsl:formatter where to save the PDF, but when I run the above, I get

exerr:ERROR Don't know how to write p:xsl-formatter output to xmldb:exist:///db/work/tests/pdftest-out.pdf [at line 10, column 16]

If I comment out the xsl:formatter step, the rest of the pipeline does what it's supposed to without a problem. I get a nice FO file.

I've confirmed that XEP is correctly configured in eXist by following Wolfgang's instructions in http://en.wikibooks.org/wiki/XQuery/Generating_PDF_from_XSL-FO_files#Instructions_for_RenderX.

It would seem that the problem is either in the XProc package or in Calabash. If memory serves, Calabash did have a problem with handling URLs in some earlier versions, and I think Jim Fuller ran into this when he updated his Calabash eXist module for my XML Prague presentation earlier this year. He had to do a custom Calabash JAR for me.

I don't know if this is what I'm seeing now, but I remember that Norm Walsh mentioned a fix somebody had done or meant to do and push to git.

Best regards,

/Ari
------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Alexander Henket | 23 Oct 21:23 2014
Picon
Picon

Orbeon session / eXist-db session

Hi,

We use Orbeon on top of eXist for all sorts of reasons. When I need something from eXist that requires credentials I can normally pass them as part of the submission:

<xforms:submission id="get-user-details-submission" serialization="none" method="get" resource="{$art-exist}/modules/get-user.xquery?user={instance('user-navigation')}" replace="instance" instance="user-details" xxforms:username="{xxforms:get-session-attribute('username')}" xxforms:password="{xxforms:get-session-attribute('password')}"/>

However when I need to access privileged stuff that triggers a download there's nothing I can think of that would work:

<xforms:load resource="{$decor-external-exist}/GetZippedDownload?account={instance('selected-account')}" show="new"/>

Using a submission would not work as I can only place results in an instance. Downloading instance contents should be supported but doesn't work in our version, but mostly it is just inefficient.

Anybody here that would know how to pass session context from Orbeon to eXist-db?

Thanks

Alexander Henket

------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Andreas Jung | 23 Oct 16:18 2014

Concurrency


Hi there,

I am experimenting with Apachebench in order to get some performance
numbers about execution times of xquery scripts. I am under the
impression that all requests are serialized and I can not detect any
concurrent execution of scripts. This is a general limitation
of eXist-db itself or a configuration option of Jetty?

Andreas
Ari Nordström | 23 Oct 14:13 2014
Picon

XProc and xmldb:exist weirdness with restored XML

Hi all,

Hoping that someone can explain this...

I've been testing the XProc package using eXist 2.1 and this very simple pipeline:

<p:declare-step xmlns:c="http://www.w3.org/ns/xproc-step" xmlns:p="http://www.w3.org/ns/xproc" version="1.0">
    <p:input port="source"/>
    <p:output port="result" sequence="true"/>
    <p:identity/>
</p:declare-step>

I've run it from eXide using this XQ:

xquery version "1.0";
import module namespace xproc="http://exist-db.org/xproc";

let $opts2 := (<input type="xml" port="source" url="xmldb:exist:///db/work/docs/test/test-2.xml"/>)

let $result := xproc:process("xmldb:exist:///db/work/tests/xproc/simple-test.xpl",$opts2)
return
   $result

For any XML I've created in that db and pointed out with <at> url, above, the <p:identity/> step outputs the XML without a problem.

But I also did a partial restore from another eXist instance backup to get more XML examples, and whenever I point out one of the restored XML files in <at> url using an xmldb:exist path, I get

<exception><path>/db/work/tests/xq/simple-test.xq</path><message>exerr:ERROR XProc error err:XD0011 [at line 6, column 16]</message></exception>

However, if I use http instead (http://localhost:8080/exist/rest/db/work/docs/test/restored.xml rather than xmldb:exist:///db/work/docs/test/restored.xml), the pipeline outputs the XML.

Does anyone have an idea of what's going on?

Best regards,

Ari
------------------------------------------------------------------------------
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Alexander Henket | 23 Oct 10:11 2014
Picon
Picon

eXist-db on OSX without Java 1.6

Hi,

I run OSX. When you do not have Java 1.6 installed (as is the default nowadays) I cannot use the eXist-db.app
because OSX claims I need to install Java 1.6 first. Started from the command line it just picks up Java 7 or 8
depending on what I have installed.

Is there anything that could be done in the eXist-db.app so it works the same as on the command line? I would
like to stop installing Java 1.6 as it is not maintained anymore.

Regards

Alexander Henket
------------------------------------------------------------------------------
John Preimonas | 23 Oct 04:14 2014
Picon

Cannot access instance data

Hi, I am completely lost here. I have an instance in an Xquery as follows:
<xf:instance id="return-status" xmlns="" >
<data>
<club-complete>false</club-complete>
.....
</data>
</xf:instance>
Later in the Xform I am trying to do this
{if (club-complete = 'true' then
( return
<xf:trigger>
<xf:label>SUBMIT</xf:label>
<xf:action ev:event="DOMActive">
<xf:send submission="save-current-return"/>
<xf:send submission="save-club-details"/>
</xf:action>
</xf:trigger>
) else ()
}
</body>

But it does not work. I have tried 
Instance('return-status')/club-complete and other combinations but I am always unsuccessful.
What do I need to do to retrieve an internal Boolean instance inside an Xquery?
Thanks
John

Sent from my iPhone
------------------------------------------------------------------------------
Loren Cahlander | 22 Oct 16:16 2014
Picon

Re: XProc module's Calabash location and version?

Dmitriy,

The version of XML Calabash has changed to 1.0.21.  What tests do you run against the library?  I can do it.


Here is something interesting from the change log for calabash:

Changes in XML Calabash 1.0.14

There is no spoon. XML Calabash 1.0.14 was never released.


Cheers,
Loren

On Oct 22, 2014, at 10:10 AM, Dmitriy Shabanov <shabanovd <at> gmail.com> wrote:

Hi Ari,

Extension code here https://github.com/eXist-db/eXist-XMLCalabash and it base on 

<groupId>com.xmlcalabash</groupId>
<artifactId>xmlcalabash-saxon94</artifactId>
<version>1.0.14-SNAPSHOT</version>

On Wed, Oct 22, 2014 at 5:57 PM, Ari Nordström <ari.nordstrom <at> gmail.com> wrote:
I've been testing the XProc XMLCalabash module by Dmitriy Shabanov. I think I've got the hang of running it, mostly, but what I don't understand--and can't find any answers to in the documentation or in the module's Github pages--is what version of Calabash the module is running, and where the Calabash JAR is located. $EXIST_HOME/extensions/modules/lib/, does not include it even though that's what the readme says; the readme seems to be to Jim Fuller's old Calabash module rather than this one.

What am I missing? I'd like to be able to update Calabash when new versions are released.

--
Dmitriy Shabanov
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Ari Nordström | 22 Oct 15:57 2014
Picon

XProc module's Calabash location and version?

Hi all,

I've been testing the XProc XMLCalabash module by Dmitriy Shabanov. I think I've got the hang of running it, mostly, but what I don't understand--and can't find any answers to in the documentation or in the module's Github pages--is what version of Calabash the module is running, and where the Calabash JAR is located. $EXIST_HOME/extensions/modules/lib/, does not include it even though that's what the readme says; the readme seems to be to Jim Fuller's old Calabash module rather than this one.

What am I missing? I'd like to be able to update Calabash when new versions are released.

Best regards,

Ari Nordström
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open
Efraim Feinstein | 22 Oct 06:27 2014
Picon

Stack trace in try/catch?

Hi,

If I catch an exception in XQuery code using try/catch, is there any way I can get the full stack trace within the XQuery?

Use case: I would like to catch an exception, log that the exception occurred to a document within the database, then rethrow the exception. When I rethrow the exception, I want it to contain the original stack trace as part of the message, so I can send back more than the position of the error() function within the catch block.

Thanks,
-Efraim  
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Exist-open mailing list
Exist-open <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/exist-open

Gmane