Extracting Essay Ids

THL Toolbox > Developers' Zone > Web Development > XML Books > Extracting Essay IDs

Extracting Essay IDs

Contributor(s); Than Grove, Steven Weinberger

From Than Grove, 2010-08-10: I set up a cocoon pipeline that should work for any book on the cocoon/texts/book site. It should also work for essays etc but I haven't had time to test that yet and there may be glitches.

If you use the following URL: external link: http://local.thlib.org:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=3
Note: If your localhost address may be different, if the above address is erroneous, try: external link: http://localhost:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=3

Then it gives you a list of: id numbers and the head text for that id, down to the div3s.

If you use: external link: http://local.thlib.org:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=2&lang=wyl
Note: If your localhost address may be different, if the above address is erroneous, try: external link: http://localhost:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=2&lang=wyl

it gives you: id #, Unicode Tibetan of Head, the Wylie Head text down to level of div2s.

If you use:external link: http://local.thlib.org:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=4&lang=tib
Note: If your localhost address may be different, if the above address is erroneous, try: external link: http://localhost:8080/cocoon/texts/books/bonpo-monasteries/ids/main.xml?l=4&lang=tib

It gives you: id#, Head in Unicode Tibetan, the head text converted into Wylie down to level of div4s (but there are no div4s in that document).

So the l param is the level to go down to, and the lang can be either "tib" if the header of each section is in Unicode Tibetan and it will translate it to Wylie. If lang=wyl, then it will translate Wylie headers into Unicode Tibetan. If no lang param is given, no conversion happens.

Provided for unrestricted use by the external link: Tibetan and Himalayan Library