Subject: RE: [xsl] creating canonRef from flat From: "Jim Fuller" <jim.fuller@xxxxxxxxxxxxxxxxxx> Date: Fri, 19 Sep 2003 15:58:14 +0100 |
check out the EXSLT string templates yes the first step is to tokenize everything, with the semicolon as delimiter ( use http://www.exslt.org/str/functions/tokenize/index.html ) in fact every step could just use this template, instead of using regexp; though I would probably crack the '3.1-12' string just using standard string functions. gl, jim fuller -----Original Message----- From: Jim_Albright@xxxxxxxxxxxx [mailto:Jim_Albright@xxxxxxxxxxxx] Sent: 19 September 2003 14:03 To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: [xsl] creating canonRef from flat Starting with <r>Mateus 3.1-12; Lucas 3.1-20; </r> I want <parallelPassage> <canonRef book="MAT" chapter="3" verse="1" verseEnd="12"/> <canonRef book="LUK" chapter="3" verse="1" verseEnd="20"/> </parallelPassage> I have just switched to 2.0 as it seemed the regular expressions would help me here. My thinking is to look in <r> and replace "Mateus" with "<book>MAT</book>" and "Lucas" with "<book>LUK</book>" ... and all the rest and in a second pass change <r><book>MAT</book> 3.1-12; <book>LUK</book> 3.1-20; </r> <r> <book>MAT</book> <chapter>3</chapter> <verse>1</verse> <verseEnd>12</verseEnd> <book>LUK</book> <chapter>3</chapter> <verse>1</verse> <verseEnd>20</verseEnd </r> and then put in final form in third pass <parallelPassage> <canonRef book="MAT" chapter="3" verse="1" verseEnd="12"/> <canonRef book="LUK" chapter="3" verse="1" verseEnd="20"/> </parallelPassage> Am I headed in the right direction? Or are there some really neat shortcuts? If I use replace will I need to have it nested 66 times to account for all books? Jim Albright 704 843-0582 Wycliffe Bible Translators XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] creating canonRef from fl, Michael Kay | Thread | AW: [xsl] xsl:result-document appen, Kloeck, Erwin |
Re: [xsl] creating canonRef from fl, David Carlisle | Date | RE: [xsl] Formatting XSL for XML to, Passin, Tom |
Month |