Time |
S |
Nick |
Message |
12:12 |
|
kados |
paul around? |
12:13 |
|
kados |
probably not being the weekend and all |
12:13 |
|
paul |
for a few minuts only. |
12:13 |
|
kados |
ahh ... great! |
12:13 |
|
paul |
hello joshua |
12:13 |
|
kados |
quick question |
12:13 |
|
kados |
hi :-) |
12:13 |
|
paul |
(working today, then leaving for 3 days with family. TGV in less than 1 hour) |
12:13 |
|
paul |
reading. |
12:13 |
|
kados |
for the MARC import to reservoir ... I have found that some records that do not have ISBNs do not import ... have you found this also? |
12:14 |
|
kados |
(ooh ... have fun ;-)) |
12:14 |
|
paul |
yep. |
12:14 |
|
kados |
re: MARC import to reservoir ... is there a way to avoid this? |
12:14 |
|
paul |
worked in 2.0, but not in 2.2 |
12:15 |
|
paul |
yes but no. if we revert to 2.0, then another annoying problem comes around. |
12:15 |
|
paul |
could you open a bug pls. i'll try to fix it correctly. |
12:15 |
|
kados |
sure ... here's an idea ... |
12:15 |
|
kados |
what if there is no isbn found ... so Koha automatically puts one in ... |
12:16 |
|
kados |
ok ... I'll bug it |
12:17 |
|
paul |
have a nice trip to san diego. is it for fun or work ? |
12:18 |
|
kados |
100% fun this time ;-) |
12:18 |
|
paul |
so, have a funny week ! |
12:18 |
|
kados |
hehe |
12:19 |
|
kados |
ok ... bug report sent |
12:19 |
|
paul |
hello owen. |
12:19 |
|
owen |
Hi paul and kados. |
12:32 |
|
kados |
owen: you working at PPL today? |
12:32 |
|
owen |
Yes |
12:33 |
|
kados |
I'm about to head to athens myself |
14:55 |
|
indradg |
kados, hi... yes I have noticed the bug triggering for non-ISBN MARC records |
15:05 |
|
owen |
kados: are you going to volunteer in Sunny Pasadena? :) |
15:05 |
|
chris |
morning |
15:06 |
|
owen |
Hi chris |
15:06 |
|
chris |
owen: do you have an rss reader handy? |
15:06 |
|
kados |
morning chris |
15:06 |
|
owen |
chris: yes |
15:06 |
|
kados |
indradg: yep ... it's a pretty big problem ;-) |
15:06 |
|
kados |
indradg: as there are loads of records without ISBNs |
15:06 |
|
chris |
http://opac.hlt.katipo.co.nz/c[…]koha/opac-main.pl |
15:06 |
|
kados |
chris hacking on Koha rss? |
15:07 |
|
chris |
try a search |
15:07 |
|
chris |
then add &subsearch=rss to the end of the url |
15:08 |
|
kados |
bloglines reports no feeds .. |
15:08 |
|
kados |
not found via browser |
15:08 |
|
chris |
eg |
15:08 |
|
chris |
http://opac.hlt.katipo.co.nz/c[…]ogs&Go.x=0&Go.y=0 |
15:09 |
|
kados |
3hmm ... |
15:09 |
|
kados |
that's a file ... for downloading |
15:09 |
|
chris |
yeah the header is wrong |
15:09 |
|
kados |
chris: I should send you my opensearch proxy ... might be a cleaner way of doing rss in Koha |
15:09 |
|
chris |
but i get a feed if i punch that into bloglines |
15:09 |
|
kados |
it needs some modularization though |
15:09 |
|
kados |
ok |
15:10 |
|
chris |
its pretty easy |
15:10 |
|
chris |
you just make a rss template |
15:10 |
|
kados |
http://liblime.com/opensearchproxy.html |
15:10 |
|
kados |
seen that? |
15:10 |
|
chris |
and tell it to use that |
15:10 |
|
chris |
im just not fully up on rss syntax |
15:11 |
|
kados |
oops ... |
15:11 |
|
owen |
When I plug that URL into Bloglines it works great. But yeah, my browser wanted to download it |
15:11 |
|
kados |
http://liblime.com/opensearchportal.html |
15:11 |
|
kados |
well and rss has the whole versioning problem |
15:12 |
|
chris |
i dont think its really a problem |
15:12 |
|
chris |
just pick a version and conform to that :) |
15:12 |
|
owen |
Agreed |
15:12 |
|
kados |
so what you've got is a search returning rss results ... which is exactly what opensearch is ... |
15:13 |
|
chris |
yeah all i did was make an rss template |
15:13 |
|
kados |
I wrote a similar opensearch compatible one that uses Net::Z3950 |
15:13 |
|
kados |
so it works on any Z39.50 source |
15:13 |
|
chris |
you can do it for every single page of koha |
15:13 |
|
kados |
ahh ... neat ...so borrowers pages too? |
15:13 |
|
chris |
exactly |
15:14 |
|
kados |
that's useful ;-) |
15:14 |
|
chris |
just need to make the templates, and you remember the change language button |
15:15 |
|
chris |
could use something like that,except it says rss feed of this page |
15:15 |
|
chris |
just was playing around while im watching nz play great britain in rugby league |
15:16 |
|
kados |
chris: here's mine: http://search.athenscounty.lib[…]opensearch?q=dogs |
15:17 |
|
chris |
cool |
15:17 |
|
chris |
i was just thinking (as u do early on sunday morning) |
15:17 |
|
chris |
"its all just templates" |
15:18 |
|
kados |
yep :-) |
15:18 |
|
kados |
chris: http://opensearch.a9.com/ |
15:18 |
|
chris |
so koha could easy do .91 .93, 1.00, 2.00 8731.4 whatever version |
15:19 |
|
kados |
sign up for that ... and then add nelsonville to your 'columns' |
15:19 |
|
chris |
ahh i remember you showing me this its very cool |
15:20 |
|
kados |
so it's insanely easy to implement an opensearch portal similar to a9s |
15:20 |
|
chris |
yep |
15:20 |
|
kados |
which is what liblime.com/opensearchportal.html is ... |
15:20 |
|
kados |
it's a completely client-side portal in fact ... done in javascript |
15:20 |
|
kados |
and using that we can add any opensearch source for federated searching |
15:21 |
|
kados |
and complying to opensearch means that patrons can search our catalog in their favorite opensearcch portal ;-) |
15:22 |
|
chris |
yep, the search was just an easy page to do a template for |
15:22 |
|
kados |
yep ... |
15:22 |
|
kados |
so is there an XML::Template? |
15:23 |
|
chris |
i just wanted to do a "koha does rss for every page in the opac" |
15:23 |
|
chris |
naw dont need it |
15:23 |
|
kados |
how are you handleing XML through HTML::TEmplate? |
15:23 |
|
kados |
just changing the header and encoding? |
15:23 |
|
chris |
yeah |
15:23 |
|
kados |
yea ... that's what I did too |
15:24 |
|
kados |
just wanted to make sure I did it right ;-) |
15:24 |
|
chris |
html::template is a bit of a misname |
15:24 |
|
chris |
it doesnt care if its html or anything |
15:24 |
|
kados |
so actually, it should be pretty easy to add a new set of XML templates |
15:24 |
|
chris |
yep |
15:24 |
|
kados |
then just check for them in the script |
15:24 |
|
chris |
exactly |
15:24 |
|
kados |
and walla ... rss or whatever |
15:25 |
|
kados |
sweetness |
15:25 |
|
chris |
thats the plan |
15:25 |
|
kados |
owen: better get right on that ;-) |
15:25 |
|
kados |
I wonder if it would be possible to write an XML DtD such that it would make the process of creating new templates easier |
15:25 |
|
owen |
Hunh? Wha? |
15:26 |
|
chris |
owen was talking about it the other day, and when i had to get up at 5.30am today, it came to me |
15:26 |
|
kados |
i.e., all the changes are done in XML |
15:26 |
|
kados |
so all a tempalte designer needs to do is see what xml exists and then modify the html template accordingly |
15:26 |
|
kados |
or something ... xslt maybe? |
15:27 |
|
chris |
dunno, but the search one is only about 15 lines |
15:27 |
|
kados |
right |
15:27 |
|
chris |
they should be pretty good to maintain |
15:27 |
|
chris |
much simpler than html |
15:27 |
|
kados |
hmmm ... brainstorming here ... |
15:27 |
|
kados |
what if instead of PROG templates in HTML there were PROG templates in XML |
15:28 |
|
kados |
couldn't we then use XSLT to convert them to XHTML? |
15:28 |
|
chris |
in theory yep |
15:28 |
|
kados |
and a proper dtd would allow anyone to design a template and display the fields however they wanted |
15:29 |
|
kados |
and it could be 'versioned' so with every release of Koha there'd be updates to the DT |
15:29 |
|
kados |
DTD even |
15:29 |
|
chris |
hmmm 24-20 |
15:29 |
|
kados |
I wonder ... if we had that system going whether it'd be more complex or easier? |
15:30 |
|
chris |
this is going to be close |
15:30 |
|
kados |
hehe |
15:30 |
|
chris |
depends how many ppl understand xml vs html |
15:30 |
|
chris |
ditto |
15:30 |
|
chris |
but then i dont know much html either :) |
15:30 |
|
owen |
But surely I can learn in my copious free time? :) |
15:44 |
|
kados |
http://particletree.com/notebook/xslt-roundup/ |
15:45 |
|
owen |
Aw man, homework! |
15:46 |
|
kados |
hehe ... the first link there is really good ... I'm reading it now |
16:07 |
|
chris |
yay 42-26 .. i can go back to sleep now |
16:11 |
|
owen |
The man's hardcore. |
22:50 |
|
destinati |
Anyone have experience with the Z3950 code? |
22:53 |
|
destinati |
Or specifically importing MARC |
23:05 |
|
destinati |
Anyone out there? :) |
23:11 |
|
destinati |
I have a crazy idea to get around the Z3950 problem on windows that just might work |
23:11 |
|
destinati |
but I wanted to run it by someone that's familiar with Koha's code |
23:35 |
|
kados |
woot! chris around? |
23:36 |
|
kados |
just worked up the first working demo of an XMLHttpRequest marc editor that uses xslt to process the records |
23:36 |
|
kados |
http://bobcat2.cs.ohiou.edu/ |
23:36 |
|
kados |
well ... can't edit just yet ;-) |
23:36 |
|
kados |
but the search and display is working |
23:36 |
|
kados |
this xslt stuff is really powerful |
23:39 |
|
destinati |
I use XSLT quite a bit at work |
23:40 |
|
destinati |
It's really nice if you have a XSLT debugger |
23:40 |
|
destinati |
like Visual Studio 2005 |
23:42 |
|
destinati |
Kados? |
23:46 |
|
kados |
yea ... I'm here |
23:48 |
|
destinati |
:) I commend you |
23:48 |
|
destinati |
Even though I run XP, I still use GVIM/VIM to edit text files |
23:49 |
|
destinati |
I'm not familiar with your project, but if you have general XSLT questions I might be able to help |
23:49 |
|
destinati |
I'm trying to find the most pain-free process to make it easy for librarians to import MARC data from the Library of Congress |
23:50 |
|
destinati |
given that the server is running on an XP box (for a couple of reasons) |
23:50 |
|
kados |
destinati: do you happen to know how I can do this? : |
23:50 |
|
kados |
<input value=<xsl:value-of select="."/></input> |
23:50 |
|
destinati |
no, you don't want to do that |
23:51 |
|
destinati |
you need to create an xsl:attribute inside of the <input> tag |
23:51 |
|
kados |
ahh |
23:52 |
|
destinati |
<input> |
23:52 |
|
kados |
(first day at xslt ;-)) |
23:52 |
|
destinati |
<xsl:attribute name="value"><xsl:value-of select="."/></input> |
23:52 |
|
destinati |
remember.. it has to be a valid XML document |
23:52 |
|
destinati |
this is how XSLT gets around the issue |
23:55 |
|
destinati |
Did you happen to write the Koha MARC add biblio function? :) |
23:55 |
|
kados |
no ;-) |
23:55 |
|
destinati |
I mean.. the web interface to it |
23:55 |
|
kados |
destinati: http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl |
23:55 |
|
kados |
this is throwing an error |
23:56 |
|
destinati |
oops.. I forgot to close the attribute tag |
23:56 |
|
destinati |
<xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> |
23:57 |
|
kados |
got it |
23:57 |
|
kados |
http://bobcat2.cs.ohiou.edu/ |
23:57 |
|
kados |
this is the beginnings of an open-source MARC record retriever and editor ;-) |
23:58 |
|
kados |
so you do a search (one term only) |
23:58 |
|
destinati |
we might have similar goals |
23:58 |
|
kados |
click on the results and you can view and edit the record ... |
23:58 |
|
kados |
well it's really just an infant ;-) |
23:58 |
|
kados |
destinati: what's your goal? |
23:58 |
|
destinati |
I have to run Koha on Windows |
23:59 |
|
destinati |
and I have a library of 1000+ books |
23:59 |
|
kados |
http://athenscounty.lib.oh.us/[…]catalogingproject |
23:59 |
|
destinati |
that need to be added to it |
23:59 |
|
destinati |
and ideally I'd like to have a lot of volunteers simply go to a program |
23:59 |
|
kados |
that's the description doc for the class that's working on this project |
23:59 |
|
destinati |
type the ISBN |
23:59 |
|
destinati |
and have Koha magically pull in all the data from the library of congress's MARCXML gateway |
00:00 |
|
kados |
hmmm ... |
00:00 |
|
kados |
so ... you know you can already do z39.50 searches right? |
00:00 |
|
destinati |
On *nix |
00:00 |
|
kados |
pull back records, import them, etc. |
00:00 |
|
destinati |
the code doesn't seem to work on Windows |
00:00 |
|
kados |
yea ... that's going to change real soon |
00:00 |
|
kados |
it's because of Net::z3950 |
00:01 |
|
destinati |
I understand |
00:01 |
|
kados |
which will soon be replaced by Perl-ZOOM |
00:01 |
|
destinati |
or at least have read a bit about it |
00:01 |
|
kados |
(which will remove dependency on perl Event module which is buggy on windows) |
00:01 |
|
destinati |
how soon is soon? |
00:01 |
|
kados |
the coding will begin on Nov 21 and end mid December |
00:01 |
|
kados |
I know because I'm sponsoring it ;-) |
00:02 |
|
destinati |
Sponsoring who? |
00:02 |
|
destinati |
the class? |
00:02 |
|
kados |
so ... it's complex |
00:02 |
|
kados |
I own/operate http://liblime.com with some friends |
00:02 |
|
destinati |
Ah. |
00:03 |
|
kados |
we have a couple of contracts with libraries |
00:03 |
|
kados |
and we're paying Index Data (http://indexdata.dk) to create Perl_ZOOM |
00:03 |
|
kados |
:-) |
00:03 |
|
destinati |
seems almost like an overkill |
00:03 |
|
kados |
so the other part that's complex is that I'm also an employee of the Nelsonville Public Library SYstem |
00:04 |
|
kados |
the sys admin in fact |
00:04 |
|
destinati |
there is a very simple SOAP gateway to the LOC |
00:04 |
|
kados |
and through NPL I'm working with an ohio university class to create a new MARC editor |
00:04 |
|
destinati |
that will give you the full MARCXML of an ISBN |
00:04 |
|
kados |
which is that catalogingproject wiki link above |
00:04 |
|
kados |
not sure ... but that's pretty simple to do eh? |
00:05 |
|
destinati |
that is what I was going to use.. and have a simple .NET application fill in the right textboxes on the add biblio form |
00:05 |
|
destinati |
but that was going to be a hack |
00:05 |
|
kados |
yea ... I'd wait around for Koha 3.0 |
00:05 |
|
kados |
where it'll be done right ;-) |
00:06 |
|
kados |
should be ready first quarter of 2006 |
00:06 |
|
kados |
and if you want to sponsor anything (or hack on anything) please let us know |
00:06 |
|
kados |
I'm the release manager |
00:06 |
|
kados |
we can always use some more programmers ;-) |
00:06 |
|
destinati |
well.. I've got an eager library project wanting to get their online catalog started |
00:07 |
|
destinati |
so I might have to hack this until Koha 3.0 is available |
00:07 |
|
kados |
so have you considered hosted solutions? |
00:07 |
|
kados |
my company offers them :-) |
00:07 |
|
kados |
here's one of our client's OPACs: |
00:07 |
|
kados |
https://libcat.nbbc.edu |
00:08 |
|
kados |
we've got a fiber-backbone server farm in seattle with three points of redundency :-) |
00:08 |
|
destinati |
we don't have the budget for a recurring cost |
00:08 |
|
kados |
gotcha |
00:08 |
|
kados |
so nothing's cheaper than linux |
00:09 |
|
kados |
going with wondows automatically locks you into recurring cost ;-) |
00:09 |
|
destinati |
Sort of.. but not quite |
00:09 |
|
kados |
If I were you I'd throw debian sarge on an older pentium, install Koha and walla ... |
00:09 |
|
destinati |
the computer that runs Koha will also be used for things like Word, PowerPoint, Adobe Acrobat.. and part of a Windows 2000 domain |
00:10 |
|
kados |
ahh ... |
00:10 |
|
destinati |
and Debian and OpenOffice won't cut it |
00:10 |
|
kados |
well ... use wine |
00:10 |
|
destinati |
hehe |
00:10 |
|
destinati |
The idea is to try it out on this box |
00:10 |
|
kados |
I've got tons of windows programs installed |
00:10 |
|
kados |
including world of warcraft ;-) |
00:11 |
|
destinati |
and if it successful.. we'll eventually migrate to a linux box |
00:11 |
|
kados |
cool |
00:11 |
|
destinati |
in theory.. it should just be a matter of exporting the MySQL DB and importing it on the Linux box |
00:11 |
|
kados |
well here's an idea |
00:11 |
|
kados |
what if you used a third-part MARC editor for the time being |
00:11 |
|
kados |
until KOha's is ready for windows |
00:12 |
|
kados |
bookwhere is a good Z39.50 retrieval tool |
00:12 |
|
kados |
and you can use TLC's editor fairly cheaply |
00:12 |
|
kados |
the whole thing would cost less than $2K annually |
00:13 |
|
destinati |
It'd be easier, but he project just doesn't have the budget |
00:13 |
|
destinati |
we spent around $400 on the computer.. and all that's remaining is my volunteer time |
00:13 |
|
kados |
yikes |
00:14 |
|
destinati |
I'm not sure on the computer cost actually |
00:14 |
|
kados |
last time I checked a single windows seat was around $400 |
00:14 |
|
destinati |
but it's a 2.8 GHz/512 MB RAM |
00:14 |
|
destinati |
low end from Dell |
00:14 |
|
kados |
not too bad |
00:14 |
|
kados |
I run NPL on a 900Mhz ;-) |
00:15 |
|
destinati |
I'm a software engineer at work |
00:15 |
|
kados |
sweet ... where's that? |
00:15 |
|
destinati |
so I'm not scared to write code |
00:15 |
|
destinati |
especially when others might benefit |
00:15 |
|
destinati |
I work at Raytheon |
00:15 |
|
kados |
much experience with javascript? |
00:16 |
|
kados |
question about xslt |
00:16 |
|
destinati |
I do quite a bit with HTML, XML, XSLT, Databases, VB.NET, C#, C++ |
00:16 |
|
kados |
nice |
00:16 |
|
kados |
so say I've got that stylesheet above |
00:16 |
|
kados |
and i want to make a bunch of inputs and labels for each tag/subfield in the doc |
00:17 |
|
kados |
without having a huge stylesheet |
00:17 |
|
destinati |
do you have a sample XML file? |
00:17 |
|
kados |
is there a way to use the existing xml to generate the match? |
00:17 |
|
kados |
ye |
00:17 |
|
kados |
http://bobcat2.cs.ohiou.edu/cg[…]&searchbox=qwerty |
00:18 |
|
kados |
that's an example ... but of course, since it's MARC it's wildly variable |
00:18 |
|
kados |
so there's no telling what tags and subfields each record is going to have ahead of time |
00:18 |
|
destinati |
ok, good.. you're using MARCXML |
00:18 |
|
kados |
need to account for indicators and repeatability too ... and eventually authorities ... |
00:19 |
|
kados |
yea |
00:19 |
|
destinati |
what you want to do is make use of the xsl:for-each |
00:19 |
|
destinati |
command |
00:19 |
|
destinati |
so.. something like |
00:20 |
|
destinati |
<xsl:for-each select="datafield"> |
00:20 |
|
destinati |
then... inside of this you're in scope of a datafield tag |
00:21 |
|
destinati |
you can then display the @tag |
00:21 |
|
kados |
right ... |
00:21 |
|
destinati |
you can use xsl:if's to test if the count(subfield/) > 0 |
00:21 |
|
destinati |
to see if you want to display subfields |
00:21 |
|
kados |
sweet |
00:22 |
|
destinati |
if so, you can display some subfield header info... |
00:22 |
|
destinati |
There are several XML editors on Windows at least that do full XSLT intellisense |
00:22 |
|
destinati |
which is very helpful when you're writing an XSL file |
00:23 |
|
kados |
well ... I guess what I need is a good tutorial covering what's possible |
00:23 |
|
destinati |
you can also use XPATH to see if that tag has been used previously in the document |
00:23 |
|
kados |
neat ... from within xslt? |
00:23 |
|
destinati |
and then from that you can modify your output to say something like "Repeat #3" |
00:23 |
|
destinati |
absolutely |
00:23 |
|
kados |
sweet! |
00:23 |
|
kados |
wow ... this is like a whole new animal |
00:23 |
|
destinati |
if you have multiple tags.. like 650's |
00:24 |
|
kados |
I'm really excited ;-) |
00:24 |
|
destinati |
I used XSLT to simplify a database program that generated HTML |
00:24 |
|
destinati |
it cut the code down immensely |
00:24 |
|
destinati |
now.. all the database does is spit out a XML file |
00:24 |
|
destinati |
and the XSLT does a whole bunch of processing |
00:24 |
|
kados |
yea ... this might be just what Koha needs |
00:25 |
|
kados |
none of us have use XML that much |
00:25 |
|
kados |
used that is |
00:25 |
|
kados |
so how do I display @tag? |
00:26 |
|
kados |
within datafield? |
00:26 |
|
destinati |
remember that in XSLT, you find the value of any variable using select |
00:26 |
|
destinati |
so.. |
00:26 |
|
destinati |
if the context is the datafield node |
00:26 |
|
destinati |
<xsl:value-of select="@tag"/> |
00:26 |
|
kados |
sweet |
00:27 |
|
destinati |
Ideally, Koha would have a web service oriented architecture.. |
00:27 |
|
destinati |
that way you could use a lot of the tools to write simple interfaces to Koha |
00:27 |
|
destinati |
using things like SOAP |
00:28 |
|
destinati |
it sounds like a lot of buzzwords |
00:28 |
|
destinati |
but it's not too bad |
00:28 |
|
kados |
yep ... I grok soap |
00:28 |
|
destinati |
I'd be all for Koha moving to a more XML approach :) |
00:29 |
|
destinati |
at work, I use XML for data, XSLT for structure, and CSS for style |
00:29 |
|
kados |
well I've got to give it some thought ... but I think it would streamline our template development process |
00:29 |
|
destinati |
I'm not sure how you do that now |
00:29 |
|
kados |
though it would add another layer and require another technology |
00:29 |
|
kados |
we use HTML::Template ... perl module |
00:29 |
|
destinati |
ah |
00:29 |
|
kados |
which can generate XML just fine |
00:30 |
|
destinati |
what is an example template? |
00:30 |
|
kados |
but currently we just use it to create our templates |
00:30 |
|
kados |
do you have a Koha installed? |
00:30 |
|
destinati |
Yeah, 2.2.4 |
00:30 |
|
kados |
everything is templates |
00:30 |
|
kados |
all the interfaces |
00:30 |
|
kados |
look in koha/koha-tmpl/intranet-tmpl/npl/en/ |
00:31 |
|
kados |
there are two template styles currently maintained npl and default (called css in the OPAC) |
00:32 |
|
destinati |
yeah.. you could definitely benefit from using XSLT instead of what you call templates here |
00:32 |
|
kados |
hehe |
00:32 |
|
destinati |
you'd benefit from having more tools at your disposal to edit them |
00:39 |
|
destinati |
my dream is that one day Koha is using XML and is very plug-in/modular oriented |
00:39 |
|
kados |
destinati: can you take a look ... why isn't my for-each displaying |
00:39 |
|
destinati |
so that it's very easy to configure |
00:40 |
|
destinati |
and there is an explosion of tons of plug-ins |
00:40 |
|
kados |
http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl |
00:40 |
|
destinati |
and a very simple Windows installer :) |
00:40 |
|
kados |
do I need it to be marc:datafield/ ? |
00:40 |
|
kados |
I have <xsl:for-each select="marc:datafield"> now |
00:41 |
|
destinati |
note that all code has to be done in a template |
00:41 |
|
destinati |
I think... |
00:42 |
|
destinati |
so, what you're saying is.. |
00:42 |
|
destinati |
"at the root, apply all templates that you can" |
00:42 |
|
destinati |
the for-each is ignored |
00:42 |
|
destinati |
and then the specific templates might be matched |
00:42 |
|
kados |
gotcha |
00:43 |
|
destinati |
simply have a match of "marc:datafield" |
00:43 |
|
destinati |
or... |
00:43 |
|
destinati |
go one level higher |
00:43 |
|
destinati |
and match marc:record |
00:43 |
|
destinati |
or.. |
00:44 |
|
destinati |
have another template that doesn't do a match |
00:44 |
|
destinati |
but that is named something like |
00:44 |
|
kados |
hmmm ... |
00:44 |
|
destinati |
<xsl:template name="showdatafields"> |
00:44 |
|
destinati |
.. |
00:44 |
|
destinati |
then |
00:44 |
|
destinati |
<xsl:foreach select = "//datafield"> |
00:45 |
|
destinati |
this xpath expression will select all datafields from the current node and below in the XML tree |
00:45 |
|
destinati |
then, in your root template |
00:45 |
|
destinati |
you could do an xsl:call-template |
00:46 |
|
destinati |
<xsl:call-template name="showdatafields"/> |
00:46 |
|
destinati |
all depends on your preferences |
00:46 |
|
destinati |
and where you're going to take it.. |
00:48 |
|
destinati |
nothing is preventing you from having another XML file that defines the MARC fields |
00:48 |
|
destinati |
and then using XSLT to get that data using XPATH |
00:49 |
|
kados |
that's what I'm doing I think |
00:49 |
|
kados |
xmlns:marc="http://www.loc.gov/MARC21/slim" |
00:49 |
|
destinati |
404 |
00:50 |
|
destinati |
maybe there is a nice schema... |
00:50 |
|
destinati |
got it |
00:51 |
|
destinati |
well the schema doesn't define each marc code |
00:51 |
|
kados |
hmmm ... |
00:51 |
|
kados |
so I can't really get the inputs to show up from showdatafields |
00:52 |
|
destinati |
you can |
00:52 |
|
destinati |
but to say that "650" is a subject item |
00:52 |
|
kados |
well here's my idea |
00:52 |
|
destinati |
you'd have to have a mapping of the MARC code to the definition of what 650 is |
00:52 |
|
kados |
we assume advanced use |
00:52 |
|
kados |
then when the user hits F1 |
00:52 |
|
kados |
a help pops up with explaination of the current field |
00:53 |
|
kados |
but that's another whole stylesheet ;-) |
00:53 |
|
kados |
right now I just need to get label and input showing up ;-) |
00:53 |
|
kados |
here's what I've got: |
00:53 |
|
kados |
http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl |
00:55 |
|
destinati |
replace marc:datafield with //datafield |
00:55 |
|
destinati |
hmm.. I should probably copy the info locally |
00:55 |
|
kados |
ok tried that an still doesn't work |
00:56 |
|
kados |
yea ... LOC is really slow ;-) |
00:56 |
|
destinati |
One minute.. I'll setup a sample project |
01:02 |
|
destinati |
a few typos maybe.. |
01:03 |
|
destinati |
hmm.. you're not getting proper XML back either |
01:03 |
|
destinati |
for example |
01:03 |
|
destinati |
& |
01:03 |
|
destinati |
instead of & |
01:04 |
|
destinati |
well, maybe not |
01:04 |
|
destinati |
maybe I copied wrong |
01:04 |
|
destinati |
one sec |
01:04 |
|
destinati |
hehe |
01:04 |
|
destinati |
that was it |
01:04 |
|
kados |
it should be valid xml ... |
01:05 |
|
kados |
no? |
01:05 |
|
kados |
typos? |
01:06 |
|
destinati |
I was viewing the XML in FireFox |
01:06 |
|
destinati |
and copied and pasted it |
01:06 |
|
kados |
ahh |
01:07 |
|
destinati |
only to realize that FF did some escaping in the display |
01:07 |
|
destinati |
:) |
01:07 |
|
kados |
I've got <xsl:template name="showdatafields" match="marc:datafield"> |
01:07 |
|
kados |
now |
01:08 |
|
kados |
does this mean I'm using the marc namespace? |
01:08 |
|
kados |
and is that a good thing? |
01:08 |
|
destinati |
one min.. now I've got it to where you are |
01:10 |
|
destinati |
<xsl:template name="showdatafields"> |
01:10 |
|
destinati |
|
01:10 |
|
destinati |
<xsl:for-each select="//marc:datafield"> |
01:10 |
|
destinati |
get rid of the match part of the template declaration |
01:11 |
|
kados |
done |
01:11 |
|
destinati |
<xsl:template name="showdatafields"> |
01:11 |
|
destinati |
<xsl:for-each select="//marc:datafield"> |
01:11 |
|
destinati |
<label> |
01:11 |
|
destinati |
<xsl:attribute name="for"><xsl:value-of select="@tag"/></xsl:attribute> |
01:11 |
|
destinati |
<xsl:value-of select="@tag"/> |
01:11 |
|
destinati |
</label> |
01:11 |
|
destinati |
<input> |
01:11 |
|
destinati |
<xsl:attribute name="id"><xsl:value-of select="@tag"/></xsl:attribute> |
01:11 |
|
destinati |
<xsl:attribute name="value"><xsl:value-of select="@tag"/></xsl:attribute> |
01:11 |
|
destinati |
</input> |
01:11 |
|
destinati |
</xsl:for-each> |
01:11 |
|
destinati |
</xsl:template> |
01:13 |
|
kados |
is that what you're prescribing? |
01:13 |
|
destinati |
Actually.. |
01:13 |
|
destinati |
<xsl:template name="showdatafields"> |
01:13 |
|
destinati |
<xsl:for-each select="//marc:datafield"> |
01:13 |
|
destinati |
<xsl:sort select="@tag"/> |
01:13 |
|
destinati |
<label> |
01:13 |
|
destinati |
<xsl:attribute name="for"><xsl:value-of select="@tag"/></xsl:attribute> |
01:13 |
|
destinati |
<xsl:value-of select="@tag"/> |
01:13 |
|
destinati |
</label> |
01:13 |
|
destinati |
<input> |
01:13 |
|
destinati |
<xsl:attribute name="id"><xsl:value-of select="@tag"/></xsl:attribute> |
01:13 |
|
destinati |
<xsl:attribute name="value"><xsl:value-of select="@tag"/></xsl:attribute> |
01:13 |
|
destinati |
</input> |
01:13 |
|
destinati |
</xsl:for-each> |
01:13 |
|
destinati |
</xsl:template> |
01:13 |
|
destinati |
that way it'll be sorted by MARC tag |
01:14 |
|
kados |
ok ... cept it's not working ;-) |
01:14 |
|
destinati |
what error do you get? I'm seeing it work here on my local copy |
01:15 |
|
kados |
hmmm |
01:15 |
|
kados |
well I don't get an error exactly |
01:15 |
|
destinati |
one thing that I strongly recommend you do |
01:15 |
|
kados |
instead of inputs I'm seeing just a MARC string |
01:16 |
|
destinati |
is that you place a sample XML output file in the directory with the XSL |
01:16 |
|
destinati |
and then at the top of it.. put |
01:16 |
|
destinati |
<?xml-stylesheet type="text/xsl" href="marc.xsl"?> |
01:16 |
|
destinati |
that way.. all you have to do is save the XSL |
01:16 |
|
destinati |
and then refresh the XML view in your browser |
01:16 |
|
destinati |
I do that all the time |
01:16 |
|
kados |
ahh ... good point |
01:17 |
|
kados |
so I took the bottom stuff out of my xslt doc |
01:18 |
|
kados |
and now it's just showing me a MARC string with no formatting at all: |
01:18 |
|
kados |
http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl |
01:18 |
|
kados |
any ideas? |
01:19 |
|
destinati |
hmm |
01:19 |
|
destinati |
it's working here |
01:19 |
|
kados |
weird |
01:20 |
|
destinati |
let's see if I can send you something |
01:20 |
|
kados |
do I still need this? : |
01:20 |
|
kados |
<xsl:template match="/"> |
01:20 |
|
kados |
<form> |
01:20 |
|
kados |
<xsl:call-template name="showdatafields"/> |
01:20 |
|
kados |
</form> |
01:20 |
|
kados |
</xsl:template> |
01:21 |
|
destinati |
you definitely need the root template |
01:21 |
|
destinati |
that's the first thing the XSL processor goes for |
01:21 |
|
destinati |
now, if you want to put the items inside of the <form> tag in another preference you can |
01:21 |
|
destinati |
or you can do everything inside the root template |
01:21 |
|
destinati |
it's up to you |
01:22 |
|
destinati |
but if you want to simplify things... |
01:22 |
|
destinati |
take the part from <xsl:template name="showdatafields" |
01:22 |
|
destinati |
to the end of that tag at the bottom |
01:22 |
|
destinati |
get rid of the template outer tag |
01:22 |
|
destinati |
and put it inside the <form> tag |
01:23 |
|
destinati |
that way you make it simpler |
01:23 |
|
destinati |
by having everything in one template |
01:23 |
|
kados |
like this? :http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl |
01:23 |
|
destinati |
hehe |
01:23 |
|
destinati |
now you can get rid of the call-template :) |
01:24 |
|
destinati |
think of templates as sort of similar to functions in perl |
01:24 |
|
destinati |
the only difference is that templates really describe parts of the XML tree |
01:24 |
|
kados |
right |
01:24 |
|
destinati |
"/" is the main() |
01:24 |
|
kados |
ok ... well strangely it's not working ... |
01:25 |
|
kados |
instead of nicely formatted inputs I'm just getting a MARC string when I click on each record |
01:25 |
|
kados |
do you have the whole app running locally? |
01:25 |
|
kados |
http://bobcat2.cs.ohiou.edu/ |
01:25 |
|
kados |
? |
01:25 |
|
destinati |
Take an XML file generated from the query |
01:26 |
|
destinati |
then add <?xml-stylesheet type="text/xsl" href="MARCEdit.xsl"?> to the top of it |
01:26 |
|
destinati |
and put it in the same directory as the XSL |
01:26 |
|
destinati |
then view that XML in firefox |
01:27 |
|
destinati |
also.. don't be afraid to do a ggVg= in vim |
01:27 |
|
destinati |
:) |
01:27 |
|
kados |
:-) |
01:27 |
|
destinati |
er |
01:27 |
|
destinati |
ggVG= |
01:28 |
|
kados |
so what does the xmlns:marc="http://www.loc.gov/MARC21/slim" do for me? |
01:28 |
|
kados |
it's at the top of my .xls |
01:28 |
|
kados |
could that be the problem? |
01:28 |
|
kados |
(I really need this to work on dynamic results |
01:28 |
|
destinati |
that's telling the XML parser that there is a namespace |
01:28 |
|
destinati |
named marc |
01:28 |
|
kados |
that's what I thought |
01:29 |
|
kados |
so marc:datafield is referencing that right? |
01:29 |
|
kados |
should it be //marc:datafield or just marc:datafield? |
01:29 |
|
destinati |
you don't need the exclude part at the top |
01:30 |
|
destinati |
it depends on how you're processing the XSL |
01:30 |
|
destinati |
try "//datafield" instead of "//marc:datafield" |
01:30 |
|
destinati |
the "//" part is an XPath expression that says "look everywhere below my current position in the XML tree" |
01:31 |
|
destinati |
it's a bit confusing |
01:31 |
|
kados |
hmmm ... no luck |
01:32 |
|
destinati |
what is doing the XSL processing |
01:32 |
|
destinati |
how are you invoking it? |
01:32 |
|
kados |
hmmm ... |
01:32 |
|
kados |
it's in javascript |
01:32 |
|
kados |
and I can get some xsl processing to work ... |
01:33 |
|
kados |
i.e., I had it working when I was specifying specific tag/subfields |
01:33 |
|
destinati |
above the for-each part, put <b><xsl:value-of select="count(//marc:datafield)"/></b> |
01:34 |
|
destinati |
and see what the value is in bold in the generated page |
01:35 |
|
kados |
nothing seems to be |
01:35 |
|
destinati |
you don't even see 0? |
01:35 |
|
kados |
hmmm |
01:35 |
|
kados |
have you tried it: |
01:35 |
|
kados |
http://bobcat2.cs.ohiou.edu/ |
01:35 |
|
kados |
do a search (I use 'qwerty' as a keyword) |
01:36 |
|
kados |
it will return a list of records |
01:36 |
|
kados |
click on one and the right-hand side will display a MARC string |
01:37 |
|
kados |
that is supposed to be generated by the xslt transformation |
01:38 |
|
destinati |
seems like you're getting just the xml |
01:38 |
|
destinati |
for example, put a "HELLO WORLD!" above the <form> |
01:39 |
|
destinati |
yeah.. your xsl isn't running |
01:39 |
|
kados |
yea ... so maybe the xsl isn't valid or something |
01:40 |
|
destinati |
try modifying your top of the XSL to |
01:40 |
|
destinati |
<?xml version="1.0" encoding="ISO-8859-1"?> |
01:40 |
|
destinati |
<xsl:stylesheet version="1.0" |
01:40 |
|
destinati |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> |
01:41 |
|
destinati |
well.. you can even add the exclude part before the > |
01:41 |
|
destinati |
although I've never used exclude-result-prefixes before |
01:42 |
|
destinati |
<?xml version="1.0" encoding="ISO-8859-1"?> |
01:42 |
|
destinati |
<xsl:stylesheet version="1.0" |
01:42 |
|
destinati |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc"> |
01:43 |
|
kados |
what about the marc: namespage? |
01:43 |
|
kados |
namespace even |
01:44 |
|
kados |
hehe |
01:44 |
|
kados |
now I get a "to be implemented' warning from firefox |
01:46 |
|
destinati |
I need to be going soon, but if I follow your code.. your having the lookup in the main.js |
01:46 |
|
kados |
yep |
01:47 |
|
destinati |
and the loadRecord doing the style |
01:47 |
|
kados |
so I had a stylesheet working |
01:47 |
|
kados |
right |
01:47 |
|
kados |
all I've changed is the stylesheet ;-) |
01:47 |
|
kados |
right loadRecord handles the onclick event |
01:48 |
|
destinati |
I haven't dabbled to much in JavaScript, but... |
01:49 |
|
destinati |
are you using processed at all? |
01:49 |
|
destinati |
yes |
01:49 |
|
destinati |
in the append |
01:49 |
|
kados |
yea ... afaik it's the fragment |
01:50 |
|
kados |
var processed = processor.transformToFragment(myRecord,document); |
01:54 |
|
destinati |
I'm not sure about the javascript, I haven't used that before |
01:54 |
|
destinati |
but if you take your current XSL |
01:55 |
|
destinati |
and replace the select="marc:datafield" |
01:55 |
|
destinati |
with select="//marc:datafield" |
01:55 |
|
destinati |
and then take a sample XML output |
01:55 |
|
destinati |
and put the processing tags that I mentioned way above |
01:55 |
|
destinati |
it works |
01:55 |
|
destinati |
so the problem lies in the javascript |
01:56 |
|
destinati |
keep in mind that you have to put "//marc:datafield" instead of "marc:datafield" |
01:56 |
|
destinati |
because |
01:56 |
|
destinati |
of where you are in the XML tree at the time you do the for-each |
01:56 |
|
destinati |
you're one above the <collection> |
01:56 |
|
destinati |
that is.. the root |
01:56 |
|
destinati |
so you could put... |
01:57 |
|
destinati |
<xsl:for-each select="/marc:collection/marc:record/marc:datafield"> |
01:57 |
|
destinati |
or |
01:57 |
|
destinati |
<xsl:for-each select="//marc:datafield"> |
01:57 |
|
destinati |
they both will get you what you want |
01:57 |
|
destinati |
the bottom has a cleaner XPath |
01:58 |
|
destinati |
if you just put <xsl:for-each select="marc:datafield"> |
01:58 |
|
destinati |
you'll get nowhere |
01:58 |
|
destinati |
because at that point |
01:58 |
|
destinati |
in the tree the items to iterate through are just... <marc:collection> |
01:58 |
|
destinati |
does that make sense? |
01:59 |
|
destinati |
also... |
01:59 |
|
destinati |
note that once you do the "for-each" your scope changes |
01:59 |
|
destinati |
to that of the datafield tag |
02:00 |
|
destinati |
so if inside of the for-each you put <xsl:value-of select="marc:datafield/@tag"/> |
02:00 |
|
destinati |
you'll get nowhere |
02:00 |
|
destinati |
because that would need an XML structure of |
02:00 |
|
destinati |
<datafield><datafield> |
02:00 |
|
destinati |
remember.. XSL is all about where are you in the XML doc |
02:01 |
|
destinati |
since you are already in a datafield element tag |
02:01 |
|
destinati |
you can just put "@tag" |
02:01 |
|
destinati |
since that means "where I am now, take the tag attribute" |
02:01 |
|
destinati |
I need to get going |
02:02 |
|
destinati |
hopefully some of what I said was helpful.. and didn't get you offtrack |
02:02 |
|
destinati |
XML is very powerful and once you get the hang of it.. it'll make even more sense.. and you'll see the real power |
02:03 |
|
destinati |
Good Luck, talk to you later |
02:04 |
|
kados |
cool ...thanks for the explaination ... I'll try to apply it |
02:04 |
|
kados |
ciao |
02:04 |
|
destinati |
:) |