IRC log for #koha, 2005-10-31

← Previous day | Today | Next day → | Search | Index

All times shown according to UTC.

Time Nick Message
12:12 kados paul around?
12:13 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 hi :-)
12:13 paul (working today, then leaving for 3 days with family. TGV in less than 1 hour)
12:13 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 (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 yes but no. if we revert to 2.0, then another annoying problem comes around.
12:15 could you open a bug pls. i'll try to fix it correctly.
12:15 kados sure ... here's an idea ...
12:15 what if there is no isbn found ... so Koha automatically puts one in ...
12:16 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 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 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 then add &subsearch=rss to the end of the url
15:08 kados bloglines reports no feeds ..
15:08 not found via browser
15:08 chris eg
15:08 http://opac.hlt.katipo.co.nz/c[…]ogs&Go.x=0&Go.y=0
15:09 kados 3hmm ...
15:09 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 ok
15:10 chris its pretty easy
15:10 you just make a rss template
15:10 kados http://liblime.com/opensearchproxy.html
15:10 seen that?
15:10 chris and tell it to use that
15:10 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 well and rss has the whole versioning problem
15:12 chris i dont think its really a problem
15:12 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 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 could use something like that,except it says rss feed of this page
15:15 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 i was just thinking (as u do early on sunday morning)
15:17 "its all just templates"
15:18 kados yep :-)
15:18 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 it's a completely client-side portal in fact ... done in javascript
15:20 and using that we can add any opensearch source for federated searching
15:21 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 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 naw dont need it
15:23 kados how are you handleing XML through HTML::TEmplate?
15:23 just changing the header and encoding?
15:23 chris yeah
15:23 kados yea ... that's what I did too
15:24 just wanted to make sure I did it right ;-)
15:24 chris html::template is a bit of a misname
15:24 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 sweetness
15:25 chris thats the plan
15:25 kados owen: better get right on that ;-)
15:25 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 so all a tempalte designer needs to do is see what xml exists and then modify the html template accordingly
15:26 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 much simpler than html
15:27 kados hmmm ... brainstorming here ...
15:27 what if instead of PROG templates in HTML there were PROG templates in XML
15:28 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 and it could be 'versioned' so with every release of Koha there'd be updates to the DT
15:29 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 ditto
15:30 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 Or specifically importing MARC
23:05 Anyone out there? :)
23:11 I have a crazy idea to get around the Z3950 problem on windows that just might work
23:11 but I wanted to run it by someone that's familiar with Koha's code
23:35 kados woot! chris around?
23:36 just worked up the first working demo of an XMLHttpRequest marc editor that uses xslt to process the records
23:36 http://bobcat2.cs.ohiou.edu/
23:36 well ... can't edit just yet ;-)
23:36 but the search and display is working
23:36 this xslt stuff is really powerful
23:39 destinati I use XSLT quite a bit at work
23:40 It's really nice if you have a XSLT debugger
23:40 like Visual Studio 2005
23:42 Kados?
23:46 kados yea ... I'm here
23:48 destinati :) I commend you
23:48 Even though I run XP, I still use GVIM/VIM to edit text files
23:49 I'm not familiar with your project, but if you have general XSLT questions I might be able to help
23:49 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 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 <input value=<xsl:value-of select="."/></input>
23:50 destinati no, you don't want to do that
23:51 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 remember.. it has to be a valid XML document
23:52 this is how XSLT gets around the issue
23:55 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 this is throwing an error
23:56 destinati oops.. I forgot to close the attribute tag
23:56 <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute>
23:57 kados got it
23:57 http://bobcat2.cs.ohiou.edu/
23:57 this is the beginnings of an open-source MARC record retriever and editor ;-)
23:58 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 well it's really just an infant ;-)
23:58 destinati: what's your goal?
23:58 destinati I have to run Koha on Windows
23:59 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 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 and have Koha magically pull in all the data from the library of congress's MARCXML gateway
00:00 kados hmmm ...
00:00 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 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 I know because I'm sponsoring it ;-)
00:02 destinati Sponsoring who?
00:02 the class?
00:02 kados so ... it's complex
00:02 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 and we're paying Index Data (http://indexdata.dk) to create Perl_ZOOM
00:03 :-)
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 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 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 but that was going to be a hack
00:05 kados yea ... I'd wait around for Koha 3.0
00:05 where it'll be done right ;-)
00:06 should be ready first quarter of 2006
00:06 and if you want to sponsor anything (or hack on anything) please let us know
00:06 I'm the release manager
00:06 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 so I might have to hack this until Koha 3.0 is available
00:07 kados so have you considered hosted solutions?
00:07 my company offers them :-)
00:07 here's one of our client's OPACs:
00:07 https://libcat.nbbc.edu
00:08 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 so nothing's cheaper than linux
00:09 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 The idea is to try it out on this box
00:10 kados I've got tons of windows programs installed
00:10 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 what if you used a third-part MARC editor for the time being
00:11 until KOha's is ready for windows
00:12 bookwhere is a good Z39.50 retrieval tool
00:12 and you can use TLC's editor fairly cheaply
00:12 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 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 low end from Dell
00:14 kados not too bad
00:14 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 especially when others might benefit
00:15 I work at Raytheon
00:15 kados much experience with javascript?
00:16 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 so say I've got that stylesheet above
00:16 and i want to make a bunch of inputs and labels for each tag/subfield in the doc
00:17 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 ye
00:17 http://bobcat2.cs.ohiou.edu/cg[…]&searchbox=qwerty
00:18 that's an example ... but of course, since it's MARC it's wildly variable
00:18 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 yea
00:19 destinati what you want to do is make use of the xsl:for-each
00:19 command
00:19 so.. something like
00:20 <xsl:for-each select="datafield">
00:20 then... inside of this you're in scope of a datafield tag
00:21 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/) &gt; 0
00:21 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 There are several XML editors on Windows at least that do full XSLT intellisense
00:22 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 absolutely
00:23 kados sweet!
00:23 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 it cut the code down immensely
00:24 now.. all the database does is spit out a XML file
00:24 and the XSLT does a whole bunch of processing
00:24 kados yea ... this might be just what Koha needs
00:25 none of us have use XML that much
00:25 used that is
00:25 so how do I display @tag?
00:26 within datafield?
00:26 destinati remember that in XSLT, you find the value of any variable using select
00:26 so..
00:26 if the context is the datafield node
00:26 <xsl:value-of select="@tag"/>
00:26 kados sweet
00:27 destinati Ideally, Koha would have a web service oriented architecture..
00:27 that way you could use a lot of the tools to write simple interfaces to Koha
00:27 using things like SOAP
00:28 it sounds like a lot of buzzwords
00:28 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 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 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 do you have a Koha installed?
00:30 destinati Yeah, 2.2.4
00:30 kados everything is templates
00:30 all the interfaces
00:30 look in koha/koha-tmpl/intranet-tmpl/npl/en/
00:31 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 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 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 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 I think...
00:42 so, what you're saying is..
00:42 "at the root, apply all templates that you can"
00:42 the for-each is ignored
00:42 and then the specific templates might be matched
00:42 kados gotcha
00:43 destinati simply have a match of "marc:datafield"
00:43 or...
00:43 go one level higher
00:43 and match marc:record
00:43 or..
00:44 have another template that doesn't do a match
00:44 but that is named something like
00:44 kados hmmm ...
00:44 destinati <xsl:template name="showdatafields">
00:44 ..
00:44 then
00:44 <xsl:foreach select = "//datafield">
00:45 this xpath expression will select all datafields from the current node and below in the XML tree
00:45 then, in your root template
00:45 you could do an xsl:call-template
00:46 <xsl:call-template name="showdatafields"/>
00:46 all depends on your preferences
00:46 and where you're going to take it..
00:48 nothing is preventing you from having another XML file that defines the MARC fields
00:48 and then using XSLT to get that data using XPATH
00:49 kados that's what I'm doing I think
00:49 xmlns:marc="http://www.loc.gov/MARC21/slim"
00:49 destinati 404
00:50 maybe there is a nice schema...
00:50 got it
00:51 well the schema doesn't define each marc code
00:51 kados hmmm ...
00:51 so I can't really get the inputs to show up from showdatafields
00:52 destinati you can
00:52 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 then when the user hits F1
00:52 a help pops up with explaination of the current field
00:53 but that's another whole stylesheet ;-)
00:53 right now I just need to get label and input showing up ;-)
00:53 here's what I've got:
00:53 http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl
00:55 destinati replace marc:datafield with //datafield
00:55 hmm.. I should probably copy the info locally
00:55 kados ok tried that an still doesn't work
00:56 yea ... LOC is really slow ;-)
00:56 destinati One minute.. I'll setup a sample project
01:02 a few typos maybe..
01:03 hmm.. you're not getting proper XML back either
01:03 for example
01:03 &
01:03 instead of &amp;
01:04 well, maybe not
01:04 maybe I copied wrong
01:04 one sec
01:04 hehe
01:04 that was it
01:04 kados it should be valid xml ...
01:05 no?
01:05 typos?
01:06 destinati I was viewing the XML in FireFox
01:06 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 :)
01:07 kados I've got <xsl:template name="showdatafields" match="marc:datafield">
01:07 now
01:08 does this mean I'm using the marc namespace?
01:08 and is that a good thing?
01:08 destinati one min.. now I've got it to where you are
01:10 <xsl:template name="showdatafields">
01:10  
01:10  <xsl:for-each select="//marc:datafield">
01:10 get rid of the match part of the template declaration
01:11 kados done
01:11 destinati <xsl:template name="showdatafields">
01:11 <xsl:for-each select="//marc:datafield">
01:11 <label>
01:11 <xsl:attribute name="for"><xsl:value-of select="@tag"/></xsl:attribute>
01:11 <xsl:value-of select="@tag"/>
01:11 </label>
01:11 <input>
01:11 <xsl:attribute name="id"><xsl:value-of select="@tag"/></xsl:attribute>
01:11 <xsl:attribute name="value"><xsl:value-of select="@tag"/></xsl:attribute>
01:11 </input>
01:11 </xsl:for-each>
01:11 </xsl:template>
01:13 kados is that what you're prescribing?
01:13 destinati Actually..
01:13 <xsl:template name="showdatafields">
01:13 <xsl:for-each select="//marc:datafield">
01:13 <xsl:sort select="@tag"/>
01:13 <label>
01:13 <xsl:attribute name="for"><xsl:value-of select="@tag"/></xsl:attribute>
01:13 <xsl:value-of select="@tag"/>
01:13 </label>
01:13 <input>
01:13 <xsl:attribute name="id"><xsl:value-of select="@tag"/></xsl:attribute>
01:13 <xsl:attribute name="value"><xsl:value-of select="@tag"/></xsl:attribute>
01:13 </input>
01:13 </xsl:for-each>
01:13 </xsl:template>
01:13 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 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 and then at the top of it.. put
01:16 <?xml-stylesheet type="text/xsl" href="marc.xsl"?>
01:16 that way.. all you have to do is save the XSL
01:16 and then refresh the XML view in your browser
01:16 I do that all the time
01:16 kados ahh ... good point
01:17 so I took the bottom stuff out of my xslt doc
01:18 and now it's just showing me a MARC string with no formatting at all:
01:18 http://bobcat2.cs.ohiou.edu/xsl/MARCEdit.xsl
01:18 any ideas?
01:19 destinati hmm
01:19 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 <xsl:template match="/">
01:20    <form>
01:20      <xsl:call-template name="showdatafields"/>
01:20    </form>
01:20  </xsl:template>
01:21 destinati you definitely need the root template
01:21 that's the first thing the XSL processor goes for
01:21 now, if you want to put the items inside of the <form> tag in another preference you can
01:21 or you can do everything inside the root template
01:21 it's up to you
01:22 but if you want to simplify things...
01:22 take the part from <xsl:template name="showdatafields"
01:22 to the end of that tag at the bottom
01:22 get rid of the template outer tag
01:22 and put it inside the <form> tag
01:23 that way you make it simpler
01:23 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 now you can get rid of the call-template :)
01:24 think of templates as sort of similar to functions in perl
01:24 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 instead of nicely formatted inputs I'm just getting a MARC string when I click on each record
01:25 do you have the whole app running locally?
01:25 http://bobcat2.cs.ohiou.edu/
01:25 ?
01:25 destinati Take an XML file generated from the query
01:26 then add <?xml-stylesheet type="text/xsl" href="MARCEdit.xsl"?> to the top of it
01:26 and put it in the same directory as the XSL
01:26 then view that XML in firefox
01:27 also.. don't be afraid to do a ggVg= in vim
01:27 :)
01:27 kados :-)
01:27 destinati er
01:27 ggVG=
01:28 kados so what does the xmlns:marc="http://www.loc.gov/MARC21/slim" do for me?
01:28 it's at the top of my .xls
01:28 could that be the problem?
01:28 (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 named marc
01:28 kados that's what I thought
01:29 so marc:datafield is referencing that right?
01:29 should it be //marc:datafield or just marc:datafield?
01:29 destinati you don't need the exclude part at the top
01:30 it depends on how you're processing the XSL
01:30 try "//datafield" instead of "//marc:datafield"
01:30 the "//" part is an XPath expression that says "look everywhere below my current position in the XML tree"
01:31 it's a bit confusing
01:31 kados hmmm ... no luck
01:32 destinati what is doing the XSL processing
01:32 how are you invoking it?
01:32 kados hmmm ...
01:32 it's in javascript
01:32 and I can get some xsl processing to work ...
01:33 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 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 have you tried it:
01:35 http://bobcat2.cs.ohiou.edu/
01:35 do a search (I use 'qwerty' as a keyword)
01:36 it will return a list of records
01:36 click on one and the right-hand side will display a MARC string
01:37 that is supposed to be generated by the xslt transformation
01:38 destinati seems like you're getting just the xml
01:38 for example, put a "HELLO WORLD!" above the <form>
01:39 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 <?xml version="1.0" encoding="ISO-8859-1"?>
01:40 <xsl:stylesheet version="1.0"
01:40 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
01:41 well.. you can even add the exclude part before the >
01:41 although I've never used exclude-result-prefixes before
01:42 <?xml version="1.0" encoding="ISO-8859-1"?>
01:42 <xsl:stylesheet version="1.0"
01:42 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="marc">
01:43 kados what about the marc: namespage?
01:43 namespace even
01:44 hehe
01:44 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 right
01:47 all I've changed is the stylesheet ;-)
01:47 right loadRecord handles the onclick event
01:48 destinati I haven't dabbled to much in JavaScript, but...
01:49 are you using processed at all?
01:49 yes
01:49 in the append
01:49 kados yea ... afaik it's the fragment
01:50 var processed = processor.transformToFragment(myRecord,document);
01:54 destinati I'm not sure about the javascript, I haven't used that before
01:54 but if you take your current XSL
01:55 and replace the select="marc:datafield"
01:55 with select="//marc:datafield"
01:55 and then take a sample XML output
01:55 and put the processing tags that I mentioned way above
01:55 it works
01:55 so the problem lies in the javascript
01:56 keep in mind that you have to put "//marc:datafield" instead of "marc:datafield"
01:56 because
01:56 of where you are in the XML tree at the time you do the for-each
01:56 you're one above the <collection>
01:56 that is.. the root
01:56 so you could put...
01:57 <xsl:for-each select="/marc:collection/ma​rc:record/marc:datafield">
01:57 or
01:57 <xsl:for-each select="//marc:datafield">
01:57 they both will get you what you want
01:57 the bottom has a cleaner XPath
01:58 if you just put <xsl:for-each select="marc:datafield">
01:58 you'll get nowhere
01:58 because at that point
01:58 in the tree the items to iterate through are just... <marc:collection>
01:58 does that make sense?
01:59 also...
01:59 note that once you do the "for-each" your scope changes
01:59 to that of the datafield tag
02:00 so if inside of the for-each you put <xsl:value-of select="marc:datafield/@tag"/>
02:00 you'll get nowhere
02:00 because that would need an XML structure of
02:00 <datafield><datafield>
02:00 remember.. XSL is all about where are you in the XML doc
02:01 since you are already in a datafield element tag
02:01 you can just put "@tag"
02:01 since that means "where I am now, take the tag attribute"
02:01 I need to get going
02:02 hopefully some of what I said was helpful.. and didn't get you offtrack
02:02 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 Good Luck, talk to you later
02:04 kados cool ...thanks for the explaination ... I'll try to apply it
02:04 ciao
02:04 destinati :)

← Previous day | Today | Next day → | Search | Index

koha1