You can subscribe to this list here.
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(8) |
Sep
(4) |
Oct
(1) |
Nov
(5) |
Dec
(16) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2012 |
Jan
(4) |
Feb
|
Mar
(14) |
Apr
|
May
|
Jun
(1) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(19) |
2013 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
(6) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(13) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Peter W. <pet...@ke...> - 2012-12-16 11:53:07
|
Thank you Wolfgang. It was the functions panel that helped me confirm where I think the issue lies. Anyway I'll update to 2.0RC and test the effect of that and report back. Peter > Hi, > > it is difficult to suggest optimizations without seeing the code, but very often there's just one bottleneck somewhere which slows down everything. In addition to the index usage information, it might be helpful to look at the functions panel in the profiler. Can you identify further bottlenecks there or is the problem really in the comparisons indicated in the index usage panel? If value comparisons are the bottleneck there might be a bad optimization on the eXist side as well, which would be interesting to check. > > In any case I would recommend to first update to the 2.0RC (available via the sourceforge project page). A lot of issues have been fixed since the tech preview. > > If you can't figure out the bottleneck, I'll be happy to have a look at it if I had some sample data and queries (you can also send me something off list). > > Wolfgang > > > Am Samstag, 15. Dezember 2012 um 06:42 schrieb Peter Watson: > >> Hi >> >> I'm not sure where I should pose this question, but here goes. I'm >> producing cross-tabulation data from an XML TEI database using eXist 2.0 >> tech preview version 15855. Using XQuery I produce data in the the form >> of .gml files for use in external programs such as nodeXL and matrix >> explorer. The data is in the form of nodes and edges/tuples for >> production of graphs. I can take this data and transform the >> edges/tuples directly into tables using XQuery and simpe html. These >> tables are effectively matrices say 25 x 100. My problem is that the >> process is quite slow computationally. Looking at the query profiler >> quite a lot of the time is spent making calls to the index for what are >> interim variables where no index is available. My question is where to >> look for information that will help me improve my code/approach or take >> any other measure that would speed up the process. I don't have a sense >> as to how large a computation this is in terms of XQuery/eXist. Does >> anyone have experience they could share? >> >> Best wishes >> >> Peter >> >> ------------------------------------------------------------------------------ >> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial >> Remotely access PCs and mobile devices and provide instant support >> Improve your efficiency, and focus on delivering more value-add services >> Discover what IT Professionals Know. Rescue delivers >> http://p.sf.net/sfu/logmein_12329d2d >> _______________________________________________ >> eXist-TEIXML mailing list >> eXi...@li... (mailto:eXi...@li...) >> https://lists.sourceforge.net/lists/listinfo/exist-teixml > > > . > |
From: Wolfgang M. <wol...@ex...> - 2012-12-15 13:19:20
|
Hi, it is difficult to suggest optimizations without seeing the code, but very often there's just one bottleneck somewhere which slows down everything. In addition to the index usage information, it might be helpful to look at the functions panel in the profiler. Can you identify further bottlenecks there or is the problem really in the comparisons indicated in the index usage panel? If value comparisons are the bottleneck there might be a bad optimization on the eXist side as well, which would be interesting to check. In any case I would recommend to first update to the 2.0RC (available via the sourceforge project page). A lot of issues have been fixed since the tech preview. If you can't figure out the bottleneck, I'll be happy to have a look at it if I had some sample data and queries (you can also send me something off list). Wolfgang Am Samstag, 15. Dezember 2012 um 06:42 schrieb Peter Watson: > > Hi > > I'm not sure where I should pose this question, but here goes. I'm > producing cross-tabulation data from an XML TEI database using eXist 2.0 > tech preview version 15855. Using XQuery I produce data in the the form > of .gml files for use in external programs such as nodeXL and matrix > explorer. The data is in the form of nodes and edges/tuples for > production of graphs. I can take this data and transform the > edges/tuples directly into tables using XQuery and simpe html. These > tables are effectively matrices say 25 x 100. My problem is that the > process is quite slow computationally. Looking at the query profiler > quite a lot of the time is spent making calls to the index for what are > interim variables where no index is available. My question is where to > look for information that will help me improve my code/approach or take > any other measure that would speed up the process. I don't have a sense > as to how large a computation this is in terms of XQuery/eXist. Does > anyone have experience they could share? > > Best wishes > > Peter > > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d > _______________________________________________ > eXist-TEIXML mailing list > eXi...@li... (mailto:eXi...@li...) > https://lists.sourceforge.net/lists/listinfo/exist-teixml |
From: Peter W. <pet...@ke...> - 2012-12-15 06:02:31
|
Hi I'm not sure where I should pose this question, but here goes. I'm producing cross-tabulation data from an XML TEI database using eXist 2.0 tech preview version 15855. Using XQuery I produce data in the the form of .gml files for use in external programs such as nodeXL and matrix explorer. The data is in the form of nodes and edges/tuples for production of graphs. I can take this data and transform the edges/tuples directly into tables using XQuery and simpe html. These tables are effectively matrices say 25 x 100. My problem is that the process is quite slow computationally. Looking at the query profiler quite a lot of the time is spent making calls to the index for what are interim variables where no index is available. My question is where to look for information that will help me improve my code/approach or take any other measure that would speed up the process. I don't have a sense as to how large a computation this is in terms of XQuery/eXist. Does anyone have experience they could share? Best wishes Peter |
From: Wolfgang M. <wol...@ex...> - 2012-12-05 21:04:48
|
Michela, > I created a new directory in which I've uploaded my xml files and their dtd. The files are displayed correctly, but when I apply some simple functions in the Query Dialog window, the system never returns any results. Can you help? What am I doing wrong? Maybe you are missing a namespace? This is a typical beginners problems, but also happens to experienced XQuery developers sometimes. For example, TEI documents are usually in the tei namespace and you won't see any results unless you use the correct namespace declaration in your query. declare namespace tei="http://www.tei-c.org/ns/1.0"; //tei:div Wolfgang |
From: Peter S. <st...@we...> - 2012-12-05 12:36:58
|
Hello Michela, it would be great if you supplied some more information (eXist version? Trying your queries in sandbox/java admin client?) and real code so we can try to reproduce your findings. Best Peter Am 05.12.2012 um 11:19 schrieb michela donati <mic...@gm...>: > Hello to all, > > I am an Italian student in 'Humanities Computing' at the University of Pisa. > I am preparing my thesis and I would like to create a project with the support of eXist, but I've never used similar programs and I am having some difficulties: > I created a new directory in which I've uploaded my xml files and their dtd. The files are displayed correctly, but when I apply some simple functions in the Query Dialog window, the system never returns any results. Can you help? What am I doing wrong? > thank you so much > > Michela > ------------------------------------------------------------------------------ > LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial > Remotely access PCs and mobile devices and provide instant support > Improve your efficiency, and focus on delivering more value-add services > Discover what IT Professionals Know. Rescue delivers > http://p.sf.net/sfu/logmein_12329d2d_______________________________________________ > eXist-TEIXML mailing list > eXi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-teixml -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |
From: michela d. <mic...@gm...> - 2012-12-05 10:19:44
|
Hello to all, I am an Italian student in 'Humanities Computing' at the University of Pisa. I am preparing my thesis and I would like to create a project with the support of eXist, but I've never used similar programs and I am having some difficulties: I created a new directory in which I've uploaded my xml files and their dtd. The files are displayed correctly, but when I apply some simple functions in the Query Dialog window, the system never returns any results. Can you help? What am I doing wrong? thank you so much Michela |
From: Peter S. <st...@we...> - 2012-07-25 07:44:06
|
Many thanks for the replies on- and off-list. As I feared, there is not much one could cite while writing grant proposals. Hence, if anybody ever wondered whether such kind of article would be worth writing, yes, it is, please do so ;-) I for myself will try to do so as well when time permits ... All the best Peter Am 20.07.2012 um 14:43 schrieb ron...@ka...: > Hi Peter, > > I have documented some snippets of my usage of eXist in the context of > creating digital editions at my blog: <http://rvdb.wordpress.com/>. > > For what it's worth, of course: those posts are more a collection of > practical considerations or accounts of experiments, and not all are > equally eXist-oriented... > > Best, > > Ron > > > On 20/07/2012 9:41, Peter Stadler wrote: >> Friends, >> >> "do you know of any articles concernd with the creation of digital > editions based on TEI and eXist?" >> >> I was asked this question by a colleague but couldn't answer so I > forward it here. >> Best would be some journal articles but I'd be happy about any links to > Blog posts etc. as well. >> >> Many thanks and all the best >> Peter >> > > -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |
From: <ron...@ka...> - 2012-07-20 13:00:13
|
Hi Peter, I have documented some snippets of my usage of eXist in the context of creating digital editions at my blog: <http://rvdb.wordpress.com/>. For what it's worth, of course: those posts are more a collection of practical considerations or accounts of experiments, and not all are equally eXist-oriented... Best, Ron On 20/07/2012 9:41, Peter Stadler wrote: > Friends, > > "do you know of any articles concernd with the creation of digital editions based on TEI and eXist?" > > I was asked this question by a colleague but couldn't answer so I forward it here. > Best would be some journal articles but I'd be happy about any links to Blog posts etc. as well. > > Many thanks and all the best > Peter > |
From: Peter S. <st...@we...> - 2012-07-20 07:46:55
|
Friends, "do you know of any articles concernd with the creation of digital editions based on TEI and eXist?" I was asked this question by a colleague but couldn't answer so I forward it here. Best would be some journal articles but I'd be happy about any links to Blog posts etc. as well. Many thanks and all the best Peter |
From: Leif-Jöran O. <lj...@ex...> - 2012-07-18 10:48:42
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Den 2012-07-17 19:10, Peter Stadler skrev: > Dear all, > Well, we ware a fairly traditional scholarly project called Carl-Maria-von-Weber-Gesamtausgabe (collected works of C.M. von Weber) and are encoding our digital edition in TEI, storing all files in a subversion repository. Those files get then exported to eXist-db for online presentation. So, we have a strict separation between those layers since no data goes back from eXist-db to subversion. > eXist enables us to build our webapp that powers weber-gesamtausgabe.de entirely in XQuery and XSLT, provides us with a lucene full text search as well as several nice modules, e.g. the httpclient module which we use for grabbing external pages. > If you happen to be in Hamburg at DH2012, I'll presenting a poster about this project tomorrow -- come and see :-) Peter, thanks for the heads up. Yes, I will come by. Regards, Leif-Jöran -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iD8DBQFQBpSAhcIn5aVXOPIRAj/GAJ9cFmj9HS+5n9VBsYOdaCgcnm2POwCglLIe xD83xTAYpOQ8wytFbDOOZRM= =jBQy -----END PGP SIGNATURE----- |
From: Peter S. <st...@we...> - 2012-07-17 17:16:11
|
Dear all, (the original thread was started on eXist-open but I haven't introduced our project at eXist-TEIXML hence thought to cc my answer) Well, we ware a fairly traditional scholarly project called Carl-Maria-von-Weber-Gesamtausgabe (collected works of C.M. von Weber) and are encoding our digital edition in TEI, storing all files in a subversion repository. Those files get then exported to eXist-db for online presentation. So, we have a strict separation between those layers since no data goes back from eXist-db to subversion. eXist enables us to build our webapp that powers weber-gesamtausgabe.de entirely in XQuery and XSLT, provides us with a lucene full text search as well as several nice modules, e.g. the httpclient module which we use for grabbing external pages. If you happen to be in Hamburg at DH2012, I'll presenting a poster about this project tomorrow -- come and see :-) All the best Peter Am 10.07.2012 um 19:11 schrieb Palmer, Eric: > I'm really hoping others will contribute to this thread. I'd love to hear > what others are doing with eXist-db. -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |
From: Joe W. <jo...@gm...> - 2012-06-29 17:11:11
|
Hello all, See below for an announcement about a fellowship opportunity involving a TEI P5 / eXist-db project. (Apologies for cross posting.) Joe Forwarded message: > From: Martin Holmes <mh...@uv...> > To: TE...@li... > Date: Friday, June 29, 2012 12:58:05 PM > Subject: Fwd: MoEML Post-Doc opportunity > > I'm forwarding information about this Post-Doc opportunity on behalf of > Janelle Jenstad. Full details are also here: > > <http://mapoflondon.uvic.ca/opportunities.htm> > > This is a TEI P5 / eXist db project with lots of interesting encoding > and rendering issues, and would suit anyone with the appropriate > academic background and a strong interest in TEI-based online editions. > > -------- Original Message -------- > Subject: [Etcl] MoEML Post-Doc opportunity > Date: Thu, 28 Jun 2012 15:33:33 -0700 > From: Janelle Jenstad <je...@uv...> > To: et...@li... <et...@li...> > > *** Please feel free to forward either the flyer or this email. *** > > /The Map of Early Modern London/(/MoEML/) project seeks applicants for a > post-doctoral fellowship valued at $32,500 per year for up to two years. > The successful applicant will be expected to join the project on site in > Victoria, BC, and work closely with the project director, developers, > and research assistants in the next phase of /MoEML/'s development. He > or she will take a leading role in the ongoing identification of all the > features of the Agas Map (/Civitas Londinum/); textual and critical work > on the map; ongoing work on the encyclopedia of early modern streets and > sites; and the editing, markup, annotation, and creation of a critical > apparatus for a versioned edition of the 1598, 1603,1633, and modern > texts of John Stow's /A Survey of London/. The successful applicant > will also be encouraged to work on related projects, to bring his or her > particular research interests to /MoEML/, and to help shape /MoEML/'s > future. Applicants need to have a strong background in the literature > of early modern London, preferably in textual criticism, drama, > chronicle histories, civic literature, pageantry, and/or the > geohumanities. Facility with literary computing and some knowledge of > TEI are essential. Experience with editing, historical or literary GIS, > and databases is desirable. > > /MoEML/is an established project with SSHRC funding and ongoing > technical support from the Humanities Computing and Media Centre at the > University of Victoria. /MoEML/ is directed by Janelle Jenstad > (Department of English, University of Victoria), and overseen by > advisory and editorial boards. The summary from /MoEML/'s SSHRC Insight > Grant can be found at mapoflondon.uvic.ca/SSHRC2012.htm > <http://mapoflondon.uvic.ca/SSHRC2012.htm>. > > The University of Victoria is committed to providing an environment that > protects and promotes the human rights of all persons and and affirms > the dignity of all persons. /MoEML/ is committed to honouring the > Collaborators' Bill of Rights > <http://mediacommons.futureofthebook.org/mcpress/offthetracks/part-one-models-for-collaboration-career-paths-acquiring-institutional-support-and-transformation-in-the-field/a-collaboration/collaborators%E2%80%99-bill-of-rights/>. > > > > Enquiries and applications may be sent to /MoEML /via Janelle Jenstad at > je...@uv... <mailto:je...@uv...>. Electronic application > packages should include a statement of relevant experience, a full CV, > reference letters (or the names of referees), and links to the > applicant's projects and publications. All applications received by > *July 17, 2012* will be acknowledged. Interviews will be conducted via > Skype the following week. > > Dr. Janelle Jenstad, Associate Professor, English, UVic > > 250-721-7245; CLE C327 > > General Editor, /The Map of Early Modern London <mapoflondon.uvic.ca>/ > > Assistant Coordinating Editor, Internet Shakespeare Editions > <internetshakespeare.uvic.ca> > > |
From: Christopher T. <chr...@ca...> - 2012-03-19 09:19:09
|
Hi Joe, Thanks for the advice about namespaces - I will keep your troubleshooting statistics in mind as I continue with this project. If all goes well hopefully I will have a working website by the time that anniversary comes around :) Cheers, Chris On 18/03/12 6:04 AM, Joe Wicentowski wrote: > Hi Chris, > >> Thanks again for your help on this, and to Joe for setting up this list for newbies like me. > I'm so happy to hear that you, together with Martin and Peter, have > found a solution! Since I didn't participate in the discussion (work > busy-ness + a bad cold), let me offer some reflections: > > First, Chris, you're graduating to a really exciting level of XQuery > development sophistication. You're putting commonly used application > logic into functions and moving those functions into library modules. > This isolates the code, centralizes the functions, and makes the code > more portable, more reusable, and much easier to test. Your function > takes an entire TEI document as an argument, and thus it can be used > on any TEI document in your database, now or as you add new documents. > If your TEI document structure changes in the future, you only have > to modify this one function to ensure your application runs as before. > > Second, namespaces were central to resolving the problem. My rule is > that if I write a query and get nothing instead of the expected > result, namespace problems are the cause of the problem 90% of the > time. If I check the XPath and the assumptions in the logic, and > everything still looks right, that 90% rises to 99%. This isn't to > say that namespaces are evil; they're essential, but require > annoyingly absolute precision. > > Third, default namespaces. Declaring a default element namespace can > be very handy, particularly if all inputs and outputs are in the same > namespace and no elements are in the empty namespace. But in my > experience, I often find myself removing such declarations. Declaring > TEI or HTML as the default makes it difficult to address empty > namespaces ( *:foo is a kludge and not good for performance), and in > my applications I almost always mix TEI, HTML, and empty namespaced > nodes. But absolutely, do try it out and keep this technique in your > arsenal, but I personally find it of use in marginal circumstances. > > Finally, this list will have its first anniversary in a few months! > It'll be an opportunity for us to reflect on what we've learned this > year, and on what we can do looking ahead. > > Thanks and best wishes to you all, > Joe |
From: Joe W. <jo...@gm...> - 2012-03-17 17:20:21
|
Hi Peter, >> There is a very useful blog by Joe Wicentowski on transforming text into >> XML which you can find at >> http://joewiz.posterous.com/an-under-appreciated-use-for-xquery-wrangling. Thanks for sharing the post! I should've mentioned it here before. I think it could be useful to many TEI projects that require importing data from non-XML formats that use "flat text" to represent distinct structural/semantic features (e.g., tabs representing list levels, and numbers indicating footnote texts), whereas in TEI we use explicit tags to indicate these features. Processing flat text to identify these features and translate them into TEI can be challenging but also rewarding. >> As I have quite a lot of this to do, I started experimenting, and my >> effort is shown below. This successfully achieves a basic >> transformation of nearly 200 pages of text with footnotes at the bottom >> of each page and headers at the top. Wow, 200 pages! That's great. > Ok, I think I may have a solution to the problem of moving the notes to the > correct position in the text. After much experimentation, the only way I > could find to sort out what turned out to be a context problem was to move > to the typeswitch function. Now for the paragraphs! Excellent. Nice work! I think the technique illustrated in the blog post could definitely be extended to deal with many flat text features. The trick is in getting the "pipeline" correct: the steps need to be executed in the right order so that each feature is captured correctly. Keep us posted, Joe |
From: Joe W. <jo...@gm...> - 2012-03-17 17:05:23
|
Hi Chris, > Thanks again for your help on this, and to Joe for setting up this list for newbies like me. I'm so happy to hear that you, together with Martin and Peter, have found a solution! Since I didn't participate in the discussion (work busy-ness + a bad cold), let me offer some reflections: First, Chris, you're graduating to a really exciting level of XQuery development sophistication. You're putting commonly used application logic into functions and moving those functions into library modules. This isolates the code, centralizes the functions, and makes the code more portable, more reusable, and much easier to test. Your function takes an entire TEI document as an argument, and thus it can be used on any TEI document in your database, now or as you add new documents. If your TEI document structure changes in the future, you only have to modify this one function to ensure your application runs as before. Second, namespaces were central to resolving the problem. My rule is that if I write a query and get nothing instead of the expected result, namespace problems are the cause of the problem 90% of the time. If I check the XPath and the assumptions in the logic, and everything still looks right, that 90% rises to 99%. This isn't to say that namespaces are evil; they're essential, but require annoyingly absolute precision. Third, default namespaces. Declaring a default element namespace can be very handy, particularly if all inputs and outputs are in the same namespace and no elements are in the empty namespace. But in my experience, I often find myself removing such declarations. Declaring TEI or HTML as the default makes it difficult to address empty namespaces ( *:foo is a kludge and not good for performance), and in my applications I almost always mix TEI, HTML, and empty namespaced nodes. But absolutely, do try it out and keep this technique in your arsenal, but I personally find it of use in marginal circumstances. Finally, this list will have its first anniversary in a few months! It'll be an opportunity for us to reflect on what we've learned this year, and on what we can do looking ahead. Thanks and best wishes to you all, Joe |
From: Peter W. <pet...@ke...> - 2012-03-15 21:32:07
|
Ok, I think I may have a solution to the problem of moving the notes to the correct position in the text. After much experimentation, the only way I could find to sort out what turned out to be a context problem was to move to the typeswitch function. Now for the paragraphs! Peter On 15/03/2012 10:49, Peter Watson wrote: > Hi > There is a very useful blog by Joe Wicentowski on transforming text into > XML which you can find at > http://joewiz.posterous.com/an-under-appreciated-use-for-xquery-wrangling. > As I have quite a lot of this to do, I started experimenting, and my > effort is shown below. This successfully achieves a basic > transformation of nearly 200 pages of text with footnotes at the bottom > of each page and headers at the top. Incidentally it is useful to look > at the text, with code revealed, eg in Word as this shows what is likely > to work best when tokenizing. I run into problems when I try to replace > specially marked note numbers in the text with the associated notes (I > tried using following-sibling::note and matching the numbers without > success) and also what to do about amalgating paragraphs crossing page > breaks. Again I can see what might work reasonably well, eg paras > starting with lower case after page breaks but I'm not sure how set out > the XQuery to get there. Maybe I'll need to revert to manual from this > point, but would be grateful to hear from anyone who has suggestions as > to how I might proceed. > > Thanks > > Peter > > xquery version "1.0"; > declare function local:transform-block($block) > { > (:To replace the note number in the text with a more identifiable marker:) > let $text-with-marked-note-number := replace($block, > '\s(\d)\s|\s(\d)$',' XXX$1$2 ') > (:The next two lines replace the page headers with<pb/>:) > return if (matches($text-with-marked-note-number, "THE OKEOVERS OF > OKEOVER.*")) then<pb/> > else if (matches($text-with-marked-note-number, "\dTHE OKEOVERS OF > OKEOVER")) then<pb/> > (:To identify footnotes and markup accordingly:) > else if (matches($text-with-marked-note-number,'^\d\s')) then > <note>{$text-with-marked-note-number}</note> > (:Everything else marked up as element p:) > else<p>{$text-with-marked-note-number}</p> > }; > > let $file := doc('chsokeover.txt')/root > (:Text tokenised on the basis of 3 carriage returns/spaces:) > let $content :=tokenize($file, '\s{3,}') return > <root> > <head>The Okeovers of Okeover.</head> > {for $block in $content > (:Sends the tokenized text to be transformed:) > let $result := local:transform-block($block) > return $result} > </root> > > ------------------------------------------------------------------------------ > This SF email is sponsosred by: > Try Windows Azure free for 90 days Click Here > http://p.sf.net/sfu/sfd2d-msazure > _______________________________________________ > eXist-TEIXML mailing list > eXi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-teixml > . > |
From: Peter W. <pet...@ke...> - 2012-03-15 10:49:38
|
Hi There is a very useful blog by Joe Wicentowski on transforming text into XML which you can find at http://joewiz.posterous.com/an-under-appreciated-use-for-xquery-wrangling. As I have quite a lot of this to do, I started experimenting, and my effort is shown below. This successfully achieves a basic transformation of nearly 200 pages of text with footnotes at the bottom of each page and headers at the top. Incidentally it is useful to look at the text, with code revealed, eg in Word as this shows what is likely to work best when tokenizing. I run into problems when I try to replace specially marked note numbers in the text with the associated notes (I tried using following-sibling::note and matching the numbers without success) and also what to do about amalgating paragraphs crossing page breaks. Again I can see what might work reasonably well, eg paras starting with lower case after page breaks but I'm not sure how set out the XQuery to get there. Maybe I'll need to revert to manual from this point, but would be grateful to hear from anyone who has suggestions as to how I might proceed. Thanks Peter xquery version "1.0"; declare function local:transform-block($block) { (:To replace the note number in the text with a more identifiable marker:) let $text-with-marked-note-number := replace($block, '\s(\d)\s|\s(\d)$',' XXX$1$2 ') (:The next two lines replace the page headers with <pb/>:) return if (matches($text-with-marked-note-number, "THE OKEOVERS OF OKEOVER.*")) then <pb/> else if (matches($text-with-marked-note-number, "\dTHE OKEOVERS OF OKEOVER")) then <pb/> (:To identify footnotes and markup accordingly:) else if (matches($text-with-marked-note-number,'^\d\s')) then <note>{$text-with-marked-note-number}</note> (:Everything else marked up as element p:) else <p>{$text-with-marked-note-number}</p> }; let $file := doc('chsokeover.txt')/root (:Text tokenised on the basis of 3 carriage returns/spaces:) let $content :=tokenize($file, '\s{3,}') return <root> <head>The Okeovers of Okeover.</head> {for $block in $content (:Sends the tokenized text to be transformed:) let $result := local:transform-block($block) return $result} </root> |
From: Christopher T. <chr...@ca...> - 2012-03-15 02:47:44
|
Hi Peter, Thank you so much for finding the problem - it's working! The trailing slash has got me before when copying files from place to place, but I guess I just couldn't see it in the namespace after staring at it for hours :) Now I can develop that module properly. I will also take your advice on declaring a default namespace for xhtml which is a good idea. Thanks again for your help on this, and to Joe for setting up this list for newbies like me. Cheers, Chris ________________________________________ From: Peter Stadler [st...@we...] Sent: 14 March 2012 23:26 To: Christopher Thomson; exist-teixml Subject: Re: [eXist-TEIXML] passing arguments to XQuery functions Ok, that's been a hard one! But it's always about namespaces ;-) The TEI namespace declaration in your module has a superfluous trailing slash. By the way, I tried on eXist 1.4.1 where the inserted "p" node (from the bibl module) will have an empty namespace declaration in the result. You can avoid this by declaring a default namespace (both in your module and the main query and hence remove the namespace from your root html element): declare default element namespace "http://www.w3.org/1999/xhtml"; All the best Peter Am 14.03.2012 um 10:41 schrieb Christopher Thomson: > Hi, > > The double slash seems to make no difference I'm afraid. I've used the eXist sandbox to verify the function works if I point it directly at one of my TEI files. The result in the webpage is that I see the separator ' - ' but no values for date of birth or death, which also suggests that $doc doesn't make it to the function. > > Also, the functions you see that add CSS and header text work fine - I assume because they don't contain expressions or pass an argument from the main query. Any help you could offer would be great! > > Here is the main query: http://snipt.org/ufiS3 > Here is the function in question: http://snipt.org/ufiQ1 > > Regards, > Chris > > > On 13/03/12 11:16 PM, Peter Stadler wrote: >> Maybe you're passing a document-node() to your module? >> Can you try with a double slash after your $doc, e.g. $doc//tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() >> and/or make it explicit via >> declare function bibl:dob($doc as document-node()) as element() {...} >> >> Anyhow, I think we would need to see the whole files to be able to say more ... >> >> All the best >> Peter >> >> Am 13.03.2012 um 10:58 schrieb Christopher Thomson: >> >>> Hi Martin, >>> >>> I'm not using<listPerson> as I believe<person> can be used directly in >>> <particDesc>. Each entry in the annotated bibliography I'm working on is >>> about a single author so I'll only have one<person> element per >>> header. An extra slash after the $doc variable doesn't seem to make any >>> difference either, unfortunately. >>> >>> I find I can get the code working in my main query, but as soon as I >>> move it to the module and call it using { bibl:dob($doc) } it no longer >>> works. However, functions declared in bibl.xqm do work when they >>> contain no XQuery expressions but only HTML and boilerplate text. This >>> leads me to believe there's a problem with passing the argument $doc to >>> the function held in bibl.xqm. >>> >>> This slightly more sophisticated version below returns dates of birth as >>> a FLWOR expression within the main query. But, declared as a function >>> in the module and called in the main query it no longer returns anything. >>> >>> declare function bibl:dob($doc) { >>> let $dob := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() >>> let $dod := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:death/text() >>> let $dob-separator := ' - ' >>> return >>> if (exists($dod)) then (<p>{concat($dob, $dob-separator, >>> $dod)}</p>) >>> else (<p>{concat($dob, $dob-separator)}</p>) >>> }; >>> >>> Any other ideas? Thanks for your help so far. >>> >>> Cheers, >>> Chris >>> >>> >>> On 13/03/12 1:51 AM, Martin Holmes wrote: >>>> Hi there, >>>> >>>> Should your path include<listPerson>? >>>> >>>> tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... >>>> >>>> >>>> Or do you need an extra slash after the doc root: >>>> >>>> let $dob := $doc//tei:teiHeader >>>> >>>> (the document root is not necessarily the same as the root XML element.) >>>> >>>> Cheers, >>>> Martin >>>> >>>> On 12-03-11 10:26 PM, Christopher Thomson wrote: >>>>> Thanks for your reply. My bibl.xqm module starts like this: >>>>> >>>>> xquery version "1.0"; >>>>> >>>>> module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>>> >>>>> declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>>> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >>>>> declare namespace tei = "http://www.tei-c.org/ns/1.0/"; >>>>> >>>>> I then import this module into the query where the function is called. I >>>>> think declaring the bibl namespace in the module is unnecessary, but >>>>> I've been trying various things to get this working, and it doesn't >>>>> produce an error. >>>>> >>>>> Cheers, >>>>> Chris >>>>> >>>>> >>>>> On 12/03/12 12:16 PM, Martin Holmes wrote: >>>>>> Do you have the tei: prefix correctly declared in your bibl.xqm module? >>>>>> >>>>>> Cheers, >>>>>> Martin >>>>>> >>>>>> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>>>>>> I am creating an module to hold commonly used XQuery expressions as >>>>>>> functions. $doc defines the document in my collection of TEI files, >>>>>>> and >>>>>>> the following returns a date of birth in the desired way: >>>>>>> >>>>>>> *<div id="sidebar" class="span-6"> >>>>>>> <h3><b>{$fullname}</b></h3> >>>>>>> >>>>>>> let $dob := >>>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>>> return<p>{$dob/text()}</p> >>>>>>> </div>* >>>>>>> >>>>>>> Next, I move this code to a function in a module in the namespace >>>>>>> bibl. >>>>>>> The above div becomes: >>>>>>> >>>>>>> *<div id="sidebar" class="span-6"> >>>>>>> <h3><b>{$fullname}</b></h3> >>>>>>> >>>>>>> { bibl:dob($doc) } >>>>>>> </div>* >>>>>>> >>>>>>> The function is declared in the bibl.xqm module thus: >>>>>>> >>>>>>> *declare function bibl:dob($doc) { >>>>>>> let $dob := >>>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>>> return<p>{$dob/text()}</p> >>>>>>> };* >>>>>>> >>>>>>> This arrangement does not return the date of birth to the resulting >>>>>>> web >>>>>>> page. Does anyone see where the error is here? I have assumed the $doc >>>>>>> argument will be passed from the main page to the function in the bibl >>>>>>> module. 'bibl' is imported into the main page and seems to be defined >>>>>>> correctly as a module. >>>>>>> >>>>>>> Thanks, >>>>>>> Chris >>>>>>> -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de This email may be confidential and subject to legal privilege, it may not reflect the views of the University of Canterbury, and it is not guaranteed to be virus free. If you are not an intended recipient, please notify the sender immediately and erase all copies of the message and any attachments. Please refer to http://www.canterbury.ac.nz/emaildisclaimer for more information. |
From: Peter S. <st...@we...> - 2012-03-14 10:26:42
|
Ok, that's been a hard one! But it's always about namespaces ;-) The TEI namespace declaration in your module has a superfluous trailing slash. By the way, I tried on eXist 1.4.1 where the inserted "p" node (from the bibl module) will have an empty namespace declaration in the result. You can avoid this by declaring a default namespace (both in your module and the main query and hence remove the namespace from your root html element): declare default element namespace "http://www.w3.org/1999/xhtml"; All the best Peter Am 14.03.2012 um 10:41 schrieb Christopher Thomson: > Hi, > > The double slash seems to make no difference I'm afraid. I've used the eXist sandbox to verify the function works if I point it directly at one of my TEI files. The result in the webpage is that I see the separator ' - ' but no values for date of birth or death, which also suggests that $doc doesn't make it to the function. > > Also, the functions you see that add CSS and header text work fine - I assume because they don't contain expressions or pass an argument from the main query. Any help you could offer would be great! > > Here is the main query: http://snipt.org/ufiS3 > Here is the function in question: http://snipt.org/ufiQ1 > > Regards, > Chris > > > On 13/03/12 11:16 PM, Peter Stadler wrote: >> Maybe you're passing a document-node() to your module? >> Can you try with a double slash after your $doc, e.g. $doc//tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() >> and/or make it explicit via >> declare function bibl:dob($doc as document-node()) as element() {...} >> >> Anyhow, I think we would need to see the whole files to be able to say more ... >> >> All the best >> Peter >> >> Am 13.03.2012 um 10:58 schrieb Christopher Thomson: >> >>> Hi Martin, >>> >>> I'm not using<listPerson> as I believe<person> can be used directly in >>> <particDesc>. Each entry in the annotated bibliography I'm working on is >>> about a single author so I'll only have one<person> element per >>> header. An extra slash after the $doc variable doesn't seem to make any >>> difference either, unfortunately. >>> >>> I find I can get the code working in my main query, but as soon as I >>> move it to the module and call it using { bibl:dob($doc) } it no longer >>> works. However, functions declared in bibl.xqm do work when they >>> contain no XQuery expressions but only HTML and boilerplate text. This >>> leads me to believe there's a problem with passing the argument $doc to >>> the function held in bibl.xqm. >>> >>> This slightly more sophisticated version below returns dates of birth as >>> a FLWOR expression within the main query. But, declared as a function >>> in the module and called in the main query it no longer returns anything. >>> >>> declare function bibl:dob($doc) { >>> let $dob := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() >>> let $dod := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:death/text() >>> let $dob-separator := ' - ' >>> return >>> if (exists($dod)) then (<p>{concat($dob, $dob-separator, >>> $dod)}</p>) >>> else (<p>{concat($dob, $dob-separator)}</p>) >>> }; >>> >>> Any other ideas? Thanks for your help so far. >>> >>> Cheers, >>> Chris >>> >>> >>> On 13/03/12 1:51 AM, Martin Holmes wrote: >>>> Hi there, >>>> >>>> Should your path include<listPerson>? >>>> >>>> tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... >>>> >>>> >>>> Or do you need an extra slash after the doc root: >>>> >>>> let $dob := $doc//tei:teiHeader >>>> >>>> (the document root is not necessarily the same as the root XML element.) >>>> >>>> Cheers, >>>> Martin >>>> >>>> On 12-03-11 10:26 PM, Christopher Thomson wrote: >>>>> Thanks for your reply. My bibl.xqm module starts like this: >>>>> >>>>> xquery version "1.0"; >>>>> >>>>> module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>>> >>>>> declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>>> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >>>>> declare namespace tei = "http://www.tei-c.org/ns/1.0/"; >>>>> >>>>> I then import this module into the query where the function is called. I >>>>> think declaring the bibl namespace in the module is unnecessary, but >>>>> I've been trying various things to get this working, and it doesn't >>>>> produce an error. >>>>> >>>>> Cheers, >>>>> Chris >>>>> >>>>> >>>>> On 12/03/12 12:16 PM, Martin Holmes wrote: >>>>>> Do you have the tei: prefix correctly declared in your bibl.xqm module? >>>>>> >>>>>> Cheers, >>>>>> Martin >>>>>> >>>>>> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>>>>>> I am creating an module to hold commonly used XQuery expressions as >>>>>>> functions. $doc defines the document in my collection of TEI files, >>>>>>> and >>>>>>> the following returns a date of birth in the desired way: >>>>>>> >>>>>>> *<div id="sidebar" class="span-6"> >>>>>>> <h3><b>{$fullname}</b></h3> >>>>>>> >>>>>>> let $dob := >>>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>>> return<p>{$dob/text()}</p> >>>>>>> </div>* >>>>>>> >>>>>>> Next, I move this code to a function in a module in the namespace >>>>>>> bibl. >>>>>>> The above div becomes: >>>>>>> >>>>>>> *<div id="sidebar" class="span-6"> >>>>>>> <h3><b>{$fullname}</b></h3> >>>>>>> >>>>>>> { bibl:dob($doc) } >>>>>>> </div>* >>>>>>> >>>>>>> The function is declared in the bibl.xqm module thus: >>>>>>> >>>>>>> *declare function bibl:dob($doc) { >>>>>>> let $dob := >>>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>>> return<p>{$dob/text()}</p> >>>>>>> };* >>>>>>> >>>>>>> This arrangement does not return the date of birth to the resulting >>>>>>> web >>>>>>> page. Does anyone see where the error is here? I have assumed the $doc >>>>>>> argument will be passed from the main page to the function in the bibl >>>>>>> module. 'bibl' is imported into the main page and seems to be defined >>>>>>> correctly as a module. >>>>>>> >>>>>>> Thanks, >>>>>>> Chris >>>>>>> -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |
From: Christopher T. <chr...@ca...> - 2012-03-14 09:44:08
|
Hi, The double slash seems to make no difference I'm afraid. I've used the eXist sandbox to verify the function works if I point it directly at one of my TEI files. The result in the webpage is that I see the separator ' - ' but no values for date of birth or death, which also suggests that $doc doesn't make it to the function. Also, the functions you see that add CSS and header text work fine - I assume because they don't contain expressions or pass an argument from the main query. Any help you could offer would be great! Here is the main query: http://snipt.org/ufiS3 Here is the function in question: http://snipt.org/ufiQ1 Regards, Chris On 13/03/12 11:16 PM, Peter Stadler wrote: > Maybe you're passing a document-node() to your module? > Can you try with a double slash after your $doc, e.g. $doc//tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() > and/or make it explicit via > declare function bibl:dob($doc as document-node()) as element() {...} > > Anyhow, I think we would need to see the whole files to be able to say more ... > > All the best > Peter > > Am 13.03.2012 um 10:58 schrieb Christopher Thomson: > >> Hi Martin, >> >> I'm not using<listPerson> as I believe<person> can be used directly in >> <particDesc>. Each entry in the annotated bibliography I'm working on is >> about a single author so I'll only have one<person> element per >> header. An extra slash after the $doc variable doesn't seem to make any >> difference either, unfortunately. >> >> I find I can get the code working in my main query, but as soon as I >> move it to the module and call it using { bibl:dob($doc) } it no longer >> works. However, functions declared in bibl.xqm do work when they >> contain no XQuery expressions but only HTML and boilerplate text. This >> leads me to believe there's a problem with passing the argument $doc to >> the function held in bibl.xqm. >> >> This slightly more sophisticated version below returns dates of birth as >> a FLWOR expression within the main query. But, declared as a function >> in the module and called in the main query it no longer returns anything. >> >> declare function bibl:dob($doc) { >> let $dob := >> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() >> let $dod := >> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:death/text() >> let $dob-separator := ' - ' >> return >> if (exists($dod)) then (<p>{concat($dob, $dob-separator, >> $dod)}</p>) >> else (<p>{concat($dob, $dob-separator)}</p>) >> }; >> >> Any other ideas? Thanks for your help so far. >> >> Cheers, >> Chris >> >> >> On 13/03/12 1:51 AM, Martin Holmes wrote: >>> Hi there, >>> >>> Should your path include<listPerson>? >>> >>> tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... >>> >>> >>> Or do you need an extra slash after the doc root: >>> >>> let $dob := $doc//tei:teiHeader >>> >>> (the document root is not necessarily the same as the root XML element.) >>> >>> Cheers, >>> Martin >>> >>> On 12-03-11 10:26 PM, Christopher Thomson wrote: >>>> Thanks for your reply. My bibl.xqm module starts like this: >>>> >>>> xquery version "1.0"; >>>> >>>> module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>> >>>> declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>>> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >>>> declare namespace tei = "http://www.tei-c.org/ns/1.0/"; >>>> >>>> I then import this module into the query where the function is called. I >>>> think declaring the bibl namespace in the module is unnecessary, but >>>> I've been trying various things to get this working, and it doesn't >>>> produce an error. >>>> >>>> Cheers, >>>> Chris >>>> >>>> >>>> On 12/03/12 12:16 PM, Martin Holmes wrote: >>>>> Do you have the tei: prefix correctly declared in your bibl.xqm module? >>>>> >>>>> Cheers, >>>>> Martin >>>>> >>>>> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>>>>> I am creating an module to hold commonly used XQuery expressions as >>>>>> functions. $doc defines the document in my collection of TEI files, >>>>>> and >>>>>> the following returns a date of birth in the desired way: >>>>>> >>>>>> *<div id="sidebar" class="span-6"> >>>>>> <h3><b>{$fullname}</b></h3> >>>>>> >>>>>> let $dob := >>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>> return<p>{$dob/text()}</p> >>>>>> </div>* >>>>>> >>>>>> Next, I move this code to a function in a module in the namespace >>>>>> bibl. >>>>>> The above div becomes: >>>>>> >>>>>> *<div id="sidebar" class="span-6"> >>>>>> <h3><b>{$fullname}</b></h3> >>>>>> >>>>>> { bibl:dob($doc) } >>>>>> </div>* >>>>>> >>>>>> The function is declared in the bibl.xqm module thus: >>>>>> >>>>>> *declare function bibl:dob($doc) { >>>>>> let $dob := >>>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>>> return<p>{$dob/text()}</p> >>>>>> };* >>>>>> >>>>>> This arrangement does not return the date of birth to the resulting >>>>>> web >>>>>> page. Does anyone see where the error is here? I have assumed the $doc >>>>>> argument will be passed from the main page to the function in the bibl >>>>>> module. 'bibl' is imported into the main page and seems to be defined >>>>>> correctly as a module. >>>>>> >>>>>> Thanks, >>>>>> Chris >>>>>> >> ------------------------------------------------------------------------------ >> Keep Your Developer Skills Current with LearnDevNow! >> The most comprehensive online learning library for Microsoft developers >> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, >> Metro Style Apps, more. Free future releases when you subscribe now! >> http://p.sf.net/sfu/learndevnow-d2d >> _______________________________________________ >> eXist-TEIXML mailing list >> eXi...@li... >> https://lists.sourceforge.net/lists/listinfo/exist-teixml |
From: Peter S. <st...@we...> - 2012-03-13 10:29:09
|
Maybe you're passing a document-node() to your module? Can you try with a double slash after your $doc, e.g. $doc//tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() and/or make it explicit via declare function bibl:dob($doc as document-node()) as element() {...} Anyhow, I think we would need to see the whole files to be able to say more ... All the best Peter Am 13.03.2012 um 10:58 schrieb Christopher Thomson: > Hi Martin, > > I'm not using <listPerson> as I believe <person> can be used directly in > <particDesc>. Each entry in the annotated bibliography I'm working on is > about a single author so I'll only have one <person> element per > header. An extra slash after the $doc variable doesn't seem to make any > difference either, unfortunately. > > I find I can get the code working in my main query, but as soon as I > move it to the module and call it using { bibl:dob($doc) } it no longer > works. However, functions declared in bibl.xqm do work when they > contain no XQuery expressions but only HTML and boilerplate text. This > leads me to believe there's a problem with passing the argument $doc to > the function held in bibl.xqm. > > This slightly more sophisticated version below returns dates of birth as > a FLWOR expression within the main query. But, declared as a function > in the module and called in the main query it no longer returns anything. > > declare function bibl:dob($doc) { > let $dob := > $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() > let $dod := > $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:death/text() > let $dob-separator := ' - ' > return > if (exists($dod)) then (<p>{concat($dob, $dob-separator, > $dod)}</p>) > else (<p>{concat($dob, $dob-separator)}</p>) > }; > > Any other ideas? Thanks for your help so far. > > Cheers, > Chris > > > On 13/03/12 1:51 AM, Martin Holmes wrote: >> Hi there, >> >> Should your path include <listPerson>? >> >> tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... >> >> >> Or do you need an extra slash after the doc root: >> >> let $dob := $doc//tei:teiHeader >> >> (the document root is not necessarily the same as the root XML element.) >> >> Cheers, >> Martin >> >> On 12-03-11 10:26 PM, Christopher Thomson wrote: >>> Thanks for your reply. My bibl.xqm module starts like this: >>> >>> xquery version "1.0"; >>> >>> module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>> >>> declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >>> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >>> declare namespace tei = "http://www.tei-c.org/ns/1.0/"; >>> >>> I then import this module into the query where the function is called. I >>> think declaring the bibl namespace in the module is unnecessary, but >>> I've been trying various things to get this working, and it doesn't >>> produce an error. >>> >>> Cheers, >>> Chris >>> >>> >>> On 12/03/12 12:16 PM, Martin Holmes wrote: >>>> Do you have the tei: prefix correctly declared in your bibl.xqm module? >>>> >>>> Cheers, >>>> Martin >>>> >>>> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>>>> I am creating an module to hold commonly used XQuery expressions as >>>>> functions. $doc defines the document in my collection of TEI files, >>>>> and >>>>> the following returns a date of birth in the desired way: >>>>> >>>>> *<div id="sidebar" class="span-6"> >>>>> <h3><b>{$fullname}</b></h3> >>>>> >>>>> let $dob := >>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>> return<p>{$dob/text()}</p> >>>>> </div>* >>>>> >>>>> Next, I move this code to a function in a module in the namespace >>>>> bibl. >>>>> The above div becomes: >>>>> >>>>> *<div id="sidebar" class="span-6"> >>>>> <h3><b>{$fullname}</b></h3> >>>>> >>>>> { bibl:dob($doc) } >>>>> </div>* >>>>> >>>>> The function is declared in the bibl.xqm module thus: >>>>> >>>>> *declare function bibl:dob($doc) { >>>>> let $dob := >>>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>>> return<p>{$dob/text()}</p> >>>>> };* >>>>> >>>>> This arrangement does not return the date of birth to the resulting >>>>> web >>>>> page. Does anyone see where the error is here? I have assumed the $doc >>>>> argument will be passed from the main page to the function in the bibl >>>>> module. 'bibl' is imported into the main page and seems to be defined >>>>> correctly as a module. >>>>> >>>>> Thanks, >>>>> Chris >>>>> > > ------------------------------------------------------------------------------ > Keep Your Developer Skills Current with LearnDevNow! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-d2d > _______________________________________________ > eXist-TEIXML mailing list > eXi...@li... > https://lists.sourceforge.net/lists/listinfo/exist-teixml -- Peter Stadler Carl-Maria-von-Weber-Gesamtausgabe Arbeitsstelle Detmold Gartenstr. 20 D-32756 Detmold Tel. +49 5231 975-665 Fax: +49 5231 975-668 stadler at weber-gesamtausgabe.de www.weber-gesamtausgabe.de |
From: Christopher T. <chr...@ca...> - 2012-03-13 09:58:43
|
Hi Martin, I'm not using <listPerson> as I believe <person> can be used directly in <particDesc>. Each entry in the annotated bibliography I'm working on is about a single author so I'll only have one <person> element per header. An extra slash after the $doc variable doesn't seem to make any difference either, unfortunately. I find I can get the code working in my main query, but as soon as I move it to the module and call it using { bibl:dob($doc) } it no longer works. However, functions declared in bibl.xqm do work when they contain no XQuery expressions but only HTML and boilerplate text. This leads me to believe there's a problem with passing the argument $doc to the function held in bibl.xqm. This slightly more sophisticated version below returns dates of birth as a FLWOR expression within the main query. But, declared as a function in the module and called in the main query it no longer returns anything. declare function bibl:dob($doc) { let $dob := $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth/text() let $dod := $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:death/text() let $dob-separator := ' - ' return if (exists($dod)) then (<p>{concat($dob, $dob-separator, $dod)}</p>) else (<p>{concat($dob, $dob-separator)}</p>) }; Any other ideas? Thanks for your help so far. Cheers, Chris On 13/03/12 1:51 AM, Martin Holmes wrote: > Hi there, > > Should your path include <listPerson>? > > tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... > > > Or do you need an extra slash after the doc root: > > let $dob := $doc//tei:teiHeader > > (the document root is not necessarily the same as the root XML element.) > > Cheers, > Martin > > On 12-03-11 10:26 PM, Christopher Thomson wrote: >> Thanks for your reply. My bibl.xqm module starts like this: >> >> xquery version "1.0"; >> >> module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >> >> declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; >> declare namespace exist = "http://exist.sourceforge.net/NS/exist"; >> declare namespace tei = "http://www.tei-c.org/ns/1.0/"; >> >> I then import this module into the query where the function is called. I >> think declaring the bibl namespace in the module is unnecessary, but >> I've been trying various things to get this working, and it doesn't >> produce an error. >> >> Cheers, >> Chris >> >> >> On 12/03/12 12:16 PM, Martin Holmes wrote: >>> Do you have the tei: prefix correctly declared in your bibl.xqm module? >>> >>> Cheers, >>> Martin >>> >>> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>>> I am creating an module to hold commonly used XQuery expressions as >>>> functions. $doc defines the document in my collection of TEI files, >>>> and >>>> the following returns a date of birth in the desired way: >>>> >>>> *<div id="sidebar" class="span-6"> >>>> <h3><b>{$fullname}</b></h3> >>>> >>>> let $dob := >>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>> return<p>{$dob/text()}</p> >>>> </div>* >>>> >>>> Next, I move this code to a function in a module in the namespace >>>> bibl. >>>> The above div becomes: >>>> >>>> *<div id="sidebar" class="span-6"> >>>> <h3><b>{$fullname}</b></h3> >>>> >>>> { bibl:dob($doc) } >>>> </div>* >>>> >>>> The function is declared in the bibl.xqm module thus: >>>> >>>> *declare function bibl:dob($doc) { >>>> let $dob := >>>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>>> return<p>{$dob/text()}</p> >>>> };* >>>> >>>> This arrangement does not return the date of birth to the resulting >>>> web >>>> page. Does anyone see where the error is here? I have assumed the $doc >>>> argument will be passed from the main page to the function in the bibl >>>> module. 'bibl' is imported into the main page and seems to be defined >>>> correctly as a module. >>>> >>>> Thanks, >>>> Chris >>>> |
From: Martin H. <mh...@uv...> - 2012-03-12 12:52:13
|
Hi there, Should your path include <listPerson>? tei:teiHeader/tei:profileDesc/tei:particDesc/tei:listPerson/tei:person/... Or do you need an extra slash after the doc root: let $dob := $doc//tei:teiHeader (the document root is not necessarily the same as the root XML element.) Cheers, Martin On 12-03-11 10:26 PM, Christopher Thomson wrote: > Thanks for your reply. My bibl.xqm module starts like this: > > xquery version "1.0"; > > module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; > > declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; > declare namespace exist = "http://exist.sourceforge.net/NS/exist"; > declare namespace tei = "http://www.tei-c.org/ns/1.0/"; > > I then import this module into the query where the function is called. I > think declaring the bibl namespace in the module is unnecessary, but > I've been trying various things to get this working, and it doesn't > produce an error. > > Cheers, > Chris > > > On 12/03/12 12:16 PM, Martin Holmes wrote: >> Do you have the tei: prefix correctly declared in your bibl.xqm module? >> >> Cheers, >> Martin >> >> On 12-03-11 12:27 PM, Christopher Thomson wrote: >>> I am creating an module to hold commonly used XQuery expressions as >>> functions. $doc defines the document in my collection of TEI files, and >>> the following returns a date of birth in the desired way: >>> >>> *<div id="sidebar" class="span-6"> >>> <h3><b>{$fullname}</b></h3> >>> >>> let $dob := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>> return<p>{$dob/text()}</p> >>> </div>* >>> >>> Next, I move this code to a function in a module in the namespace bibl. >>> The above div becomes: >>> >>> *<div id="sidebar" class="span-6"> >>> <h3><b>{$fullname}</b></h3> >>> >>> { bibl:dob($doc) } >>> </div>* >>> >>> The function is declared in the bibl.xqm module thus: >>> >>> *declare function bibl:dob($doc) { >>> let $dob := >>> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >>> return<p>{$dob/text()}</p> >>> };* >>> >>> This arrangement does not return the date of birth to the resulting web >>> page. Does anyone see where the error is here? I have assumed the $doc >>> argument will be passed from the main page to the function in the bibl >>> module. 'bibl' is imported into the main page and seems to be defined >>> correctly as a module. >>> >>> Thanks, >>> Chris >>> |
From: Christopher T. <chr...@ca...> - 2012-03-12 05:26:48
|
Thanks for your reply. My bibl.xqm module starts like this: xquery version "1.0"; module namespace bibl = "www.example.org.nz/ns/xquery/bibl"; declare namespace bibl = "www.example.org.nz/ns/xquery/bibl"; declare namespace exist = "http://exist.sourceforge.net/NS/exist"; declare namespace tei = "http://www.tei-c.org/ns/1.0/"; I then import this module into the query where the function is called. I think declaring the bibl namespace in the module is unnecessary, but I've been trying various things to get this working, and it doesn't produce an error. Cheers, Chris On 12/03/12 12:16 PM, Martin Holmes wrote: > Do you have the tei: prefix correctly declared in your bibl.xqm module? > > Cheers, > Martin > > On 12-03-11 12:27 PM, Christopher Thomson wrote: >> I am creating an module to hold commonly used XQuery expressions as >> functions. $doc defines the document in my collection of TEI files, and >> the following returns a date of birth in the desired way: >> >> *<div id="sidebar" class="span-6"> >> <h3><b>{$fullname}</b></h3> >> >> let $dob := >> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >> return <p>{$dob/text()}</p> >> </div>* >> >> Next, I move this code to a function in a module in the namespace bibl. >> The above div becomes: >> >> *<div id="sidebar" class="span-6"> >> <h3><b>{$fullname}</b></h3> >> >> { bibl:dob($doc) } >> </div>* >> >> The function is declared in the bibl.xqm module thus: >> >> *declare function bibl:dob($doc) { >> let $dob := >> $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth >> return <p>{$dob/text()}</p> >> };* >> >> This arrangement does not return the date of birth to the resulting web >> page. Does anyone see where the error is here? I have assumed the $doc >> argument will be passed from the main page to the function in the bibl >> module. 'bibl' is imported into the main page and seems to be defined >> correctly as a module. >> >> Thanks, >> Chris >> |
From: Martin H. <mh...@uv...> - 2012-03-11 23:16:55
|
Do you have the tei: prefix correctly declared in your bibl.xqm module? Cheers, Martin On 12-03-11 12:27 PM, Christopher Thomson wrote: > I am creating an module to hold commonly used XQuery expressions as > functions. $doc defines the document in my collection of TEI files, and > the following returns a date of birth in the desired way: > > *<div id="sidebar" class="span-6"> > <h3><b>{$fullname}</b></h3> > > let $dob := > $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth > return <p>{$dob/text()}</p> > </div>* > > Next, I move this code to a function in a module in the namespace bibl. > The above div becomes: > > *<div id="sidebar" class="span-6"> > <h3><b>{$fullname}</b></h3> > > { bibl:dob($doc) } > </div>* > > The function is declared in the bibl.xqm module thus: > > *declare function bibl:dob($doc) { > let $dob := > $doc/tei:teiHeader/tei:profileDesc/tei:particDesc/tei:person/tei:birth > return <p>{$dob/text()}</p> > };* > > This arrangement does not return the date of birth to the resulting web > page. Does anyone see where the error is here? I have assumed the $doc > argument will be passed from the main page to the function in the bibl > module. 'bibl' is imported into the main page and seems to be defined > correctly as a module. > > Thanks, > Chris > |