/Users/andrea/_magisterarbeit/korpus/clean/testkorpus/32/file15.html NN ----------------------------------------- : Braille NP Info NP A DT Byte NN of IN Python NN Some DT tools NNS XSL NN Frequently RB Asked VVN Questions NNS . SENT . SENT . SENT XSLT JJ Terminology NN Printing NP Where WRB to TO Start NP XSLT NP Questions NNS and CC Answers NNS . SENT FO NP Questions NNS External NP Issues NPS . SENT . SENT . SENT . SENT . SENT . SENT Exclude VV Result NN Prefix NN Exslt NP Filename NP Filters VVZ Flatten NP a DT structure NN Flat JJ file NN transformation NN . SENT . SENT . SENT Filters NNS 1 CD . SENT Extracting VVG file NN name NN 2 CD . SENT How WRB to TO eliminate VV duplicates NNS 3 CD . SENT Apply VV templates NNS question NN 4 CD . SENT How WRB can MD I PP filter VV out RP certain JJ words NNS 1 CD . SENT Extracting VVG file NN name NN David NP Carlisle NP I PP have VHP need NN to TO extract VV the DT file NN name NN from IN a DT string NN returned VVN by IN unparsed JJ entity NN uri NP . SENT Obviously RB , , the DT path NN is VBZ dependent JJ on IN where WRB the DT file NN sits VVZ so IN it PP can MD be VB of IN arbitrary JJ length NN . SENT The DT string NN I PP am VBP dealing VVG with IN is VBZ something NN like IN file NN . SENT C LS . SENT foo NP bar NN somefile NN . SENT gif NN where WRB I PP need VVP the DT somefile NN . SENT gif NN string NN . SENT xsl NN . SENT call NN template NN name NN filename NN xsl NN . SENT with IN param NN name NN x SYM select JJ path NN xsl NN . SENT call NN template NN path NN is VBZ the DT expression NN with IN your PP$ path NN , , and CC filename NN template NN looks VVZ something NN like IN this DT . SENT xsl NN . SENT template NN name NN filename NN xsl NN . SENT param NN name NN x SYM xsl NN . SENT choose VV xsl NN . SENT when WRB test NN contains VVZ x NN , , xsl NN . SENT call NN template NN name NN filename NN xsl NN . SENT with IN param NN name NN x SYM select JJ substring NN after IN x NN , , xsl NN . SENT call NN template NN xsl NN . SENT when WRB xsl NN . SENT otherwise RB xsl NN . SENT value NN of IN select JJ x NN xsl NN . SENT otherwise RB xsl NN . SENT choose VV xsl NN . SENT template NN 2 CD . SENT How WRB to TO eliminate VV duplicates VVZ Phil NP Lanch NP My PP$ question NN is VBZ really RB how WRB to TO eliminate VV duplicates NNS , , counting VVG handle VV FOO NP handle VV and CC handle VV foo NP handle VV as IN duplicates NNS . SENT xsl NN . SENT variable JJ name NN up IN select JJ ABCDEFGHIJKLMNOPQRSTUVWXYZ NP xsl NN . SENT variable JJ name NN lo NP select JJ abcdefghijklmnopqrstuvwxyz NN xsl NN . SENT template NN match NN handle VV name NN handle VV xsl NN . SENT param NN name NN i NP select VVP 1 CD xsl NN . SENT choose VV xsl NN . SENT when WRB test NN position NN i NP last RB handle VV xsl NN . SENT value NN of IN select JJ translate VV . SENT , , up RB , , lo NP handle VVP xsl NN . SENT when WRB xsl NN . SENT when WRB test VVP not RB translate VV . SENT , , up RB , , lo NP translate VVP following VVG . SENT . SENT handle VV i NP , , up RB , , lo NP xsl NN . SENT call NN template NN name NN handle VV xsl NN . SENT with IN param NN name NN i NP select JJ i NP 1 CD xsl NN . SENT call NN template NN xsl NN . SENT when WRB xsl NN . SENT choose VV xsl NN . SENT template NN David NP Carlisle NP offered VVD this DT improvement NN . SENT xsl NN . SENT stylesheet NN xmlns NNS . SENT xsl NN http NN . SENT www JJ . SENT w NN 3 CD . SENT org NP 1999 NP XSL NP Transform VV version NN 1 CD . SENT 0 CD xsl NN . SENT variable JJ name NN up IN select JJ ABCDEFGHIJKLMNOPQRSTUVWXYZ NP xsl NN . SENT variable JJ name NN lo NP select JJ abcdefghijklmnopqrstuvwxyz NN xsl NN . SENT template NN match NN xsl NN . SENT apply VV templates NNS select VV handle VV xsl NN . SENT template NN xsl NN . SENT template NN match NN handle VV xsl NN . SENT if IN test NN not RB following VVG . SENT . SENT handle VV translate VV . SENT , , up RB , , lo NP translate VVP current JJ , , up RB , , lo NP xsl NN . SENT copy NN of IN select JJ . SENT xsl NN . SENT if IN xsl NN . SENT template NN xsl NN . SENT stylesheet NN To TO do VV this DT directly RB in IN xpath NN you PP would MD need VV a DT generalisation NN of IN current NN that WDT gave VVD the DT node NN current JJ outside IN the DT current JJ filter NN rather RB than IN the DT node NN current JJ at IN the DT start NN of IN the DT expression NN . SENT Of IN course NN the DT above IN probably RB results NNS in IN the DT current JJ node NN being VBG downcased VVN multiple JJ times NNS and CC it PP would MD be VB better JJR anyway RB not RB to TO use VV current JJ at IN all DT and CC just RB put VV the DT lowercase JJ of IN the DT current JJ node NN value NN into IN a DT variable NN . SENT 3 LS . SENT Apply VV templates NNS question VVP David NP Carlisle NP Is VBZ it PP possible JJ , , when WRB you PP apply VVP templates NNS , , to TO decide VV that IN it PP should MD apply VV from IN position NN 3 CD and CC onwards RB for IN the DT siblings NNS . SENT XML NP . SENT section NN item NN I PP am VBP item NN number NN 1 CD item NN item NN I PP am VBP item NN number NN 2 CD item NN item NN I PP am VBP item NN number NN 3 CD item NN item NN I PP am VBP item NN number NN 4 CD item NN section NN xsl NN . SENT template NN match NN section NN xsl NN . SENT apply VV templates NNS select VV following VVG sibling NN . SENT . SENT item NN position NN 3 CD you PP are VBP sat VVN at IN a DT section NN node NN , , and CC you PP have VHP asked VVN to TO go VV from IN there RB to TO the DT third JJ item NN node NN that WDT is VBZ a DT sibling NN of IN the DT current JJ node NN . SENT That DT isn't NN what WP you PP want VVP as IN the DT item NN nodes NNS are VBP children NNS of IN section NN , , and CC you PP want VVP all DT items NNS after IN position NN 2 CD , , not RB just RB the DT third JJ . SENT xsl NN . SENT template NN match NN section NN xsl NN . SENT apply VV templates NNS select JJ item NN position NN 2 CD 4 CD . SENT How WRB can MD I PP filter VV out RP certain JJ words NNS Jeni NP Tennison NP For IN example NN . SENT with IN input NN xmlfile NN book NN title NN The DT quick JJ brown JJ title NN book NN book NN title NN A DT little JJ knowledge NN is VBZ a DT dangerous JJ thing NN title NN book NN book NN title NN Is VBZ this DT the DT real JJ thing NN title NN book NN xmlfile NN How WRB to TO get VV output NN like IN result NN before IN The DT quick JJ brown JJ before RB after IN quick RB brown JJ after IN before IN A DT little JJ knowledge NN is VBZ a DT dangerous JJ thing NN before IN after IN little JJ knowledge NN is VBZ a DT dangerous JJ thing NN after IN before RB Is VBZ this DT the DT real JJ thing NN before IN after IN this DT the DT real JJ thing NN after IN result NN Adapting VVG Eric's NP solution NN . SENT The DT xsl NN . SENT stylesheet NN element NN declares VVZ the DT necessaries NN , , and CC the DT additional JJ namespace NN sw NN that WDT is VBZ used VVN for IN the DT internal JJ data NNS the DT list NN of IN stop NN words NNS . SENT To TO prevent VV this DT namespace NN being VBG declared VVN on IN your PP$ output NN , , use VV exclude VV result NN prefixes NNS . SENT xsl NN . SENT stylesheet NN version NN 1 CD . SENT 0 CD xmlns NNS . SENT xsl NN http NN . SENT www JJ . SENT w NN 3 CD . SENT org NP 1999 NP XSL NP Transform VV xmlns NNS . SENT sw JJ mailto NN . SENT vdv NN dyomedea NNS . SENT com NN exclude VVP result NN prefixes NNS sw JJ . SENT . SENT . SENT xsl NN . SENT stylesheet NN Then RB the DT declaration NN of IN the DT stop NN words NNS that IN you PP want VVP to TO filter NN out RP . SENT I've NP put VVD these DT in IN a DT variable NN so RB that IN they PP can MD be VB accessed VVN easily RB . SENT sw JJ . SENT stop VV word NN the DT word NN word NN a DT word NN word NN is VBZ word NN sw JJ . SENT stop NN xsl NN . SENT variable JJ name NN stop NN words NNS select VVP document NN xsl NN . SENT stylesheet NN sw NNS . SENT stop NN word NN Declaration NP of IN two CD variables NNS so RB that IN we PP can MD translate VV between IN upper JJ and CC lower JJR case NN fairly RB easily RB . SENT xsl NN . SENT variable JJ name NN lowercase JJ select JJ abcdefghijklmnopqrstuvwxyz NN xsl NN . SENT variable JJ name NN uppercase VV select JJ ABCDEFGHIJKLMNOPQRSTUVWXYZ NP Now RB the DT template NN . SENT I've NP only RB used VVD one CD for IN brevity NN , , but CC of IN course NN you PP can MD split VV it PP down RP into IN several JJ through IN calling VVG and CC applying VVG templates NNS . SENT Within IN this DT template NN , , I PP iterate VV through IN each DT of IN the DT titles NNS . SENT For IN each DT title NN , , I PP find VVP all PDT the DT stop NN words NNS such JJ that IN the DT current JJ title NN starts VVZ with IN that DT stop NN word NN plus CC a DT space NN , , and CC all DT ignoring VVG case NN . SENT If IN there EX is VBZ such PDT a DT match NN , , then RB the DT title NN is VBZ substring VVG ed NP to TO give VV the DT resulting VVG title NN by IN taking VVG off RP the DT characters NNS that WDT make VVP up RP the DT word NN it PP begins VVZ with IN . SENT xsl NN . SENT template NN match NN result NN xsl NN . SENT for IN each DT select JJ xmlfile JJ book NN title NN before IN xsl NN . SENT value NN of IN select JJ . SENT before IN xsl NN . SENT variable JJ name NN begins VVZ with IN select JJ stop NN words NNS starts VVP with IN translate VV current JJ , , uppercase JJ , , lowercase JJ , , concat NNS translate VVP . SENT , , uppercase VV , , lowercase VV , , after IN xsl NN . SENT choose VV xsl NN . SENT when WRB test NN begins VVZ with IN xsl NN . SENT value NN of IN select JJ substring NN . SENT , , string NN length NN begins VVZ with IN 2 CD xsl NN . SENT when WRB xsl NN . SENT otherwise RB xsl NN . SENT value NN of IN select JJ . SENT xsl NN . SENT otherwise RB xsl NN . SENT choose VV after IN xsl NN . SENT for IN each DT result NN xsl NN . SENT template NN This DT strips NNS leading VVG stop NN words NNS in IN SAXON NP and CC MSXML NP July NP . SENT It PP works VVZ in IN Xalan NP C NP v NN . SENT 0 CD . SENT 40 CD . SENT 0 CD except IN for IN the DT exclude VVP result NN prefixes NNS thing NN , , which WDT is VBZ ignored VVN . SENT However RB . SENT . SENT . SENT How WRB do VVP you PP XSL NN create VV a DT sort NN criterion NN . SENT . SENT . SENT . SENT you PP can't VVD at IN the DT moment NN use VV a DT template NN to TO create VV a DT string NN to TO use VV as IN a DT sort NN criterion NN . SENT Sort NN criteria NNS have VHP to TO be VB XPath NP select JJ expressions NNS . SENT This DT problem NN will MD go VV away RB when WRB a DT you PP can MD convert VV RTFs NP to TO node NN sets NNS and CC or CC b NN when WRB you PP can MD use VV something NN like IN saxon NP . SENT function NN to TO declare VV extension NN functions NNS within IN XSLT NP . SENT For IN the DT meantime NN , , then RB you PP have VHP to TO use VV something NN really RB horrible JJ like IN . SENT xsl NN . SENT template NN match NN result NN xsl NN . SENT for IN each DT select JJ xmlfile JJ book NN title NN xsl NN . SENT sort NN select JJ concat NN substring NN substring VVG after IN . SENT , , , , 0 CD div NN boolean JJ stop NN words NNS starts VVP with IN translate VV current JJ , , uppercase JJ , , lowercase JJ , , concat NNS translate VVP . SENT , , uppercase JJ , , lowercase JJ , , , , substring NN . SENT , , 0 CD div NN not RB stop VV words NNS starts VVZ with IN translate VV current JJ , , uppercase JJ , , lowercase JJ , , concat NNS translate VVP . SENT , , uppercase VV , , lowercase VV , , title NN xsl NN . SENT value NN of IN select JJ . SENT title NN xsl NN . SENT for IN each DT result NN xsl NN . SENT template NN Honestly RB , , it PP doesn't VVD look VV that DT much RB clearer JJR even RB when WRB it PP is VBZ indented VVN . SENT This DT works NNS in IN SAXON NP , , MSXML NP July NP and CC Xalan NP with IN the DT exception NN of IN the DT result NN prefixes VVZ thing NN . SENT HomeFeedbackCopyright NP 1999 CD 2005 CD Dave NP Pawson NP . SENT