[{"data":1,"prerenderedAt":4043},["ShallowReactive",2],{"article_list_xslt_":3},[4,1852],{"_path":5,"_dir":6,"_draft":7,"_partial":7,"_locale":8,"title":9,"description":10,"publishDate":11,"tags":12,"image":17,"excerpt":10,"body":18,"_type":1843,"_id":1844,"_source":1845,"_file":1846,"_stem":1847,"_extension":1848,"author":1849},"/ckeefer/2013-2/xslt","2013-2",false,"","XML and XSLT","Not terribly long ago, XML was the darling of the web. HTML4 was reformulated as XHTML 1.0, SOAP messages were XML, and let us not forget XMLHttpRequest.","2013-10-08",[13,14,15,16],"data-formats","xml","xsl","xslt","/ckeefer/2013-2/img/xslt-processing.png",{"type":19,"children":20,"toc":1834},"root",[21,64,78,92,99,114,123,128,134,147,153,158,164,169,183,196,482,495,852,882,895,908,1702,1707,1713,1718,1723,1744,1750,1755,1769,1774,1779,1785,1790,1814,1828],{"type":22,"tag":23,"props":24,"children":25},"element","p",{},[26,29,38,40,47,49,62],{"type":27,"value":28},"text","Not terribly long ago, XML was the darling of the web. HTML4 was reformulated as ",{"type":22,"tag":30,"props":31,"children":35},"a",{"href":32,"rel":33},"http://en.wikipedia.org/wiki/Xhtml",[34],"nofollow",[36],{"type":27,"value":37},"XHTML 1.0",{"type":27,"value":39},", ",{"type":22,"tag":30,"props":41,"children":44},{"href":42,"rel":43},"http://en.wikipedia.org/wiki/SOAP",[34],[45],{"type":27,"value":46},"SOAP",{"type":27,"value":48}," messages were XML, and let us not forget ",{"type":22,"tag":30,"props":50,"children":53},{"href":51,"rel":52},"http://en.wikipedia.org/wiki/XMLHttpRequest",[34],[54,60],{"type":22,"tag":55,"props":56,"children":57},"strong",{},[58],{"type":27,"value":59},"XML",{"type":27,"value":61},"HttpRequest",{"type":27,"value":63},".",{"type":22,"tag":23,"props":65,"children":66},{},[67,69,76],{"type":27,"value":68},"XML's 15 minutes of fame came and went, however, when JSON entered the scene. Your ajax request today is far more likely to receive a JSON return that can parsed into native objects than an XML document that has to be parsed like markup; HTML5 ",{"type":22,"tag":30,"props":70,"children":73},{"href":71,"rel":72},"http://www.ibm.com/developerworks/library/x-think45/#N100DE",[34],[74],{"type":27,"value":75},"parted ways with XML compliance",{"type":27,"value":77},"; REST replaced SOAP for most development (and while you can, of course, send and receive XML with REST, its certainly less common).",{"type":22,"tag":23,"props":79,"children":80},{},[81,83,90],{"type":27,"value":82},"XML's passing is hardly to be lamented - JSON really is the better choice in many instances. But out of XML's celebrity status, its human-readable/editable similarity to markup, and the need/desire to employ it in a wide variety of scenarios, came some interesting benefits that linger today - one of them being Extensible Stylesheet Language Transformations (XSLT). As promised ",{"type":22,"tag":30,"props":84,"children":87},{"href":85,"rel":86},"http://blog.artlogic.com/2013/08/29/client-side-fulltext-searching-with-fullproof/",[34],[88],{"type":27,"value":89},"previously",{"type":27,"value":91}," let's take a look at what XSLT is, and what it can offer us.",{"type":22,"tag":93,"props":94,"children":96},"h4",{"id":95},"so-what-is-xslt",[97],{"type":27,"value":98},"So what is XSLT?",{"type":22,"tag":23,"props":100,"children":101},{},[102,104,112],{"type":27,"value":103},"Per ",{"type":22,"tag":30,"props":105,"children":109},{"href":106,"rel":107,"title":108},"https://developer.mozilla.org/en-US/docs/XSLT",[34],"Mozilla Developer Network",[110],{"type":27,"value":111},"MDN",{"type":27,"value":113},":",{"type":22,"tag":115,"props":116,"children":117},"blockquote",{},[118],{"type":22,"tag":23,"props":119,"children":120},{},[121],{"type":27,"value":122},"[XSLT] is an XML-based language used, in conjunction with specialized processing software, for the transformation of XML documents. Although the process is referred to as \"transformation,\" the original document is not changed; rather, a new XML document is created based on the content of an existing document. Then, the new document may be serialized (output) by the processor in standard XML syntax or in another format, such as HTML or plain text.",{"type":22,"tag":23,"props":124,"children":125},{},[126],{"type":27,"value":127},"So, let's break this into a problem/solution formulation.",{"type":22,"tag":93,"props":129,"children":131},{"id":130},"problem",[132],{"type":27,"value":133},"Problem:",{"type":22,"tag":23,"props":135,"children":136},{},[137,139,145],{"type":27,"value":138},"You need an [client|user]-editable document in markup-like format (or just want to completely separate content from presentation details), that nonetheless will not be markup -- maybe you don't want to burden the client/user with needing to understand the structure of an html document, maybe it needs to contain (meta-)data that html doesn't easily accommodate, maybe the data contained therein needs to be transformed in various ways, or it needs to be transformed into multiple formats (i.e. not just HTML, but also PDF or Postscript, and you don't want to rely on tools like ",{"type":22,"tag":30,"props":140,"children":142},{"href":141},"code.google.com/p/wkhtmltopdf/",[143],{"type":27,"value":144},"wkhtmltopdf",{"type":27,"value":146},".)",{"type":22,"tag":93,"props":148,"children":150},{"id":149},"solution",[151],{"type":27,"value":152},"Solution:",{"type":22,"tag":23,"props":154,"children":155},{},[156],{"type":27,"value":157},"XML+XSLT. If it seems like you'd need a a fairly specific set of circumstances to ever need to delve into this tech, you'd be right -- XSLT isn't particularly common for just that reason. When the circumstances do crop up, however, it can prove the best tool for the job. There are some pitfalls to watch out for, though - especially if you're hoping to use the support baked into many modern browsers.",{"type":22,"tag":93,"props":159,"children":161},{"id":160},"examples",[162],{"type":27,"value":163},"Examples",{"type":22,"tag":23,"props":165,"children":166},{},[167],{"type":27,"value":168},"Some easily available references (listed below) can offer you a full picture of what XSLT (or at least, XSLT 1.0, which is the form baked into most modern browsers) looks like. Rather than reproduce that detail, let's take a look at what an XSL document might look like.",{"type":22,"tag":23,"props":170,"children":171},{},[172,174,181],{"type":27,"value":173},"The general structure of a well-formed XSLT document will be modular - you want to take advantage of ",{"type":22,"tag":175,"props":176,"children":178},"code",{"className":177},[],[179],{"type":27,"value":180},"xsl:template",{"type":27,"value":182},"s to seperate concerns, keeping your code well-organized and potentially reusable. Often times you'll nest template calls within templates with increasing specificity, or to target other parts of the xml document you want to include within the structure of your new document at a certain place.",{"type":22,"tag":23,"props":184,"children":185},{},[186,188,194],{"type":27,"value":187},"For instance, let's consider this snippet, which describes a side-nav element for an html transformation for some xml (in the ",{"type":22,"tag":30,"props":189,"children":191},{"href":190},"www.docbook.org/",[192],{"type":27,"value":193},"Docbook",{"type":27,"value":195}," format):",{"type":22,"tag":197,"props":198,"children":202},"pre",{"className":199,"code":200,"language":201,"meta":8,"style":8},"language-html shiki shiki-themes github-light github-dark","\u003Cdiv class=\"sidebar affix\">\n    \u003Cdiv id=\"tabContent\" class=\"tab-content\">\n        \u003Cdiv id=\"tocTab\" class=\"tab-pane active\">\n            \u003Cul class=\"nav nav-list\">\n                \u003Cxsl:apply-templates select=\"//book\">\n                \u003C/xsl:apply-templates>\n            \u003C/ul>\n        \u003C/div>\n    \u003C/div>\n\u003C/div>\n","html",[203],{"type":22,"tag":175,"props":204,"children":205},{"__ignoreMap":8},[206,246,290,333,364,397,414,431,448,465],{"type":22,"tag":207,"props":208,"children":211},"span",{"class":209,"line":210},"line",1,[212,218,224,230,235,241],{"type":22,"tag":207,"props":213,"children":215},{"style":214},"--shiki-default:#24292E;--shiki-dark:#E1E4E8",[216],{"type":27,"value":217},"\u003C",{"type":22,"tag":207,"props":219,"children":221},{"style":220},"--shiki-default:#22863A;--shiki-dark:#85E89D",[222],{"type":27,"value":223},"div",{"type":22,"tag":207,"props":225,"children":227},{"style":226},"--shiki-default:#6F42C1;--shiki-dark:#B392F0",[228],{"type":27,"value":229}," class",{"type":22,"tag":207,"props":231,"children":232},{"style":214},[233],{"type":27,"value":234},"=",{"type":22,"tag":207,"props":236,"children":238},{"style":237},"--shiki-default:#032F62;--shiki-dark:#9ECBFF",[239],{"type":27,"value":240},"\"sidebar affix\"",{"type":22,"tag":207,"props":242,"children":243},{"style":214},[244],{"type":27,"value":245},">\n",{"type":22,"tag":207,"props":247,"children":249},{"class":209,"line":248},2,[250,255,259,264,268,273,277,281,286],{"type":22,"tag":207,"props":251,"children":252},{"style":214},[253],{"type":27,"value":254},"    \u003C",{"type":22,"tag":207,"props":256,"children":257},{"style":220},[258],{"type":27,"value":223},{"type":22,"tag":207,"props":260,"children":261},{"style":226},[262],{"type":27,"value":263}," id",{"type":22,"tag":207,"props":265,"children":266},{"style":214},[267],{"type":27,"value":234},{"type":22,"tag":207,"props":269,"children":270},{"style":237},[271],{"type":27,"value":272},"\"tabContent\"",{"type":22,"tag":207,"props":274,"children":275},{"style":226},[276],{"type":27,"value":229},{"type":22,"tag":207,"props":278,"children":279},{"style":214},[280],{"type":27,"value":234},{"type":22,"tag":207,"props":282,"children":283},{"style":237},[284],{"type":27,"value":285},"\"tab-content\"",{"type":22,"tag":207,"props":287,"children":288},{"style":214},[289],{"type":27,"value":245},{"type":22,"tag":207,"props":291,"children":293},{"class":209,"line":292},3,[294,299,303,307,311,316,320,324,329],{"type":22,"tag":207,"props":295,"children":296},{"style":214},[297],{"type":27,"value":298},"        \u003C",{"type":22,"tag":207,"props":300,"children":301},{"style":220},[302],{"type":27,"value":223},{"type":22,"tag":207,"props":304,"children":305},{"style":226},[306],{"type":27,"value":263},{"type":22,"tag":207,"props":308,"children":309},{"style":214},[310],{"type":27,"value":234},{"type":22,"tag":207,"props":312,"children":313},{"style":237},[314],{"type":27,"value":315},"\"tocTab\"",{"type":22,"tag":207,"props":317,"children":318},{"style":226},[319],{"type":27,"value":229},{"type":22,"tag":207,"props":321,"children":322},{"style":214},[323],{"type":27,"value":234},{"type":22,"tag":207,"props":325,"children":326},{"style":237},[327],{"type":27,"value":328},"\"tab-pane active\"",{"type":22,"tag":207,"props":330,"children":331},{"style":214},[332],{"type":27,"value":245},{"type":22,"tag":207,"props":334,"children":336},{"class":209,"line":335},4,[337,342,347,351,355,360],{"type":22,"tag":207,"props":338,"children":339},{"style":214},[340],{"type":27,"value":341},"            \u003C",{"type":22,"tag":207,"props":343,"children":344},{"style":220},[345],{"type":27,"value":346},"ul",{"type":22,"tag":207,"props":348,"children":349},{"style":226},[350],{"type":27,"value":229},{"type":22,"tag":207,"props":352,"children":353},{"style":214},[354],{"type":27,"value":234},{"type":22,"tag":207,"props":356,"children":357},{"style":237},[358],{"type":27,"value":359},"\"nav nav-list\"",{"type":22,"tag":207,"props":361,"children":362},{"style":214},[363],{"type":27,"value":245},{"type":22,"tag":207,"props":365,"children":367},{"class":209,"line":366},5,[368,373,379,384,388,393],{"type":22,"tag":207,"props":369,"children":370},{"style":214},[371],{"type":27,"value":372},"                \u003C",{"type":22,"tag":207,"props":374,"children":376},{"style":375},"--shiki-default:#B31D28;--shiki-default-font-style:italic;--shiki-dark:#FDAEB7;--shiki-dark-font-style:italic",[377],{"type":27,"value":378},"xsl:apply-templates",{"type":22,"tag":207,"props":380,"children":381},{"style":226},[382],{"type":27,"value":383}," select",{"type":22,"tag":207,"props":385,"children":386},{"style":214},[387],{"type":27,"value":234},{"type":22,"tag":207,"props":389,"children":390},{"style":237},[391],{"type":27,"value":392},"\"//book\"",{"type":22,"tag":207,"props":394,"children":395},{"style":214},[396],{"type":27,"value":245},{"type":22,"tag":207,"props":398,"children":400},{"class":209,"line":399},6,[401,406,410],{"type":22,"tag":207,"props":402,"children":403},{"style":214},[404],{"type":27,"value":405},"                \u003C/",{"type":22,"tag":207,"props":407,"children":408},{"style":375},[409],{"type":27,"value":378},{"type":22,"tag":207,"props":411,"children":412},{"style":214},[413],{"type":27,"value":245},{"type":22,"tag":207,"props":415,"children":417},{"class":209,"line":416},7,[418,423,427],{"type":22,"tag":207,"props":419,"children":420},{"style":214},[421],{"type":27,"value":422},"            \u003C/",{"type":22,"tag":207,"props":424,"children":425},{"style":220},[426],{"type":27,"value":346},{"type":22,"tag":207,"props":428,"children":429},{"style":214},[430],{"type":27,"value":245},{"type":22,"tag":207,"props":432,"children":434},{"class":209,"line":433},8,[435,440,444],{"type":22,"tag":207,"props":436,"children":437},{"style":214},[438],{"type":27,"value":439},"        \u003C/",{"type":22,"tag":207,"props":441,"children":442},{"style":220},[443],{"type":27,"value":223},{"type":22,"tag":207,"props":445,"children":446},{"style":214},[447],{"type":27,"value":245},{"type":22,"tag":207,"props":449,"children":451},{"class":209,"line":450},9,[452,457,461],{"type":22,"tag":207,"props":453,"children":454},{"style":214},[455],{"type":27,"value":456},"    \u003C/",{"type":22,"tag":207,"props":458,"children":459},{"style":220},[460],{"type":27,"value":223},{"type":22,"tag":207,"props":462,"children":463},{"style":214},[464],{"type":27,"value":245},{"type":22,"tag":207,"props":466,"children":468},{"class":209,"line":467},10,[469,474,478],{"type":22,"tag":207,"props":470,"children":471},{"style":214},[472],{"type":27,"value":473},"\u003C/",{"type":22,"tag":207,"props":475,"children":476},{"style":220},[477],{"type":27,"value":223},{"type":22,"tag":207,"props":479,"children":480},{"style":214},[481],{"type":27,"value":245},{"type":22,"tag":23,"props":483,"children":484},{},[485,487,493],{"type":27,"value":486},"Unseen at the top is a tag which matches us to the root of the xml document. In the snippet above, for each ",{"type":22,"tag":175,"props":488,"children":490},{"className":489},[],[491],{"type":27,"value":492},"book",{"type":27,"value":494}," node we encounter, we're applying the relevant template:",{"type":22,"tag":197,"props":496,"children":499},{"className":497,"code":498,"language":14,"meta":8,"style":8},"language-xml shiki shiki-themes github-light github-dark","\u003C!--Template for book select on side nav -->\n\u003Cxsl:template match=\"book\">\n    \u003Ca href=\"#{@xml:id}\">\n        \u003Cli class=\"branch\">\n            \u003Ci class=\"more icon-chevron-right\">\u003C/i> \u003Cxsl:value-of select=\"info/title\" />\n        \u003C/li>\n    \u003C/a>\n    \u003Cdiv class=\"chapterSection\" style=\"display:none;\">\n        \u003Cul class=\"nav nav-list\">\n            \u003Cxsl:apply-templates select=\"chapter\">\n            \u003C/xsl:apply-templates>\n        \u003C/ul>\n    \u003C/div>\n\u003C/xsl:template>\n",[500],{"type":22,"tag":175,"props":501,"children":502},{"__ignoreMap":8},[503,512,541,570,599,661,676,691,733,760,788,804,820,836],{"type":22,"tag":207,"props":504,"children":505},{"class":209,"line":210},[506],{"type":22,"tag":207,"props":507,"children":509},{"style":508},"--shiki-default:#6A737D;--shiki-dark:#6A737D",[510],{"type":27,"value":511},"\u003C!--Template for book select on side nav -->\n",{"type":22,"tag":207,"props":513,"children":514},{"class":209,"line":248},[515,519,523,528,532,537],{"type":22,"tag":207,"props":516,"children":517},{"style":214},[518],{"type":27,"value":217},{"type":22,"tag":207,"props":520,"children":521},{"style":220},[522],{"type":27,"value":180},{"type":22,"tag":207,"props":524,"children":525},{"style":226},[526],{"type":27,"value":527}," match",{"type":22,"tag":207,"props":529,"children":530},{"style":214},[531],{"type":27,"value":234},{"type":22,"tag":207,"props":533,"children":534},{"style":237},[535],{"type":27,"value":536},"\"book\"",{"type":22,"tag":207,"props":538,"children":539},{"style":214},[540],{"type":27,"value":245},{"type":22,"tag":207,"props":542,"children":543},{"class":209,"line":292},[544,548,552,557,561,566],{"type":22,"tag":207,"props":545,"children":546},{"style":214},[547],{"type":27,"value":254},{"type":22,"tag":207,"props":549,"children":550},{"style":220},[551],{"type":27,"value":30},{"type":22,"tag":207,"props":553,"children":554},{"style":226},[555],{"type":27,"value":556}," href",{"type":22,"tag":207,"props":558,"children":559},{"style":214},[560],{"type":27,"value":234},{"type":22,"tag":207,"props":562,"children":563},{"style":237},[564],{"type":27,"value":565},"\"#{@xml:id}\"",{"type":22,"tag":207,"props":567,"children":568},{"style":214},[569],{"type":27,"value":245},{"type":22,"tag":207,"props":571,"children":572},{"class":209,"line":335},[573,577,582,586,590,595],{"type":22,"tag":207,"props":574,"children":575},{"style":214},[576],{"type":27,"value":298},{"type":22,"tag":207,"props":578,"children":579},{"style":220},[580],{"type":27,"value":581},"li",{"type":22,"tag":207,"props":583,"children":584},{"style":226},[585],{"type":27,"value":229},{"type":22,"tag":207,"props":587,"children":588},{"style":214},[589],{"type":27,"value":234},{"type":22,"tag":207,"props":591,"children":592},{"style":237},[593],{"type":27,"value":594},"\"branch\"",{"type":22,"tag":207,"props":596,"children":597},{"style":214},[598],{"type":27,"value":245},{"type":22,"tag":207,"props":600,"children":601},{"class":209,"line":366},[602,606,611,615,619,624,629,633,638,643,647,651,656],{"type":22,"tag":207,"props":603,"children":604},{"style":214},[605],{"type":27,"value":341},{"type":22,"tag":207,"props":607,"children":608},{"style":220},[609],{"type":27,"value":610},"i",{"type":22,"tag":207,"props":612,"children":613},{"style":226},[614],{"type":27,"value":229},{"type":22,"tag":207,"props":616,"children":617},{"style":214},[618],{"type":27,"value":234},{"type":22,"tag":207,"props":620,"children":621},{"style":237},[622],{"type":27,"value":623},"\"more icon-chevron-right\"",{"type":22,"tag":207,"props":625,"children":626},{"style":214},[627],{"type":27,"value":628},">\u003C/",{"type":22,"tag":207,"props":630,"children":631},{"style":220},[632],{"type":27,"value":610},{"type":22,"tag":207,"props":634,"children":635},{"style":214},[636],{"type":27,"value":637},"> \u003C",{"type":22,"tag":207,"props":639,"children":640},{"style":220},[641],{"type":27,"value":642},"xsl:value-of",{"type":22,"tag":207,"props":644,"children":645},{"style":226},[646],{"type":27,"value":383},{"type":22,"tag":207,"props":648,"children":649},{"style":214},[650],{"type":27,"value":234},{"type":22,"tag":207,"props":652,"children":653},{"style":237},[654],{"type":27,"value":655},"\"info/title\"",{"type":22,"tag":207,"props":657,"children":658},{"style":214},[659],{"type":27,"value":660}," />\n",{"type":22,"tag":207,"props":662,"children":663},{"class":209,"line":399},[664,668,672],{"type":22,"tag":207,"props":665,"children":666},{"style":214},[667],{"type":27,"value":439},{"type":22,"tag":207,"props":669,"children":670},{"style":220},[671],{"type":27,"value":581},{"type":22,"tag":207,"props":673,"children":674},{"style":214},[675],{"type":27,"value":245},{"type":22,"tag":207,"props":677,"children":678},{"class":209,"line":416},[679,683,687],{"type":22,"tag":207,"props":680,"children":681},{"style":214},[682],{"type":27,"value":456},{"type":22,"tag":207,"props":684,"children":685},{"style":220},[686],{"type":27,"value":30},{"type":22,"tag":207,"props":688,"children":689},{"style":214},[690],{"type":27,"value":245},{"type":22,"tag":207,"props":692,"children":693},{"class":209,"line":433},[694,698,702,706,710,715,720,724,729],{"type":22,"tag":207,"props":695,"children":696},{"style":214},[697],{"type":27,"value":254},{"type":22,"tag":207,"props":699,"children":700},{"style":220},[701],{"type":27,"value":223},{"type":22,"tag":207,"props":703,"children":704},{"style":226},[705],{"type":27,"value":229},{"type":22,"tag":207,"props":707,"children":708},{"style":214},[709],{"type":27,"value":234},{"type":22,"tag":207,"props":711,"children":712},{"style":237},[713],{"type":27,"value":714},"\"chapterSection\"",{"type":22,"tag":207,"props":716,"children":717},{"style":226},[718],{"type":27,"value":719}," style",{"type":22,"tag":207,"props":721,"children":722},{"style":214},[723],{"type":27,"value":234},{"type":22,"tag":207,"props":725,"children":726},{"style":237},[727],{"type":27,"value":728},"\"display:none;\"",{"type":22,"tag":207,"props":730,"children":731},{"style":214},[732],{"type":27,"value":245},{"type":22,"tag":207,"props":734,"children":735},{"class":209,"line":450},[736,740,744,748,752,756],{"type":22,"tag":207,"props":737,"children":738},{"style":214},[739],{"type":27,"value":298},{"type":22,"tag":207,"props":741,"children":742},{"style":220},[743],{"type":27,"value":346},{"type":22,"tag":207,"props":745,"children":746},{"style":226},[747],{"type":27,"value":229},{"type":22,"tag":207,"props":749,"children":750},{"style":214},[751],{"type":27,"value":234},{"type":22,"tag":207,"props":753,"children":754},{"style":237},[755],{"type":27,"value":359},{"type":22,"tag":207,"props":757,"children":758},{"style":214},[759],{"type":27,"value":245},{"type":22,"tag":207,"props":761,"children":762},{"class":209,"line":467},[763,767,771,775,779,784],{"type":22,"tag":207,"props":764,"children":765},{"style":214},[766],{"type":27,"value":341},{"type":22,"tag":207,"props":768,"children":769},{"style":220},[770],{"type":27,"value":378},{"type":22,"tag":207,"props":772,"children":773},{"style":226},[774],{"type":27,"value":383},{"type":22,"tag":207,"props":776,"children":777},{"style":214},[778],{"type":27,"value":234},{"type":22,"tag":207,"props":780,"children":781},{"style":237},[782],{"type":27,"value":783},"\"chapter\"",{"type":22,"tag":207,"props":785,"children":786},{"style":214},[787],{"type":27,"value":245},{"type":22,"tag":207,"props":789,"children":791},{"class":209,"line":790},11,[792,796,800],{"type":22,"tag":207,"props":793,"children":794},{"style":214},[795],{"type":27,"value":422},{"type":22,"tag":207,"props":797,"children":798},{"style":220},[799],{"type":27,"value":378},{"type":22,"tag":207,"props":801,"children":802},{"style":214},[803],{"type":27,"value":245},{"type":22,"tag":207,"props":805,"children":807},{"class":209,"line":806},12,[808,812,816],{"type":22,"tag":207,"props":809,"children":810},{"style":214},[811],{"type":27,"value":439},{"type":22,"tag":207,"props":813,"children":814},{"style":220},[815],{"type":27,"value":346},{"type":22,"tag":207,"props":817,"children":818},{"style":214},[819],{"type":27,"value":245},{"type":22,"tag":207,"props":821,"children":823},{"class":209,"line":822},13,[824,828,832],{"type":22,"tag":207,"props":825,"children":826},{"style":214},[827],{"type":27,"value":456},{"type":22,"tag":207,"props":829,"children":830},{"style":220},[831],{"type":27,"value":223},{"type":22,"tag":207,"props":833,"children":834},{"style":214},[835],{"type":27,"value":245},{"type":22,"tag":207,"props":837,"children":839},{"class":209,"line":838},14,[840,844,848],{"type":22,"tag":207,"props":841,"children":842},{"style":214},[843],{"type":27,"value":473},{"type":22,"tag":207,"props":845,"children":846},{"style":220},[847],{"type":27,"value":180},{"type":22,"tag":207,"props":849,"children":850},{"style":214},[851],{"type":27,"value":245},{"type":22,"tag":23,"props":853,"children":854},{},[855,857,863,865,871,873,880],{"type":27,"value":856},"And the above snippet shows our template, with its ",{"type":22,"tag":175,"props":858,"children":860},{"className":859},[],[861],{"type":27,"value":862},"match",{"type":27,"value":864}," attribute indicating what node it matches, so when we call apply on book nodes, this is the template to use. The ",{"type":22,"tag":30,"props":866,"children":868},{"href":867},"mailto:code%3E@%7Bxml:id%7D%3C/code",[869],{"type":27,"value":870},"code>@{xml:id} is an attribute value template, enclosing an",{"type":27,"value":872}," ",{"type":22,"tag":30,"props":874,"children":877},{"href":875,"rel":876},"http://en.wikipedia.org/wiki/XPath",[34],[878],{"type":27,"value":879},"XPath",{"type":27,"value":881}," expression - in this case, to get an attribute that will be included in the anchor href.",{"type":22,"tag":23,"props":883,"children":884},{},[885,887,893],{"type":27,"value":886},"You'll notice that within the ",{"type":22,"tag":175,"props":888,"children":890},{"className":889},[],[891],{"type":27,"value":892},"ul.nav.nav-list",{"type":27,"value":894}," we have another template call - as noted previously, this allows us to separate out the various templates for various sections and functionality, so that they can be used elsewhere, and are more readable/maintainable than hundreds (or thousands) of lines that do everything all clumped together.",{"type":22,"tag":23,"props":896,"children":897},{},[898,900,906],{"type":27,"value":899},"You can have more than one template for a given node name, by specifying a ",{"type":22,"tag":175,"props":901,"children":903},{"className":902},[],[904],{"type":27,"value":905},"mode",{"type":27,"value":907}," for the template - for instance:",{"type":22,"tag":197,"props":909,"children":911},{"className":497,"code":910,"language":14,"meta":8,"style":8},"    \u003C!-- Template for chapter select on side nav -->\n    \u003Cxsl:template match=\"chapter\">\n        \u003Ca href=\"#{@xml:id}\">\n            \u003Cli class=\"nav-header\">\n                \u003Ci class=\"more icon-chevron-right\">\u003C/i> \u003Cxsl:value-of select=\"info/title\" />\n            \u003C/li>\n        \u003C/a>\n        \u003Cdiv class=\"sectionLinks\" style=\"display:none;\">\n            \u003Cxsl:for-each select=\"section\">\n                \u003Ca href=\"#{@xml:id}\">\n                    \u003Cli class=\"nav-subitem\">\u003Cxsl:value-of select=\"title\" />\u003C/li>\n                \u003C/a>\n            \u003C/xsl:for-each>\n        \u003C/div>\n    \u003C/xsl:template>\n\n\u003C!-- Template for chapters in content view -->\n\u003Cxsl:template match=\"chapter\" mode=\"inner\">\n    \u003Cdiv id=\"{@xml:id}\" class=\"chapter\">\n        \u003Ch1 class=\"chapterTitle\">\u003Cxsl:value-of select=\"info/title\" />\u003C/h1>\n        \u003Cxsl:for-each select=\"section\">\n            \u003Cdiv id=\"{@xml:id}\" class=\"section\">\n                \u003Ch3 class=\"sectionTitle\">\u003Cxsl:value-of select=\"title\" />\u003C/h3>\n                \u003Cxsl:apply-templates select=\"*[not(self::title)]\">\n                \u003C/xsl:apply-templates>\n            \u003C/div>\n        \u003C/xsl:for-each>\n    \u003C/div>\n\u003C/xsl:template>\n",[912],{"type":22,"tag":175,"props":913,"children":914},{"__ignoreMap":8},[915,923,950,977,1005,1060,1075,1090,1130,1159,1186,1246,1261,1276,1291,1307,1317,1326,1368,1409,1467,1495,1535,1593,1622,1638,1654,1670,1686],{"type":22,"tag":207,"props":916,"children":917},{"class":209,"line":210},[918],{"type":22,"tag":207,"props":919,"children":920},{"style":508},[921],{"type":27,"value":922},"    \u003C!-- Template for chapter select on side nav -->\n",{"type":22,"tag":207,"props":924,"children":925},{"class":209,"line":248},[926,930,934,938,942,946],{"type":22,"tag":207,"props":927,"children":928},{"style":214},[929],{"type":27,"value":254},{"type":22,"tag":207,"props":931,"children":932},{"style":220},[933],{"type":27,"value":180},{"type":22,"tag":207,"props":935,"children":936},{"style":226},[937],{"type":27,"value":527},{"type":22,"tag":207,"props":939,"children":940},{"style":214},[941],{"type":27,"value":234},{"type":22,"tag":207,"props":943,"children":944},{"style":237},[945],{"type":27,"value":783},{"type":22,"tag":207,"props":947,"children":948},{"style":214},[949],{"type":27,"value":245},{"type":22,"tag":207,"props":951,"children":952},{"class":209,"line":292},[953,957,961,965,969,973],{"type":22,"tag":207,"props":954,"children":955},{"style":214},[956],{"type":27,"value":298},{"type":22,"tag":207,"props":958,"children":959},{"style":220},[960],{"type":27,"value":30},{"type":22,"tag":207,"props":962,"children":963},{"style":226},[964],{"type":27,"value":556},{"type":22,"tag":207,"props":966,"children":967},{"style":214},[968],{"type":27,"value":234},{"type":22,"tag":207,"props":970,"children":971},{"style":237},[972],{"type":27,"value":565},{"type":22,"tag":207,"props":974,"children":975},{"style":214},[976],{"type":27,"value":245},{"type":22,"tag":207,"props":978,"children":979},{"class":209,"line":335},[980,984,988,992,996,1001],{"type":22,"tag":207,"props":981,"children":982},{"style":214},[983],{"type":27,"value":341},{"type":22,"tag":207,"props":985,"children":986},{"style":220},[987],{"type":27,"value":581},{"type":22,"tag":207,"props":989,"children":990},{"style":226},[991],{"type":27,"value":229},{"type":22,"tag":207,"props":993,"children":994},{"style":214},[995],{"type":27,"value":234},{"type":22,"tag":207,"props":997,"children":998},{"style":237},[999],{"type":27,"value":1000},"\"nav-header\"",{"type":22,"tag":207,"props":1002,"children":1003},{"style":214},[1004],{"type":27,"value":245},{"type":22,"tag":207,"props":1006,"children":1007},{"class":209,"line":366},[1008,1012,1016,1020,1024,1028,1032,1036,1040,1044,1048,1052,1056],{"type":22,"tag":207,"props":1009,"children":1010},{"style":214},[1011],{"type":27,"value":372},{"type":22,"tag":207,"props":1013,"children":1014},{"style":220},[1015],{"type":27,"value":610},{"type":22,"tag":207,"props":1017,"children":1018},{"style":226},[1019],{"type":27,"value":229},{"type":22,"tag":207,"props":1021,"children":1022},{"style":214},[1023],{"type":27,"value":234},{"type":22,"tag":207,"props":1025,"children":1026},{"style":237},[1027],{"type":27,"value":623},{"type":22,"tag":207,"props":1029,"children":1030},{"style":214},[1031],{"type":27,"value":628},{"type":22,"tag":207,"props":1033,"children":1034},{"style":220},[1035],{"type":27,"value":610},{"type":22,"tag":207,"props":1037,"children":1038},{"style":214},[1039],{"type":27,"value":637},{"type":22,"tag":207,"props":1041,"children":1042},{"style":220},[1043],{"type":27,"value":642},{"type":22,"tag":207,"props":1045,"children":1046},{"style":226},[1047],{"type":27,"value":383},{"type":22,"tag":207,"props":1049,"children":1050},{"style":214},[1051],{"type":27,"value":234},{"type":22,"tag":207,"props":1053,"children":1054},{"style":237},[1055],{"type":27,"value":655},{"type":22,"tag":207,"props":1057,"children":1058},{"style":214},[1059],{"type":27,"value":660},{"type":22,"tag":207,"props":1061,"children":1062},{"class":209,"line":399},[1063,1067,1071],{"type":22,"tag":207,"props":1064,"children":1065},{"style":214},[1066],{"type":27,"value":422},{"type":22,"tag":207,"props":1068,"children":1069},{"style":220},[1070],{"type":27,"value":581},{"type":22,"tag":207,"props":1072,"children":1073},{"style":214},[1074],{"type":27,"value":245},{"type":22,"tag":207,"props":1076,"children":1077},{"class":209,"line":416},[1078,1082,1086],{"type":22,"tag":207,"props":1079,"children":1080},{"style":214},[1081],{"type":27,"value":439},{"type":22,"tag":207,"props":1083,"children":1084},{"style":220},[1085],{"type":27,"value":30},{"type":22,"tag":207,"props":1087,"children":1088},{"style":214},[1089],{"type":27,"value":245},{"type":22,"tag":207,"props":1091,"children":1092},{"class":209,"line":433},[1093,1097,1101,1105,1109,1114,1118,1122,1126],{"type":22,"tag":207,"props":1094,"children":1095},{"style":214},[1096],{"type":27,"value":298},{"type":22,"tag":207,"props":1098,"children":1099},{"style":220},[1100],{"type":27,"value":223},{"type":22,"tag":207,"props":1102,"children":1103},{"style":226},[1104],{"type":27,"value":229},{"type":22,"tag":207,"props":1106,"children":1107},{"style":214},[1108],{"type":27,"value":234},{"type":22,"tag":207,"props":1110,"children":1111},{"style":237},[1112],{"type":27,"value":1113},"\"sectionLinks\"",{"type":22,"tag":207,"props":1115,"children":1116},{"style":226},[1117],{"type":27,"value":719},{"type":22,"tag":207,"props":1119,"children":1120},{"style":214},[1121],{"type":27,"value":234},{"type":22,"tag":207,"props":1123,"children":1124},{"style":237},[1125],{"type":27,"value":728},{"type":22,"tag":207,"props":1127,"children":1128},{"style":214},[1129],{"type":27,"value":245},{"type":22,"tag":207,"props":1131,"children":1132},{"class":209,"line":450},[1133,1137,1142,1146,1150,1155],{"type":22,"tag":207,"props":1134,"children":1135},{"style":214},[1136],{"type":27,"value":341},{"type":22,"tag":207,"props":1138,"children":1139},{"style":220},[1140],{"type":27,"value":1141},"xsl:for-each",{"type":22,"tag":207,"props":1143,"children":1144},{"style":226},[1145],{"type":27,"value":383},{"type":22,"tag":207,"props":1147,"children":1148},{"style":214},[1149],{"type":27,"value":234},{"type":22,"tag":207,"props":1151,"children":1152},{"style":237},[1153],{"type":27,"value":1154},"\"section\"",{"type":22,"tag":207,"props":1156,"children":1157},{"style":214},[1158],{"type":27,"value":245},{"type":22,"tag":207,"props":1160,"children":1161},{"class":209,"line":467},[1162,1166,1170,1174,1178,1182],{"type":22,"tag":207,"props":1163,"children":1164},{"style":214},[1165],{"type":27,"value":372},{"type":22,"tag":207,"props":1167,"children":1168},{"style":220},[1169],{"type":27,"value":30},{"type":22,"tag":207,"props":1171,"children":1172},{"style":226},[1173],{"type":27,"value":556},{"type":22,"tag":207,"props":1175,"children":1176},{"style":214},[1177],{"type":27,"value":234},{"type":22,"tag":207,"props":1179,"children":1180},{"style":237},[1181],{"type":27,"value":565},{"type":22,"tag":207,"props":1183,"children":1184},{"style":214},[1185],{"type":27,"value":245},{"type":22,"tag":207,"props":1187,"children":1188},{"class":209,"line":790},[1189,1194,1198,1202,1206,1211,1216,1220,1224,1228,1233,1238,1242],{"type":22,"tag":207,"props":1190,"children":1191},{"style":214},[1192],{"type":27,"value":1193},"                    \u003C",{"type":22,"tag":207,"props":1195,"children":1196},{"style":220},[1197],{"type":27,"value":581},{"type":22,"tag":207,"props":1199,"children":1200},{"style":226},[1201],{"type":27,"value":229},{"type":22,"tag":207,"props":1203,"children":1204},{"style":214},[1205],{"type":27,"value":234},{"type":22,"tag":207,"props":1207,"children":1208},{"style":237},[1209],{"type":27,"value":1210},"\"nav-subitem\"",{"type":22,"tag":207,"props":1212,"children":1213},{"style":214},[1214],{"type":27,"value":1215},">\u003C",{"type":22,"tag":207,"props":1217,"children":1218},{"style":220},[1219],{"type":27,"value":642},{"type":22,"tag":207,"props":1221,"children":1222},{"style":226},[1223],{"type":27,"value":383},{"type":22,"tag":207,"props":1225,"children":1226},{"style":214},[1227],{"type":27,"value":234},{"type":22,"tag":207,"props":1229,"children":1230},{"style":237},[1231],{"type":27,"value":1232},"\"title\"",{"type":22,"tag":207,"props":1234,"children":1235},{"style":214},[1236],{"type":27,"value":1237}," />\u003C/",{"type":22,"tag":207,"props":1239,"children":1240},{"style":220},[1241],{"type":27,"value":581},{"type":22,"tag":207,"props":1243,"children":1244},{"style":214},[1245],{"type":27,"value":245},{"type":22,"tag":207,"props":1247,"children":1248},{"class":209,"line":806},[1249,1253,1257],{"type":22,"tag":207,"props":1250,"children":1251},{"style":214},[1252],{"type":27,"value":405},{"type":22,"tag":207,"props":1254,"children":1255},{"style":220},[1256],{"type":27,"value":30},{"type":22,"tag":207,"props":1258,"children":1259},{"style":214},[1260],{"type":27,"value":245},{"type":22,"tag":207,"props":1262,"children":1263},{"class":209,"line":822},[1264,1268,1272],{"type":22,"tag":207,"props":1265,"children":1266},{"style":214},[1267],{"type":27,"value":422},{"type":22,"tag":207,"props":1269,"children":1270},{"style":220},[1271],{"type":27,"value":1141},{"type":22,"tag":207,"props":1273,"children":1274},{"style":214},[1275],{"type":27,"value":245},{"type":22,"tag":207,"props":1277,"children":1278},{"class":209,"line":838},[1279,1283,1287],{"type":22,"tag":207,"props":1280,"children":1281},{"style":214},[1282],{"type":27,"value":439},{"type":22,"tag":207,"props":1284,"children":1285},{"style":220},[1286],{"type":27,"value":223},{"type":22,"tag":207,"props":1288,"children":1289},{"style":214},[1290],{"type":27,"value":245},{"type":22,"tag":207,"props":1292,"children":1294},{"class":209,"line":1293},15,[1295,1299,1303],{"type":22,"tag":207,"props":1296,"children":1297},{"style":214},[1298],{"type":27,"value":456},{"type":22,"tag":207,"props":1300,"children":1301},{"style":220},[1302],{"type":27,"value":180},{"type":22,"tag":207,"props":1304,"children":1305},{"style":214},[1306],{"type":27,"value":245},{"type":22,"tag":207,"props":1308,"children":1310},{"class":209,"line":1309},16,[1311],{"type":22,"tag":207,"props":1312,"children":1314},{"emptyLinePlaceholder":1313},true,[1315],{"type":27,"value":1316},"\n",{"type":22,"tag":207,"props":1318,"children":1320},{"class":209,"line":1319},17,[1321],{"type":22,"tag":207,"props":1322,"children":1323},{"style":508},[1324],{"type":27,"value":1325},"\u003C!-- Template for chapters in content view -->\n",{"type":22,"tag":207,"props":1327,"children":1329},{"class":209,"line":1328},18,[1330,1334,1338,1342,1346,1350,1355,1359,1364],{"type":22,"tag":207,"props":1331,"children":1332},{"style":214},[1333],{"type":27,"value":217},{"type":22,"tag":207,"props":1335,"children":1336},{"style":220},[1337],{"type":27,"value":180},{"type":22,"tag":207,"props":1339,"children":1340},{"style":226},[1341],{"type":27,"value":527},{"type":22,"tag":207,"props":1343,"children":1344},{"style":214},[1345],{"type":27,"value":234},{"type":22,"tag":207,"props":1347,"children":1348},{"style":237},[1349],{"type":27,"value":783},{"type":22,"tag":207,"props":1351,"children":1352},{"style":226},[1353],{"type":27,"value":1354}," mode",{"type":22,"tag":207,"props":1356,"children":1357},{"style":214},[1358],{"type":27,"value":234},{"type":22,"tag":207,"props":1360,"children":1361},{"style":237},[1362],{"type":27,"value":1363},"\"inner\"",{"type":22,"tag":207,"props":1365,"children":1366},{"style":214},[1367],{"type":27,"value":245},{"type":22,"tag":207,"props":1369,"children":1371},{"class":209,"line":1370},19,[1372,1376,1380,1384,1388,1393,1397,1401,1405],{"type":22,"tag":207,"props":1373,"children":1374},{"style":214},[1375],{"type":27,"value":254},{"type":22,"tag":207,"props":1377,"children":1378},{"style":220},[1379],{"type":27,"value":223},{"type":22,"tag":207,"props":1381,"children":1382},{"style":226},[1383],{"type":27,"value":263},{"type":22,"tag":207,"props":1385,"children":1386},{"style":214},[1387],{"type":27,"value":234},{"type":22,"tag":207,"props":1389,"children":1390},{"style":237},[1391],{"type":27,"value":1392},"\"{@xml:id}\"",{"type":22,"tag":207,"props":1394,"children":1395},{"style":226},[1396],{"type":27,"value":229},{"type":22,"tag":207,"props":1398,"children":1399},{"style":214},[1400],{"type":27,"value":234},{"type":22,"tag":207,"props":1402,"children":1403},{"style":237},[1404],{"type":27,"value":783},{"type":22,"tag":207,"props":1406,"children":1407},{"style":214},[1408],{"type":27,"value":245},{"type":22,"tag":207,"props":1410,"children":1412},{"class":209,"line":1411},20,[1413,1417,1422,1426,1430,1435,1439,1443,1447,1451,1455,1459,1463],{"type":22,"tag":207,"props":1414,"children":1415},{"style":214},[1416],{"type":27,"value":298},{"type":22,"tag":207,"props":1418,"children":1419},{"style":220},[1420],{"type":27,"value":1421},"h1",{"type":22,"tag":207,"props":1423,"children":1424},{"style":226},[1425],{"type":27,"value":229},{"type":22,"tag":207,"props":1427,"children":1428},{"style":214},[1429],{"type":27,"value":234},{"type":22,"tag":207,"props":1431,"children":1432},{"style":237},[1433],{"type":27,"value":1434},"\"chapterTitle\"",{"type":22,"tag":207,"props":1436,"children":1437},{"style":214},[1438],{"type":27,"value":1215},{"type":22,"tag":207,"props":1440,"children":1441},{"style":220},[1442],{"type":27,"value":642},{"type":22,"tag":207,"props":1444,"children":1445},{"style":226},[1446],{"type":27,"value":383},{"type":22,"tag":207,"props":1448,"children":1449},{"style":214},[1450],{"type":27,"value":234},{"type":22,"tag":207,"props":1452,"children":1453},{"style":237},[1454],{"type":27,"value":655},{"type":22,"tag":207,"props":1456,"children":1457},{"style":214},[1458],{"type":27,"value":1237},{"type":22,"tag":207,"props":1460,"children":1461},{"style":220},[1462],{"type":27,"value":1421},{"type":22,"tag":207,"props":1464,"children":1465},{"style":214},[1466],{"type":27,"value":245},{"type":22,"tag":207,"props":1468,"children":1470},{"class":209,"line":1469},21,[1471,1475,1479,1483,1487,1491],{"type":22,"tag":207,"props":1472,"children":1473},{"style":214},[1474],{"type":27,"value":298},{"type":22,"tag":207,"props":1476,"children":1477},{"style":220},[1478],{"type":27,"value":1141},{"type":22,"tag":207,"props":1480,"children":1481},{"style":226},[1482],{"type":27,"value":383},{"type":22,"tag":207,"props":1484,"children":1485},{"style":214},[1486],{"type":27,"value":234},{"type":22,"tag":207,"props":1488,"children":1489},{"style":237},[1490],{"type":27,"value":1154},{"type":22,"tag":207,"props":1492,"children":1493},{"style":214},[1494],{"type":27,"value":245},{"type":22,"tag":207,"props":1496,"children":1498},{"class":209,"line":1497},22,[1499,1503,1507,1511,1515,1519,1523,1527,1531],{"type":22,"tag":207,"props":1500,"children":1501},{"style":214},[1502],{"type":27,"value":341},{"type":22,"tag":207,"props":1504,"children":1505},{"style":220},[1506],{"type":27,"value":223},{"type":22,"tag":207,"props":1508,"children":1509},{"style":226},[1510],{"type":27,"value":263},{"type":22,"tag":207,"props":1512,"children":1513},{"style":214},[1514],{"type":27,"value":234},{"type":22,"tag":207,"props":1516,"children":1517},{"style":237},[1518],{"type":27,"value":1392},{"type":22,"tag":207,"props":1520,"children":1521},{"style":226},[1522],{"type":27,"value":229},{"type":22,"tag":207,"props":1524,"children":1525},{"style":214},[1526],{"type":27,"value":234},{"type":22,"tag":207,"props":1528,"children":1529},{"style":237},[1530],{"type":27,"value":1154},{"type":22,"tag":207,"props":1532,"children":1533},{"style":214},[1534],{"type":27,"value":245},{"type":22,"tag":207,"props":1536,"children":1538},{"class":209,"line":1537},23,[1539,1543,1548,1552,1556,1561,1565,1569,1573,1577,1581,1585,1589],{"type":22,"tag":207,"props":1540,"children":1541},{"style":214},[1542],{"type":27,"value":372},{"type":22,"tag":207,"props":1544,"children":1545},{"style":220},[1546],{"type":27,"value":1547},"h3",{"type":22,"tag":207,"props":1549,"children":1550},{"style":226},[1551],{"type":27,"value":229},{"type":22,"tag":207,"props":1553,"children":1554},{"style":214},[1555],{"type":27,"value":234},{"type":22,"tag":207,"props":1557,"children":1558},{"style":237},[1559],{"type":27,"value":1560},"\"sectionTitle\"",{"type":22,"tag":207,"props":1562,"children":1563},{"style":214},[1564],{"type":27,"value":1215},{"type":22,"tag":207,"props":1566,"children":1567},{"style":220},[1568],{"type":27,"value":642},{"type":22,"tag":207,"props":1570,"children":1571},{"style":226},[1572],{"type":27,"value":383},{"type":22,"tag":207,"props":1574,"children":1575},{"style":214},[1576],{"type":27,"value":234},{"type":22,"tag":207,"props":1578,"children":1579},{"style":237},[1580],{"type":27,"value":1232},{"type":22,"tag":207,"props":1582,"children":1583},{"style":214},[1584],{"type":27,"value":1237},{"type":22,"tag":207,"props":1586,"children":1587},{"style":220},[1588],{"type":27,"value":1547},{"type":22,"tag":207,"props":1590,"children":1591},{"style":214},[1592],{"type":27,"value":245},{"type":22,"tag":207,"props":1594,"children":1596},{"class":209,"line":1595},24,[1597,1601,1605,1609,1613,1618],{"type":22,"tag":207,"props":1598,"children":1599},{"style":214},[1600],{"type":27,"value":372},{"type":22,"tag":207,"props":1602,"children":1603},{"style":220},[1604],{"type":27,"value":378},{"type":22,"tag":207,"props":1606,"children":1607},{"style":226},[1608],{"type":27,"value":383},{"type":22,"tag":207,"props":1610,"children":1611},{"style":214},[1612],{"type":27,"value":234},{"type":22,"tag":207,"props":1614,"children":1615},{"style":237},[1616],{"type":27,"value":1617},"\"*[not(self::title)]\"",{"type":22,"tag":207,"props":1619,"children":1620},{"style":214},[1621],{"type":27,"value":245},{"type":22,"tag":207,"props":1623,"children":1625},{"class":209,"line":1624},25,[1626,1630,1634],{"type":22,"tag":207,"props":1627,"children":1628},{"style":214},[1629],{"type":27,"value":405},{"type":22,"tag":207,"props":1631,"children":1632},{"style":220},[1633],{"type":27,"value":378},{"type":22,"tag":207,"props":1635,"children":1636},{"style":214},[1637],{"type":27,"value":245},{"type":22,"tag":207,"props":1639,"children":1641},{"class":209,"line":1640},26,[1642,1646,1650],{"type":22,"tag":207,"props":1643,"children":1644},{"style":214},[1645],{"type":27,"value":422},{"type":22,"tag":207,"props":1647,"children":1648},{"style":220},[1649],{"type":27,"value":223},{"type":22,"tag":207,"props":1651,"children":1652},{"style":214},[1653],{"type":27,"value":245},{"type":22,"tag":207,"props":1655,"children":1657},{"class":209,"line":1656},27,[1658,1662,1666],{"type":22,"tag":207,"props":1659,"children":1660},{"style":214},[1661],{"type":27,"value":439},{"type":22,"tag":207,"props":1663,"children":1664},{"style":220},[1665],{"type":27,"value":1141},{"type":22,"tag":207,"props":1667,"children":1668},{"style":214},[1669],{"type":27,"value":245},{"type":22,"tag":207,"props":1671,"children":1673},{"class":209,"line":1672},28,[1674,1678,1682],{"type":22,"tag":207,"props":1675,"children":1676},{"style":214},[1677],{"type":27,"value":456},{"type":22,"tag":207,"props":1679,"children":1680},{"style":220},[1681],{"type":27,"value":223},{"type":22,"tag":207,"props":1683,"children":1684},{"style":214},[1685],{"type":27,"value":245},{"type":22,"tag":207,"props":1687,"children":1689},{"class":209,"line":1688},29,[1690,1694,1698],{"type":22,"tag":207,"props":1691,"children":1692},{"style":214},[1693],{"type":27,"value":473},{"type":22,"tag":207,"props":1695,"children":1696},{"style":220},[1697],{"type":27,"value":180},{"type":22,"tag":207,"props":1699,"children":1700},{"style":214},[1701],{"type":27,"value":245},{"type":22,"tag":23,"props":1703,"children":1704},{},[1705],{"type":27,"value":1706},"XSL is a Turing-complete language, so for the most part, anything you might do in another language is doable in XSL - that said, it finds its best fit as a templating language, rather than general purpose use.",{"type":22,"tag":93,"props":1708,"children":1710},{"id":1709},"static-compilation",[1711],{"type":27,"value":1712},"Static Compilation",{"type":22,"tag":23,"props":1714,"children":1715},{},[1716],{"type":27,"value":1717},"So, you're convinced that XSL is going to solve your problems (whatever those may be) - you'll be able to create one data document, and then as many XSL documents as you need to present your data anywhere (HTML for the web, PDF for the execs, plain text for the the company records, ASCII art for your own amusement...) Sounds good. You're creating those statically, I assume?",{"type":22,"tag":23,"props":1719,"children":1720},{},[1721],{"type":27,"value":1722},"Because if you're going to rely on the baked-in XSLT support in browsers, you'll likely run into some problems. The references below will help you navigate some of the ones found in Trident (IE) and Gecko (Firefox) - the MDN reference is particularly good about calling out where support is lacking. Even so, you're likely to encounter issues with certain versions of the clients not performing exactly the same (for instance, Firefox 20 broke XSL support from the local file system - Firefox 20.0.1 fixed it).",{"type":22,"tag":23,"props":1724,"children":1725},{},[1726,1728,1734,1736,1742],{"type":27,"value":1727},"My suggestion is, if you're offering the XML+XSL from a web server that can perform the transform for you (such as apache with ",{"type":22,"tag":30,"props":1729,"children":1731},{"href":1730},"www.modxslt.org",[1732],{"type":27,"value":1733},"mod-xslt",{"type":27,"value":1735},") use that instead, and save yourself the QA time. Otherwise, use a processor like ",{"type":22,"tag":30,"props":1737,"children":1739},{"href":1738},"saxon.sourceforge.net",[1740],{"type":27,"value":1741},"Saxon",{"type":27,"value":1743}," to produce a static version of your output to display, and re-run when you make changes - you lose the ability to simply update the XML and have those changes instantly reflected, but gain cross-browser stability. You'll also gain access to newer versions of the XSLT and XQuery specifications than the browsers offer.",{"type":22,"tag":93,"props":1745,"children":1747},{"id":1746},"re-the-future",[1748],{"type":27,"value":1749},"re: The Future",{"type":22,"tag":23,"props":1751,"children":1752},{},[1753],{"type":27,"value":1754},"As someone who's used XSLT for a few projects and counts the learning curve as time well-spent, I'm in a different position than someone considering learning it for the first time. Given how sparsely used it is, is it even worth the time investment?",{"type":22,"tag":23,"props":1756,"children":1757},{},[1758,1760,1767],{"type":27,"value":1759},"As answer, I direct you to consider ",{"type":22,"tag":30,"props":1761,"children":1764},{"href":1762,"rel":1763},"https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/zIg2KC7PyH0",[34],[1765],{"type":27,"value":1766},"this thread",{"type":27,"value":1768}," from the chromium group, considering deprecating support for XSLT from Blink (Google's fork of webkit). The consensus by the end seems to be that, while support for it in the browser is 'nice-to-have', it's too seldomly used to justify its size in the binary, or its place in the code. At the same time, any number of individuals were citing their specific use cases (or even multi-year careers) built on XSLT -- while the open web seems little interested in XSLT, corporate intranets are another story.",{"type":22,"tag":23,"props":1770,"children":1771},{},[1772],{"type":27,"value":1773},"The answer would seem, then - if you have a specific use case at hand where XSLT would be useful, based on what you know of it - yes, go ahead and add it to your developer's toolbelt (but be sure not to count on browser support of the standard in the future!). If you're just passingly curious, pass on by - there are other, potentially more useful technologies out there, waiting for your attention.",{"type":22,"tag":23,"props":1775,"children":1776},{},[1777],{"type":27,"value":1778},"Personally, I would very much like to see an approach like XSLT for JSON make an appearance (hopefully with the same emphasis on simplicity that JSON itself enjoys) - for now, we fill that gap with javascript templates and DOM manipulation, for better or for worse.",{"type":22,"tag":93,"props":1780,"children":1782},{"id":1781},"references",[1783],{"type":27,"value":1784},"References",{"type":22,"tag":23,"props":1786,"children":1787},{},[1788],{"type":27,"value":1789},"I prefer to learn by doing - pick a project that can benefit from XSLT, and go for broke! Both the MDN and MSDN references for XSLT are quite good - I'd suggest using both as you learn, with one sometimes offering details that the other glosses over.",{"type":22,"tag":1791,"props":1792,"children":1793},"ol",{},[1794,1804],{"type":22,"tag":581,"props":1795,"children":1796},{},[1797],{"type":22,"tag":30,"props":1798,"children":1801},{"href":1799,"rel":1800},"https://developer.mozilla.org/en/docs/XSLT",[34],[1802],{"type":27,"value":1803},"MDN XSLT Reference",{"type":22,"tag":581,"props":1805,"children":1806},{},[1807],{"type":22,"tag":30,"props":1808,"children":1811},{"href":1809,"rel":1810},"http://msdn.microsoft.com/en-us/library/ms256069.aspx",[34],[1812],{"type":27,"value":1813},"MSDN XSLT Reference",{"type":22,"tag":23,"props":1815,"children":1816},{},[1817,1819,1826],{"type":27,"value":1818},"If you'd prefer the dead-tree approach, Michael Kay's ",{"type":22,"tag":30,"props":1820,"children":1823},{"href":1821,"rel":1822},"http://www.amazon.com/dp/0470192747/",[34],[1824],{"type":27,"value":1825},"XSLT 2 and XPath 2 Programmer's Reference",{"type":27,"value":1827}," comes well-recommended.",{"type":22,"tag":1829,"props":1830,"children":1831},"style",{},[1832],{"type":27,"value":1833},"html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":8,"searchDepth":292,"depth":292,"links":1835},[1836,1837,1838,1839,1840,1841,1842],{"id":95,"depth":335,"text":98},{"id":130,"depth":335,"text":133},{"id":149,"depth":335,"text":152},{"id":160,"depth":335,"text":163},{"id":1709,"depth":335,"text":1712},{"id":1746,"depth":335,"text":1749},{"id":1781,"depth":335,"text":1784},"markdown","content:ckeefer:2013-2:xslt.md","content","ckeefer/2013-2/xslt.md","ckeefer/2013-2/xslt","md",{"user":1850,"name":1851},"ckeefer","Christopher Keefer",{"_path":1853,"_dir":1854,"_draft":7,"_partial":7,"_locale":8,"title":1855,"description":1856,"publishDate":1857,"tags":1858,"excerpt":1856,"body":1860,"_type":1843,"_id":4039,"_source":1845,"_file":4040,"_stem":4041,"_extension":1848,"author":4042},"/ckeefer/2013-08/fullproof-fulltext-search","2013-08","Client-side Fulltext Searching with Fullproof","Recently, I was engaged in a genial argument with a friend of an older generation, each of us taking an opposing stance on some obscure trivia neither of us was entirely certain about - but which we were both ready to defend with all the wit and rhetoric at our disposal. When we had finally exhausted all attempts to make the other budge on the matter, we turned to an authoritative 3rd-party source to lay the matter to rest for us - a Google search.","2013-08-29",[1859,16],"search",{"type":19,"children":1861,"toc":4033},[1862,1866,1880,1885,1908,1921,1926,1935,1940,1971,1977,1982,2071,2078,2083,2162,2167,2172,2616,2629,3036,3041,3310,3315,3339,3352,3358,3363,4011,4024,4029],{"type":22,"tag":23,"props":1863,"children":1864},{},[1865],{"type":27,"value":1856},{"type":22,"tag":23,"props":1867,"children":1868},{},[1869,1871,1878],{"type":27,"value":1870},"What else? My friend had a shelf full of encyclopedias, but it didn't occur to either of us to consult them when the answer was a 3-second search away. We've come to take that near-instantaneous access to information for granted in most contexts, and we feel annoyed or confused when we don't have access to it. Many well-designed, content-heavy sites will have similar search functionality to help users quickly navigate to whatever they're looking for; but generally, this relies on either a 3rd-party service (like Google), or else delegates the full-text searching to the backend (the database, or a specialized search server like ",{"type":22,"tag":30,"props":1872,"children":1875},{"href":1873,"rel":1874},"http://lucene.apache.org/solr/",[34],[1876],{"type":27,"value":1877},"SOLR",{"type":27,"value":1879},").",{"type":22,"tag":23,"props":1881,"children":1882},{},[1883],{"type":27,"value":1884},"This is usually the best way to go about this - but what if you have an application that's expected to provide this sort of search functionality when offline (either temporarily, or intended for always-offline)?",{"type":22,"tag":23,"props":1886,"children":1887},{},[1888,1890,1897,1899,1906],{"type":27,"value":1889},"It is here that ",{"type":22,"tag":30,"props":1891,"children":1894},{"href":1892,"rel":1893},"http://reyesr.github.io/fullproof/",[34],[1895],{"type":27,"value":1896},"Fullproof",{"type":27,"value":1898}," comes into its own. I discovered this JavaScript library while working on a complex, web-based user guide that needed to be offline-only. Its contents would come from an easily-updatable (either by us or by the client) XML file, which we would transform into HTML via ",{"type":22,"tag":30,"props":1900,"children":1903},{"href":1901,"rel":1902},"http://www.w3.org/TR/xslt",[34],[1904],{"type":27,"value":1905},"XSLT",{"type":27,"value":1907}," (the subject of a future post, perhaps), and then style and interact programmatically with via CSS and JavaScript, as per usual.",{"type":22,"tag":23,"props":1909,"children":1910},{},[1911,1913,1919],{"type":27,"value":1912},"One requirement was that we be able to perform full-text searching on the user guide. The ugly-hack approach to this might involve regex's or all sorts of data- ",{"type":22,"tag":1914,"props":1915,"children":1916},"em",{},[1917],{"type":27,"value":1918},"tags strewn throughout the document. Neither of these would be good solutions under most circumstances - even a complicated regex (and they can get very complicated, very quickly) isn't going to offer you results for mild mispellings or near-matches, and will potentially make supporting unicode a nightmare; and sprinkling data-",{"type":27,"value":1920}," tags throughout your markup to indicate areas of interest is highly limited and clutters your markup.",{"type":22,"tag":23,"props":1922,"children":1923},{},[1924],{"type":27,"value":1925},"We needed a real search engine - one that can parse and normalize our text, and offer us scoring engines that can catch misspellings and near-matches. Consider the following example (from fullproof's home page):",{"type":22,"tag":23,"props":1927,"children":1928},{},[1929],{"type":22,"tag":1930,"props":1931,"children":1934},"img",{"alt":1932,"src":1933,"title":1932},"Software screen capture","assets/images/sc-mame.png",[],{"type":22,"tag":23,"props":1936,"children":1937},{},[1938],{"type":27,"value":1939},"Searching MAME Roms with match scoring - we get our results in a ranked order that can be controlled to a degree via what indexes we instantiate.",{"type":22,"tag":23,"props":1941,"children":1942},{},[1943,1945,1952,1954,1961,1962,1969],{"type":27,"value":1944},"The Fullproof github page includes a ",{"type":22,"tag":30,"props":1946,"children":1949},{"href":1947,"rel":1948},"http://reyesr.github.io/fullproof/tutorial.html",[34],[1950],{"type":27,"value":1951},"capable tutorial",{"type":27,"value":1953},", the contents of which we won't duplicate here - I suggest you go give it a look, along with the ",{"type":22,"tag":30,"props":1955,"children":1958},{"href":1956,"rel":1957},"https://github.com/reyesr/fullproof/wiki/_pages",[34],[1959],{"type":27,"value":1960},"supporting",{"type":27,"value":872},{"type":22,"tag":30,"props":1963,"children":1966},{"href":1964,"rel":1965},"http://reyesr.github.io/fullproof/jsdocs/index.html",[34],[1967],{"type":27,"value":1968},"documentation",{"type":27,"value":1970},". Instead, let's look at some specifics regarding setup, and pitfalls encountered when trying to employ fullproof.",{"type":22,"tag":93,"props":1972,"children":1974},{"id":1973},"where-is-the-data-coming-from",[1975],{"type":27,"value":1976},"Where is the data coming from?",{"type":22,"tag":23,"props":1978,"children":1979},{},[1980],{"type":27,"value":1981},"One of the first hurdles for one expecting the full-suite treatment performing fulltext searches on a database is that fullproof isn't a document management system (as it notes at the top of its github page). It ONLY searches - you'll need to figure out how to feed it the data you want it to work with. My suggestion is that you have precomposed data available in some form, rather than scraping your page(s) at runtime. In our case, because we're pulling data from XML in the first place, we can restructure that content into JSON and slap it into our page as static data in a script element, to be pulled back out and fed to Fullproof when appropriate. Something like:",{"type":22,"tag":197,"props":1983,"children":1987},{"className":1984,"code":1985,"language":1986,"meta":8,"style":8},"language-javascript shiki shiki-themes github-light github-dark","this.gContent = \n    $('script[type=\"text/JSON\"]')\n[0].innerHTML(); // Our guide content\n","javascript",[1988],{"type":22,"tag":175,"props":1989,"children":1990},{"__ignoreMap":8},[1991,2015,2038],{"type":22,"tag":207,"props":1992,"children":1993},{"class":209,"line":210},[1994,2000,2005,2010],{"type":22,"tag":207,"props":1995,"children":1997},{"style":1996},"--shiki-default:#005CC5;--shiki-dark:#79B8FF",[1998],{"type":27,"value":1999},"this",{"type":22,"tag":207,"props":2001,"children":2002},{"style":214},[2003],{"type":27,"value":2004},".gContent ",{"type":22,"tag":207,"props":2006,"children":2008},{"style":2007},"--shiki-default:#D73A49;--shiki-dark:#F97583",[2009],{"type":27,"value":234},{"type":22,"tag":207,"props":2011,"children":2012},{"style":214},[2013],{"type":27,"value":2014}," \n",{"type":22,"tag":207,"props":2016,"children":2017},{"class":209,"line":248},[2018,2023,2028,2033],{"type":22,"tag":207,"props":2019,"children":2020},{"style":226},[2021],{"type":27,"value":2022},"    $",{"type":22,"tag":207,"props":2024,"children":2025},{"style":214},[2026],{"type":27,"value":2027},"(",{"type":22,"tag":207,"props":2029,"children":2030},{"style":237},[2031],{"type":27,"value":2032},"'script[type=\"text/JSON\"]'",{"type":22,"tag":207,"props":2034,"children":2035},{"style":214},[2036],{"type":27,"value":2037},")\n",{"type":22,"tag":207,"props":2039,"children":2040},{"class":209,"line":292},[2041,2046,2051,2056,2061,2066],{"type":22,"tag":207,"props":2042,"children":2043},{"style":214},[2044],{"type":27,"value":2045},"[",{"type":22,"tag":207,"props":2047,"children":2048},{"style":1996},[2049],{"type":27,"value":2050},"0",{"type":22,"tag":207,"props":2052,"children":2053},{"style":214},[2054],{"type":27,"value":2055},"].",{"type":22,"tag":207,"props":2057,"children":2058},{"style":226},[2059],{"type":27,"value":2060},"innerHTML",{"type":22,"tag":207,"props":2062,"children":2063},{"style":214},[2064],{"type":27,"value":2065},"(); ",{"type":22,"tag":207,"props":2067,"children":2068},{"style":508},[2069],{"type":27,"value":2070},"// Our guide content\n",{"type":22,"tag":2072,"props":2073,"children":2075},"h2",{"id":2074},"start-the-engine",[2076],{"type":27,"value":2077},"Start the Engine",{"type":22,"tag":23,"props":2079,"children":2080},{},[2081],{"type":27,"value":2082},"We'll then initialize our engine and its indexes. This was the major stumbling block at first, particularly because we're opening a file on the local file system (which leads to all sort of security complications). We need to eschew the HTML5 options fullproof supports and make do with memory-based storage.",{"type":22,"tag":197,"props":2084,"children":2086},{"className":1984,"code":2085,"language":1986,"meta":8,"style":8},"this.engine = new fullproof.ScoringEngine(\n        [new fullproof.StoreDescriptor(\"memorystore\", fullproof.store.MemoryStore)]);\n",[2087],{"type":22,"tag":175,"props":2088,"children":2089},{"__ignoreMap":8},[2090,2126],{"type":22,"tag":207,"props":2091,"children":2092},{"class":209,"line":210},[2093,2097,2102,2106,2111,2116,2121],{"type":22,"tag":207,"props":2094,"children":2095},{"style":1996},[2096],{"type":27,"value":1999},{"type":22,"tag":207,"props":2098,"children":2099},{"style":214},[2100],{"type":27,"value":2101},".engine ",{"type":22,"tag":207,"props":2103,"children":2104},{"style":2007},[2105],{"type":27,"value":234},{"type":22,"tag":207,"props":2107,"children":2108},{"style":2007},[2109],{"type":27,"value":2110}," new",{"type":22,"tag":207,"props":2112,"children":2113},{"style":214},[2114],{"type":27,"value":2115}," fullproof.",{"type":22,"tag":207,"props":2117,"children":2118},{"style":226},[2119],{"type":27,"value":2120},"ScoringEngine",{"type":22,"tag":207,"props":2122,"children":2123},{"style":214},[2124],{"type":27,"value":2125},"(\n",{"type":22,"tag":207,"props":2127,"children":2128},{"class":209,"line":248},[2129,2134,2139,2143,2148,2152,2157],{"type":22,"tag":207,"props":2130,"children":2131},{"style":214},[2132],{"type":27,"value":2133},"        [",{"type":22,"tag":207,"props":2135,"children":2136},{"style":2007},[2137],{"type":27,"value":2138},"new",{"type":22,"tag":207,"props":2140,"children":2141},{"style":214},[2142],{"type":27,"value":2115},{"type":22,"tag":207,"props":2144,"children":2145},{"style":226},[2146],{"type":27,"value":2147},"StoreDescriptor",{"type":22,"tag":207,"props":2149,"children":2150},{"style":214},[2151],{"type":27,"value":2027},{"type":22,"tag":207,"props":2153,"children":2154},{"style":237},[2155],{"type":27,"value":2156},"\"memorystore\"",{"type":22,"tag":207,"props":2158,"children":2159},{"style":214},[2160],{"type":27,"value":2161},", fullproof.store.MemoryStore)]);\n",{"type":22,"tag":23,"props":2163,"children":2164},{},[2165],{"type":27,"value":2166},"If we try to use WebSQL (which isn't supported by IE or Firefox), we'll run into a security exception in Chrome (possibly other webkit-based browsers as well, although I didn't have opportunity to test them). Same story for indexedDB for Firefox and Chrome (Chrome will complain about same domain problems when loading our xsl as well, which is why we have to statically compile our html output of the XSLT transform for that browser - as noted, a topic for another post).",{"type":22,"tag":23,"props":2168,"children":2169},{},[2170],{"type":27,"value":2171},"Now, we can instantiate our indexes. The fullproof tutorial notes that any number of indexes are specifiable, and the search engine will fall back through them in the specified order when attempting to fulfill a search. Thus, we specify the least altered/aggresive index first (just removing diacriticals and repeated letters), and then make a stemmed index (metaphone).",{"type":22,"tag":197,"props":2173,"children":2175},{"className":1984,"code":2174,"language":1986,"meta":8,"style":8},"this.indexes = [\n        {\n            name:\"normalIndex\",\n            analyzer:new fullproof.ScoringAnalyzer(fullproof.normalizer.to_lowercase_nomark,\n                fullproof.normalizer.remove_duplicate_letters),\n            capabilities:new fullproof.Capabilities().setStoreObjects(false).setUseScores(true)\n                .setDbName(this.dbName).setComparatorObject(fullproof.ScoredEntry.comparatorObject),\n            initializer:function(injector, callback){that.initIndexes(injector, callback, that.gContent);}\n        },\n        {\n            name:\"stemmedIndex\",\n            analyzer:new fullproof.ScoringAnalyzer(fullproof.normalizer.to_lowercase_nomark,\n                fullproof.english.metaphone),\n            capabilities:new fullproof.Capabilities().setStoreObjects(false).setUseScores(true)\n                .setDbName(this.dbName).setComparatorObject(fullproof.ScoredEntry.comparatorObject),\n            initializer:function(injector, callback){that.initIndexes(injector, callback, that.gContent);}\n        }\n    ];\n",[2176],{"type":22,"tag":175,"props":2177,"children":2178},{"__ignoreMap":8},[2179,2200,2208,2226,2252,2260,2322,2358,2409,2417,2424,2440,2463,2471,2526,2557,2600,2608],{"type":22,"tag":207,"props":2180,"children":2181},{"class":209,"line":210},[2182,2186,2191,2195],{"type":22,"tag":207,"props":2183,"children":2184},{"style":1996},[2185],{"type":27,"value":1999},{"type":22,"tag":207,"props":2187,"children":2188},{"style":214},[2189],{"type":27,"value":2190},".indexes ",{"type":22,"tag":207,"props":2192,"children":2193},{"style":2007},[2194],{"type":27,"value":234},{"type":22,"tag":207,"props":2196,"children":2197},{"style":214},[2198],{"type":27,"value":2199}," [\n",{"type":22,"tag":207,"props":2201,"children":2202},{"class":209,"line":248},[2203],{"type":22,"tag":207,"props":2204,"children":2205},{"style":214},[2206],{"type":27,"value":2207},"        {\n",{"type":22,"tag":207,"props":2209,"children":2210},{"class":209,"line":292},[2211,2216,2221],{"type":22,"tag":207,"props":2212,"children":2213},{"style":214},[2214],{"type":27,"value":2215},"            name:",{"type":22,"tag":207,"props":2217,"children":2218},{"style":237},[2219],{"type":27,"value":2220},"\"normalIndex\"",{"type":22,"tag":207,"props":2222,"children":2223},{"style":214},[2224],{"type":27,"value":2225},",\n",{"type":22,"tag":207,"props":2227,"children":2228},{"class":209,"line":335},[2229,2234,2238,2242,2247],{"type":22,"tag":207,"props":2230,"children":2231},{"style":214},[2232],{"type":27,"value":2233},"            analyzer:",{"type":22,"tag":207,"props":2235,"children":2236},{"style":2007},[2237],{"type":27,"value":2138},{"type":22,"tag":207,"props":2239,"children":2240},{"style":214},[2241],{"type":27,"value":2115},{"type":22,"tag":207,"props":2243,"children":2244},{"style":226},[2245],{"type":27,"value":2246},"ScoringAnalyzer",{"type":22,"tag":207,"props":2248,"children":2249},{"style":214},[2250],{"type":27,"value":2251},"(fullproof.normalizer.to_lowercase_nomark,\n",{"type":22,"tag":207,"props":2253,"children":2254},{"class":209,"line":366},[2255],{"type":22,"tag":207,"props":2256,"children":2257},{"style":214},[2258],{"type":27,"value":2259},"                fullproof.normalizer.remove_duplicate_letters),\n",{"type":22,"tag":207,"props":2261,"children":2262},{"class":209,"line":399},[2263,2268,2272,2276,2281,2286,2291,2295,2300,2304,2309,2313,2318],{"type":22,"tag":207,"props":2264,"children":2265},{"style":214},[2266],{"type":27,"value":2267},"            capabilities:",{"type":22,"tag":207,"props":2269,"children":2270},{"style":2007},[2271],{"type":27,"value":2138},{"type":22,"tag":207,"props":2273,"children":2274},{"style":214},[2275],{"type":27,"value":2115},{"type":22,"tag":207,"props":2277,"children":2278},{"style":226},[2279],{"type":27,"value":2280},"Capabilities",{"type":22,"tag":207,"props":2282,"children":2283},{"style":214},[2284],{"type":27,"value":2285},"().",{"type":22,"tag":207,"props":2287,"children":2288},{"style":226},[2289],{"type":27,"value":2290},"setStoreObjects",{"type":22,"tag":207,"props":2292,"children":2293},{"style":214},[2294],{"type":27,"value":2027},{"type":22,"tag":207,"props":2296,"children":2297},{"style":1996},[2298],{"type":27,"value":2299},"false",{"type":22,"tag":207,"props":2301,"children":2302},{"style":214},[2303],{"type":27,"value":1879},{"type":22,"tag":207,"props":2305,"children":2306},{"style":226},[2307],{"type":27,"value":2308},"setUseScores",{"type":22,"tag":207,"props":2310,"children":2311},{"style":214},[2312],{"type":27,"value":2027},{"type":22,"tag":207,"props":2314,"children":2315},{"style":1996},[2316],{"type":27,"value":2317},"true",{"type":22,"tag":207,"props":2319,"children":2320},{"style":214},[2321],{"type":27,"value":2037},{"type":22,"tag":207,"props":2323,"children":2324},{"class":209,"line":416},[2325,2330,2335,2339,2343,2348,2353],{"type":22,"tag":207,"props":2326,"children":2327},{"style":214},[2328],{"type":27,"value":2329},"                .",{"type":22,"tag":207,"props":2331,"children":2332},{"style":226},[2333],{"type":27,"value":2334},"setDbName",{"type":22,"tag":207,"props":2336,"children":2337},{"style":214},[2338],{"type":27,"value":2027},{"type":22,"tag":207,"props":2340,"children":2341},{"style":1996},[2342],{"type":27,"value":1999},{"type":22,"tag":207,"props":2344,"children":2345},{"style":214},[2346],{"type":27,"value":2347},".dbName).",{"type":22,"tag":207,"props":2349,"children":2350},{"style":226},[2351],{"type":27,"value":2352},"setComparatorObject",{"type":22,"tag":207,"props":2354,"children":2355},{"style":214},[2356],{"type":27,"value":2357},"(fullproof.ScoredEntry.comparatorObject),\n",{"type":22,"tag":207,"props":2359,"children":2360},{"class":209,"line":433},[2361,2366,2370,2375,2379,2385,2389,2394,2399,2404],{"type":22,"tag":207,"props":2362,"children":2363},{"style":226},[2364],{"type":27,"value":2365},"            initializer",{"type":22,"tag":207,"props":2367,"children":2368},{"style":214},[2369],{"type":27,"value":113},{"type":22,"tag":207,"props":2371,"children":2372},{"style":2007},[2373],{"type":27,"value":2374},"function",{"type":22,"tag":207,"props":2376,"children":2377},{"style":214},[2378],{"type":27,"value":2027},{"type":22,"tag":207,"props":2380,"children":2382},{"style":2381},"--shiki-default:#E36209;--shiki-dark:#FFAB70",[2383],{"type":27,"value":2384},"injector",{"type":22,"tag":207,"props":2386,"children":2387},{"style":214},[2388],{"type":27,"value":39},{"type":22,"tag":207,"props":2390,"children":2391},{"style":2381},[2392],{"type":27,"value":2393},"callback",{"type":22,"tag":207,"props":2395,"children":2396},{"style":214},[2397],{"type":27,"value":2398},"){that.",{"type":22,"tag":207,"props":2400,"children":2401},{"style":226},[2402],{"type":27,"value":2403},"initIndexes",{"type":22,"tag":207,"props":2405,"children":2406},{"style":214},[2407],{"type":27,"value":2408},"(injector, callback, that.gContent);}\n",{"type":22,"tag":207,"props":2410,"children":2411},{"class":209,"line":450},[2412],{"type":22,"tag":207,"props":2413,"children":2414},{"style":214},[2415],{"type":27,"value":2416},"        },\n",{"type":22,"tag":207,"props":2418,"children":2419},{"class":209,"line":467},[2420],{"type":22,"tag":207,"props":2421,"children":2422},{"style":214},[2423],{"type":27,"value":2207},{"type":22,"tag":207,"props":2425,"children":2426},{"class":209,"line":790},[2427,2431,2436],{"type":22,"tag":207,"props":2428,"children":2429},{"style":214},[2430],{"type":27,"value":2215},{"type":22,"tag":207,"props":2432,"children":2433},{"style":237},[2434],{"type":27,"value":2435},"\"stemmedIndex\"",{"type":22,"tag":207,"props":2437,"children":2438},{"style":214},[2439],{"type":27,"value":2225},{"type":22,"tag":207,"props":2441,"children":2442},{"class":209,"line":806},[2443,2447,2451,2455,2459],{"type":22,"tag":207,"props":2444,"children":2445},{"style":214},[2446],{"type":27,"value":2233},{"type":22,"tag":207,"props":2448,"children":2449},{"style":2007},[2450],{"type":27,"value":2138},{"type":22,"tag":207,"props":2452,"children":2453},{"style":214},[2454],{"type":27,"value":2115},{"type":22,"tag":207,"props":2456,"children":2457},{"style":226},[2458],{"type":27,"value":2246},{"type":22,"tag":207,"props":2460,"children":2461},{"style":214},[2462],{"type":27,"value":2251},{"type":22,"tag":207,"props":2464,"children":2465},{"class":209,"line":822},[2466],{"type":22,"tag":207,"props":2467,"children":2468},{"style":214},[2469],{"type":27,"value":2470},"                fullproof.english.metaphone),\n",{"type":22,"tag":207,"props":2472,"children":2473},{"class":209,"line":838},[2474,2478,2482,2486,2490,2494,2498,2502,2506,2510,2514,2518,2522],{"type":22,"tag":207,"props":2475,"children":2476},{"style":214},[2477],{"type":27,"value":2267},{"type":22,"tag":207,"props":2479,"children":2480},{"style":2007},[2481],{"type":27,"value":2138},{"type":22,"tag":207,"props":2483,"children":2484},{"style":214},[2485],{"type":27,"value":2115},{"type":22,"tag":207,"props":2487,"children":2488},{"style":226},[2489],{"type":27,"value":2280},{"type":22,"tag":207,"props":2491,"children":2492},{"style":214},[2493],{"type":27,"value":2285},{"type":22,"tag":207,"props":2495,"children":2496},{"style":226},[2497],{"type":27,"value":2290},{"type":22,"tag":207,"props":2499,"children":2500},{"style":214},[2501],{"type":27,"value":2027},{"type":22,"tag":207,"props":2503,"children":2504},{"style":1996},[2505],{"type":27,"value":2299},{"type":22,"tag":207,"props":2507,"children":2508},{"style":214},[2509],{"type":27,"value":1879},{"type":22,"tag":207,"props":2511,"children":2512},{"style":226},[2513],{"type":27,"value":2308},{"type":22,"tag":207,"props":2515,"children":2516},{"style":214},[2517],{"type":27,"value":2027},{"type":22,"tag":207,"props":2519,"children":2520},{"style":1996},[2521],{"type":27,"value":2317},{"type":22,"tag":207,"props":2523,"children":2524},{"style":214},[2525],{"type":27,"value":2037},{"type":22,"tag":207,"props":2527,"children":2528},{"class":209,"line":1293},[2529,2533,2537,2541,2545,2549,2553],{"type":22,"tag":207,"props":2530,"children":2531},{"style":214},[2532],{"type":27,"value":2329},{"type":22,"tag":207,"props":2534,"children":2535},{"style":226},[2536],{"type":27,"value":2334},{"type":22,"tag":207,"props":2538,"children":2539},{"style":214},[2540],{"type":27,"value":2027},{"type":22,"tag":207,"props":2542,"children":2543},{"style":1996},[2544],{"type":27,"value":1999},{"type":22,"tag":207,"props":2546,"children":2547},{"style":214},[2548],{"type":27,"value":2347},{"type":22,"tag":207,"props":2550,"children":2551},{"style":226},[2552],{"type":27,"value":2352},{"type":22,"tag":207,"props":2554,"children":2555},{"style":214},[2556],{"type":27,"value":2357},{"type":22,"tag":207,"props":2558,"children":2559},{"class":209,"line":1309},[2560,2564,2568,2572,2576,2580,2584,2588,2592,2596],{"type":22,"tag":207,"props":2561,"children":2562},{"style":226},[2563],{"type":27,"value":2365},{"type":22,"tag":207,"props":2565,"children":2566},{"style":214},[2567],{"type":27,"value":113},{"type":22,"tag":207,"props":2569,"children":2570},{"style":2007},[2571],{"type":27,"value":2374},{"type":22,"tag":207,"props":2573,"children":2574},{"style":214},[2575],{"type":27,"value":2027},{"type":22,"tag":207,"props":2577,"children":2578},{"style":2381},[2579],{"type":27,"value":2384},{"type":22,"tag":207,"props":2581,"children":2582},{"style":214},[2583],{"type":27,"value":39},{"type":22,"tag":207,"props":2585,"children":2586},{"style":2381},[2587],{"type":27,"value":2393},{"type":22,"tag":207,"props":2589,"children":2590},{"style":214},[2591],{"type":27,"value":2398},{"type":22,"tag":207,"props":2593,"children":2594},{"style":226},[2595],{"type":27,"value":2403},{"type":22,"tag":207,"props":2597,"children":2598},{"style":214},[2599],{"type":27,"value":2408},{"type":22,"tag":207,"props":2601,"children":2602},{"class":209,"line":1319},[2603],{"type":22,"tag":207,"props":2604,"children":2605},{"style":214},[2606],{"type":27,"value":2607},"        }\n",{"type":22,"tag":207,"props":2609,"children":2610},{"class":209,"line":1328},[2611],{"type":22,"tag":207,"props":2612,"children":2613},{"style":214},[2614],{"type":27,"value":2615},"    ];\n",{"type":22,"tag":23,"props":2617,"children":2618},{},[2619,2621,2627],{"type":27,"value":2620},"You'll notice the calls to ",{"type":22,"tag":175,"props":2622,"children":2624},{"className":2623},[],[2625],{"type":27,"value":2626},"that.initIndexes",{"type":27,"value":2628}," this is our initializer function that actually 'injects' our data into the search engine index.",{"type":22,"tag":197,"props":2630,"children":2632},{"className":1984,"code":2631,"language":1986,"meta":8,"style":8},"/**\n * Initialize index(es).\n * @method initIndexes\n * @param {Object} injector Provided by index.\n * @param {Function} callback Function to call when indexes are finished initializing.\n * @param {Object} gContent Guide content to inject.\n * @param {Number} indexLength Number of indexes we're initializing.\n */\nASearch.prototype.initIndexes = function(injector, callback, gContent){\n    var that = this;\n    var synchro = fullproof.make_synchro_point(callback, gContent.length);\n    for (var i=0, len = gContent.length; i &lt; len; i++)\n    {\n        injector.inject(gContent[i].text, i, synchro);\n    }\n\n};\n",[2633],{"type":22,"tag":175,"props":2634,"children":2635},{"__ignoreMap":8},[2636,2644,2652,2670,2697,2723,2748,2774,2782,2847,2874,2914,2987,2995,3013,3021,3028],{"type":22,"tag":207,"props":2637,"children":2638},{"class":209,"line":210},[2639],{"type":22,"tag":207,"props":2640,"children":2641},{"style":508},[2642],{"type":27,"value":2643},"/**\n",{"type":22,"tag":207,"props":2645,"children":2646},{"class":209,"line":248},[2647],{"type":22,"tag":207,"props":2648,"children":2649},{"style":508},[2650],{"type":27,"value":2651}," * Initialize index(es).\n",{"type":22,"tag":207,"props":2653,"children":2654},{"class":209,"line":292},[2655,2660,2665],{"type":22,"tag":207,"props":2656,"children":2657},{"style":508},[2658],{"type":27,"value":2659}," * ",{"type":22,"tag":207,"props":2661,"children":2662},{"style":2007},[2663],{"type":27,"value":2664},"@method",{"type":22,"tag":207,"props":2666,"children":2667},{"style":226},[2668],{"type":27,"value":2669}," initIndexes\n",{"type":22,"tag":207,"props":2671,"children":2672},{"class":209,"line":335},[2673,2677,2682,2687,2692],{"type":22,"tag":207,"props":2674,"children":2675},{"style":508},[2676],{"type":27,"value":2659},{"type":22,"tag":207,"props":2678,"children":2679},{"style":2007},[2680],{"type":27,"value":2681},"@param",{"type":22,"tag":207,"props":2683,"children":2684},{"style":226},[2685],{"type":27,"value":2686}," {Object}",{"type":22,"tag":207,"props":2688,"children":2689},{"style":214},[2690],{"type":27,"value":2691}," injector",{"type":22,"tag":207,"props":2693,"children":2694},{"style":508},[2695],{"type":27,"value":2696}," Provided by index.\n",{"type":22,"tag":207,"props":2698,"children":2699},{"class":209,"line":366},[2700,2704,2708,2713,2718],{"type":22,"tag":207,"props":2701,"children":2702},{"style":508},[2703],{"type":27,"value":2659},{"type":22,"tag":207,"props":2705,"children":2706},{"style":2007},[2707],{"type":27,"value":2681},{"type":22,"tag":207,"props":2709,"children":2710},{"style":226},[2711],{"type":27,"value":2712}," {Function}",{"type":22,"tag":207,"props":2714,"children":2715},{"style":214},[2716],{"type":27,"value":2717}," callback",{"type":22,"tag":207,"props":2719,"children":2720},{"style":508},[2721],{"type":27,"value":2722}," Function to call when indexes are finished initializing.\n",{"type":22,"tag":207,"props":2724,"children":2725},{"class":209,"line":399},[2726,2730,2734,2738,2743],{"type":22,"tag":207,"props":2727,"children":2728},{"style":508},[2729],{"type":27,"value":2659},{"type":22,"tag":207,"props":2731,"children":2732},{"style":2007},[2733],{"type":27,"value":2681},{"type":22,"tag":207,"props":2735,"children":2736},{"style":226},[2737],{"type":27,"value":2686},{"type":22,"tag":207,"props":2739,"children":2740},{"style":214},[2741],{"type":27,"value":2742}," gContent",{"type":22,"tag":207,"props":2744,"children":2745},{"style":508},[2746],{"type":27,"value":2747}," Guide content to inject.\n",{"type":22,"tag":207,"props":2749,"children":2750},{"class":209,"line":416},[2751,2755,2759,2764,2769],{"type":22,"tag":207,"props":2752,"children":2753},{"style":508},[2754],{"type":27,"value":2659},{"type":22,"tag":207,"props":2756,"children":2757},{"style":2007},[2758],{"type":27,"value":2681},{"type":22,"tag":207,"props":2760,"children":2761},{"style":226},[2762],{"type":27,"value":2763}," {Number}",{"type":22,"tag":207,"props":2765,"children":2766},{"style":214},[2767],{"type":27,"value":2768}," indexLength",{"type":22,"tag":207,"props":2770,"children":2771},{"style":508},[2772],{"type":27,"value":2773}," Number of indexes we're initializing.\n",{"type":22,"tag":207,"props":2775,"children":2776},{"class":209,"line":433},[2777],{"type":22,"tag":207,"props":2778,"children":2779},{"style":508},[2780],{"type":27,"value":2781}," */\n",{"type":22,"tag":207,"props":2783,"children":2784},{"class":209,"line":450},[2785,2790,2794,2799,2803,2807,2812,2817,2821,2825,2829,2833,2837,2842],{"type":22,"tag":207,"props":2786,"children":2787},{"style":1996},[2788],{"type":27,"value":2789},"ASearch",{"type":22,"tag":207,"props":2791,"children":2792},{"style":214},[2793],{"type":27,"value":63},{"type":22,"tag":207,"props":2795,"children":2796},{"style":1996},[2797],{"type":27,"value":2798},"prototype",{"type":22,"tag":207,"props":2800,"children":2801},{"style":214},[2802],{"type":27,"value":63},{"type":22,"tag":207,"props":2804,"children":2805},{"style":226},[2806],{"type":27,"value":2403},{"type":22,"tag":207,"props":2808,"children":2809},{"style":2007},[2810],{"type":27,"value":2811}," =",{"type":22,"tag":207,"props":2813,"children":2814},{"style":2007},[2815],{"type":27,"value":2816}," function",{"type":22,"tag":207,"props":2818,"children":2819},{"style":214},[2820],{"type":27,"value":2027},{"type":22,"tag":207,"props":2822,"children":2823},{"style":2381},[2824],{"type":27,"value":2384},{"type":22,"tag":207,"props":2826,"children":2827},{"style":214},[2828],{"type":27,"value":39},{"type":22,"tag":207,"props":2830,"children":2831},{"style":2381},[2832],{"type":27,"value":2393},{"type":22,"tag":207,"props":2834,"children":2835},{"style":214},[2836],{"type":27,"value":39},{"type":22,"tag":207,"props":2838,"children":2839},{"style":2381},[2840],{"type":27,"value":2841},"gContent",{"type":22,"tag":207,"props":2843,"children":2844},{"style":214},[2845],{"type":27,"value":2846},"){\n",{"type":22,"tag":207,"props":2848,"children":2849},{"class":209,"line":467},[2850,2855,2860,2864,2869],{"type":22,"tag":207,"props":2851,"children":2852},{"style":2007},[2853],{"type":27,"value":2854},"    var",{"type":22,"tag":207,"props":2856,"children":2857},{"style":214},[2858],{"type":27,"value":2859}," that ",{"type":22,"tag":207,"props":2861,"children":2862},{"style":2007},[2863],{"type":27,"value":234},{"type":22,"tag":207,"props":2865,"children":2866},{"style":1996},[2867],{"type":27,"value":2868}," this",{"type":22,"tag":207,"props":2870,"children":2871},{"style":214},[2872],{"type":27,"value":2873},";\n",{"type":22,"tag":207,"props":2875,"children":2876},{"class":209,"line":790},[2877,2881,2886,2890,2894,2899,2904,2909],{"type":22,"tag":207,"props":2878,"children":2879},{"style":2007},[2880],{"type":27,"value":2854},{"type":22,"tag":207,"props":2882,"children":2883},{"style":214},[2884],{"type":27,"value":2885}," synchro ",{"type":22,"tag":207,"props":2887,"children":2888},{"style":2007},[2889],{"type":27,"value":234},{"type":22,"tag":207,"props":2891,"children":2892},{"style":214},[2893],{"type":27,"value":2115},{"type":22,"tag":207,"props":2895,"children":2896},{"style":226},[2897],{"type":27,"value":2898},"make_synchro_point",{"type":22,"tag":207,"props":2900,"children":2901},{"style":214},[2902],{"type":27,"value":2903},"(callback, gContent.",{"type":22,"tag":207,"props":2905,"children":2906},{"style":1996},[2907],{"type":27,"value":2908},"length",{"type":22,"tag":207,"props":2910,"children":2911},{"style":214},[2912],{"type":27,"value":2913},");\n",{"type":22,"tag":207,"props":2915,"children":2916},{"class":209,"line":806},[2917,2922,2927,2932,2937,2941,2945,2950,2954,2959,2963,2968,2973,2978,2983],{"type":22,"tag":207,"props":2918,"children":2919},{"style":2007},[2920],{"type":27,"value":2921},"    for",{"type":22,"tag":207,"props":2923,"children":2924},{"style":214},[2925],{"type":27,"value":2926}," (",{"type":22,"tag":207,"props":2928,"children":2929},{"style":2007},[2930],{"type":27,"value":2931},"var",{"type":22,"tag":207,"props":2933,"children":2934},{"style":214},[2935],{"type":27,"value":2936}," i",{"type":22,"tag":207,"props":2938,"children":2939},{"style":2007},[2940],{"type":27,"value":234},{"type":22,"tag":207,"props":2942,"children":2943},{"style":1996},[2944],{"type":27,"value":2050},{"type":22,"tag":207,"props":2946,"children":2947},{"style":214},[2948],{"type":27,"value":2949},", len ",{"type":22,"tag":207,"props":2951,"children":2952},{"style":2007},[2953],{"type":27,"value":234},{"type":22,"tag":207,"props":2955,"children":2956},{"style":214},[2957],{"type":27,"value":2958}," gContent.",{"type":22,"tag":207,"props":2960,"children":2961},{"style":1996},[2962],{"type":27,"value":2908},{"type":22,"tag":207,"props":2964,"children":2965},{"style":214},[2966],{"type":27,"value":2967},"; i ",{"type":22,"tag":207,"props":2969,"children":2970},{"style":2007},[2971],{"type":27,"value":2972},"&",{"type":22,"tag":207,"props":2974,"children":2975},{"style":214},[2976],{"type":27,"value":2977},"lt; len; i",{"type":22,"tag":207,"props":2979,"children":2980},{"style":2007},[2981],{"type":27,"value":2982},"++",{"type":22,"tag":207,"props":2984,"children":2985},{"style":214},[2986],{"type":27,"value":2037},{"type":22,"tag":207,"props":2988,"children":2989},{"class":209,"line":822},[2990],{"type":22,"tag":207,"props":2991,"children":2992},{"style":214},[2993],{"type":27,"value":2994},"    {\n",{"type":22,"tag":207,"props":2996,"children":2997},{"class":209,"line":838},[2998,3003,3008],{"type":22,"tag":207,"props":2999,"children":3000},{"style":214},[3001],{"type":27,"value":3002},"        injector.",{"type":22,"tag":207,"props":3004,"children":3005},{"style":226},[3006],{"type":27,"value":3007},"inject",{"type":22,"tag":207,"props":3009,"children":3010},{"style":214},[3011],{"type":27,"value":3012},"(gContent[i].text, i, synchro);\n",{"type":22,"tag":207,"props":3014,"children":3015},{"class":209,"line":1293},[3016],{"type":22,"tag":207,"props":3017,"children":3018},{"style":214},[3019],{"type":27,"value":3020},"    }\n",{"type":22,"tag":207,"props":3022,"children":3023},{"class":209,"line":1309},[3024],{"type":22,"tag":207,"props":3025,"children":3026},{"emptyLinePlaceholder":1313},[3027],{"type":27,"value":1316},{"type":22,"tag":207,"props":3029,"children":3030},{"class":209,"line":1319},[3031],{"type":22,"tag":207,"props":3032,"children":3033},{"style":214},[3034],{"type":27,"value":3035},"};\n",{"type":22,"tag":23,"props":3037,"children":3038},{},[3039],{"type":27,"value":3040},"These injectors are, as noted, provided by the index in question, and are called when open the engine with the specified indexes, as below:",{"type":22,"tag":197,"props":3042,"children":3044},{"className":1984,"code":3043,"language":1986,"meta":8,"style":8},"try{\n    this.engine.open(this.indexes,\n        fullproof.make_callback(this.ready, true), fullproof.make_callback(this.ready, false));\n}catch(e)\n{\n    progress.find('.bar').addClass('bar-danger');\n    progress.find('p').text('Failed to open search indexes. Search not available.');\n    this.debug &amp;&amp; console.log(e);\n}\n",[3045],{"type":22,"tag":175,"props":3046,"children":3047},{"__ignoreMap":8},[3048,3061,3092,3152,3170,3177,3221,3262,3302],{"type":22,"tag":207,"props":3049,"children":3050},{"class":209,"line":210},[3051,3056],{"type":22,"tag":207,"props":3052,"children":3053},{"style":2007},[3054],{"type":27,"value":3055},"try",{"type":22,"tag":207,"props":3057,"children":3058},{"style":214},[3059],{"type":27,"value":3060},"{\n",{"type":22,"tag":207,"props":3062,"children":3063},{"class":209,"line":248},[3064,3069,3074,3079,3083,3087],{"type":22,"tag":207,"props":3065,"children":3066},{"style":1996},[3067],{"type":27,"value":3068},"    this",{"type":22,"tag":207,"props":3070,"children":3071},{"style":214},[3072],{"type":27,"value":3073},".engine.",{"type":22,"tag":207,"props":3075,"children":3076},{"style":226},[3077],{"type":27,"value":3078},"open",{"type":22,"tag":207,"props":3080,"children":3081},{"style":214},[3082],{"type":27,"value":2027},{"type":22,"tag":207,"props":3084,"children":3085},{"style":1996},[3086],{"type":27,"value":1999},{"type":22,"tag":207,"props":3088,"children":3089},{"style":214},[3090],{"type":27,"value":3091},".indexes,\n",{"type":22,"tag":207,"props":3093,"children":3094},{"class":209,"line":292},[3095,3100,3105,3109,3113,3118,3122,3127,3131,3135,3139,3143,3147],{"type":22,"tag":207,"props":3096,"children":3097},{"style":214},[3098],{"type":27,"value":3099},"        fullproof.",{"type":22,"tag":207,"props":3101,"children":3102},{"style":226},[3103],{"type":27,"value":3104},"make_callback",{"type":22,"tag":207,"props":3106,"children":3107},{"style":214},[3108],{"type":27,"value":2027},{"type":22,"tag":207,"props":3110,"children":3111},{"style":1996},[3112],{"type":27,"value":1999},{"type":22,"tag":207,"props":3114,"children":3115},{"style":214},[3116],{"type":27,"value":3117},".ready, ",{"type":22,"tag":207,"props":3119,"children":3120},{"style":1996},[3121],{"type":27,"value":2317},{"type":22,"tag":207,"props":3123,"children":3124},{"style":214},[3125],{"type":27,"value":3126},"), fullproof.",{"type":22,"tag":207,"props":3128,"children":3129},{"style":226},[3130],{"type":27,"value":3104},{"type":22,"tag":207,"props":3132,"children":3133},{"style":214},[3134],{"type":27,"value":2027},{"type":22,"tag":207,"props":3136,"children":3137},{"style":1996},[3138],{"type":27,"value":1999},{"type":22,"tag":207,"props":3140,"children":3141},{"style":214},[3142],{"type":27,"value":3117},{"type":22,"tag":207,"props":3144,"children":3145},{"style":1996},[3146],{"type":27,"value":2299},{"type":22,"tag":207,"props":3148,"children":3149},{"style":214},[3150],{"type":27,"value":3151},"));\n",{"type":22,"tag":207,"props":3153,"children":3154},{"class":209,"line":335},[3155,3160,3165],{"type":22,"tag":207,"props":3156,"children":3157},{"style":214},[3158],{"type":27,"value":3159},"}",{"type":22,"tag":207,"props":3161,"children":3162},{"style":2007},[3163],{"type":27,"value":3164},"catch",{"type":22,"tag":207,"props":3166,"children":3167},{"style":214},[3168],{"type":27,"value":3169},"(e)\n",{"type":22,"tag":207,"props":3171,"children":3172},{"class":209,"line":366},[3173],{"type":22,"tag":207,"props":3174,"children":3175},{"style":214},[3176],{"type":27,"value":3060},{"type":22,"tag":207,"props":3178,"children":3179},{"class":209,"line":399},[3180,3185,3190,3194,3199,3203,3208,3212,3217],{"type":22,"tag":207,"props":3181,"children":3182},{"style":214},[3183],{"type":27,"value":3184},"    progress.",{"type":22,"tag":207,"props":3186,"children":3187},{"style":226},[3188],{"type":27,"value":3189},"find",{"type":22,"tag":207,"props":3191,"children":3192},{"style":214},[3193],{"type":27,"value":2027},{"type":22,"tag":207,"props":3195,"children":3196},{"style":237},[3197],{"type":27,"value":3198},"'.bar'",{"type":22,"tag":207,"props":3200,"children":3201},{"style":214},[3202],{"type":27,"value":1879},{"type":22,"tag":207,"props":3204,"children":3205},{"style":226},[3206],{"type":27,"value":3207},"addClass",{"type":22,"tag":207,"props":3209,"children":3210},{"style":214},[3211],{"type":27,"value":2027},{"type":22,"tag":207,"props":3213,"children":3214},{"style":237},[3215],{"type":27,"value":3216},"'bar-danger'",{"type":22,"tag":207,"props":3218,"children":3219},{"style":214},[3220],{"type":27,"value":2913},{"type":22,"tag":207,"props":3222,"children":3223},{"class":209,"line":416},[3224,3228,3232,3236,3241,3245,3249,3253,3258],{"type":22,"tag":207,"props":3225,"children":3226},{"style":214},[3227],{"type":27,"value":3184},{"type":22,"tag":207,"props":3229,"children":3230},{"style":226},[3231],{"type":27,"value":3189},{"type":22,"tag":207,"props":3233,"children":3234},{"style":214},[3235],{"type":27,"value":2027},{"type":22,"tag":207,"props":3237,"children":3238},{"style":237},[3239],{"type":27,"value":3240},"'p'",{"type":22,"tag":207,"props":3242,"children":3243},{"style":214},[3244],{"type":27,"value":1879},{"type":22,"tag":207,"props":3246,"children":3247},{"style":226},[3248],{"type":27,"value":27},{"type":22,"tag":207,"props":3250,"children":3251},{"style":214},[3252],{"type":27,"value":2027},{"type":22,"tag":207,"props":3254,"children":3255},{"style":237},[3256],{"type":27,"value":3257},"'Failed to open search indexes. Search not available.'",{"type":22,"tag":207,"props":3259,"children":3260},{"style":214},[3261],{"type":27,"value":2913},{"type":22,"tag":207,"props":3263,"children":3264},{"class":209,"line":433},[3265,3269,3274,3278,3283,3287,3292,3297],{"type":22,"tag":207,"props":3266,"children":3267},{"style":1996},[3268],{"type":27,"value":3068},{"type":22,"tag":207,"props":3270,"children":3271},{"style":214},[3272],{"type":27,"value":3273},".debug ",{"type":22,"tag":207,"props":3275,"children":3276},{"style":2007},[3277],{"type":27,"value":2972},{"type":22,"tag":207,"props":3279,"children":3280},{"style":214},[3281],{"type":27,"value":3282},"amp;",{"type":22,"tag":207,"props":3284,"children":3285},{"style":2007},[3286],{"type":27,"value":2972},{"type":22,"tag":207,"props":3288,"children":3289},{"style":214},[3290],{"type":27,"value":3291},"amp; console.",{"type":22,"tag":207,"props":3293,"children":3294},{"style":226},[3295],{"type":27,"value":3296},"log",{"type":22,"tag":207,"props":3298,"children":3299},{"style":214},[3300],{"type":27,"value":3301},"(e);\n",{"type":22,"tag":207,"props":3303,"children":3304},{"class":209,"line":450},[3305],{"type":22,"tag":207,"props":3306,"children":3307},{"style":214},[3308],{"type":27,"value":3309},"}\n",{"type":22,"tag":23,"props":3311,"children":3312},{},[3313],{"type":27,"value":3314},"You'll notice we have this set up in a try-catch block - fullproof with throw an exception if the engine fails to open, which we can then (hopefully) use to debug the problem, or provide some meaningful error message for the user.",{"type":22,"tag":115,"props":3316,"children":3317},{},[3318],{"type":22,"tag":23,"props":3319,"children":3320},{},[3321,3323,3329,3331,3337],{"type":27,"value":3322},"An aside: If you're curious about ",{"type":22,"tag":175,"props":3324,"children":3326},{"className":3325},[],[3327],{"type":27,"value":3328},"this.debug && console.log(e);",{"type":27,"value":3330},", this is simply a convenient way of toggling logging on and off at a single point, without needing to go through your code and route all of the console.log calls out. Instead, you simply set ",{"type":22,"tag":175,"props":3332,"children":3334},{"className":3333},[],[3335],{"type":27,"value":3336},"this.debug",{"type":27,"value":3338}," to false, and those console.log calls will never be made.",{"type":22,"tag":23,"props":3340,"children":3341},{},[3342,3344,3350],{"type":27,"value":3343},"You'll notice we've specified two callbacks, each to the same function (",{"type":22,"tag":175,"props":3345,"children":3347},{"className":3346},[],[3348],{"type":27,"value":3349},"this.ready",{"type":27,"value":3351},") passing true in the case of success, and false in the case of failure. In our code, this simply sets the search side panel to available, and enables the search button and field if true is passed, or displays a user-friendly error message otherwise. It would be in this callback function that you'd do whatever is needed to mark for your app that search is now ready to go.",{"type":22,"tag":93,"props":3353,"children":3355},{"id":3354},"things-are-looking-up",[3356],{"type":27,"value":3357},"Things are looking up",{"type":22,"tag":23,"props":3359,"children":3360},{},[3361],{"type":27,"value":3362},"Finally, for the sake of completeness, let's take a quick look at what a (stripped-down) version of the actual lookup is like.",{"type":22,"tag":197,"props":3364,"children":3366},{"className":1984,"code":3365,"language":1986,"meta":8,"style":8},"this.engine.lookup(value, function(resultSet){\n    if (!resultSet || !resultSet.getSize())\n    {\n        that.debug &amp;&amp; console.log(&quot;No Results Found.&quot;);\n        return;\n    }\n// Higher scoring items should be displayed first\nresultSet.setComparatorObject({\n    lower_than: function(a,b) {\n        return a.score &amp;gt; b.score;\n    },\n    equals: function(a,b) {\n        return a.score === b.score;\n    }\n});\n// Filter for unique values in resultSet\nvar values = [],\n    len = resultSet.data.length;\nwhile(len--)\n{\n    (values.indexOf(resultSet.data[len].value) !== -1) ? resultSet.data.splice(len, 1) :\n        values.push(resultSet.data[len].value);\n}\n// For each result in the resultSet, create a direct link to the appropriate section, and\n// display a collapsible div showing context.\nresultSet.forEach(function(entry){\n    var result = that.gContent[entry.value];\n    // Create links, etc. here\n    that.debug &amp;amp;&amp;amp; console.log(that.gContent[entry.value]);\n});\n\n});\n",[3367],{"type":22,"tag":175,"props":3368,"children":3369},{"__ignoreMap":8},[3370,3408,3455,3462,3512,3524,3531,3539,3555,3595,3616,3624,3660,3681,3688,3696,3704,3725,3750,3772,3779,3849,3867,3874,3882,3890,3923,3944,3952,3987,3995,4003],{"type":22,"tag":207,"props":3371,"children":3372},{"class":209,"line":210},[3373,3377,3381,3386,3391,3395,3399,3404],{"type":22,"tag":207,"props":3374,"children":3375},{"style":1996},[3376],{"type":27,"value":1999},{"type":22,"tag":207,"props":3378,"children":3379},{"style":214},[3380],{"type":27,"value":3073},{"type":22,"tag":207,"props":3382,"children":3383},{"style":226},[3384],{"type":27,"value":3385},"lookup",{"type":22,"tag":207,"props":3387,"children":3388},{"style":214},[3389],{"type":27,"value":3390},"(value, ",{"type":22,"tag":207,"props":3392,"children":3393},{"style":2007},[3394],{"type":27,"value":2374},{"type":22,"tag":207,"props":3396,"children":3397},{"style":214},[3398],{"type":27,"value":2027},{"type":22,"tag":207,"props":3400,"children":3401},{"style":2381},[3402],{"type":27,"value":3403},"resultSet",{"type":22,"tag":207,"props":3405,"children":3406},{"style":214},[3407],{"type":27,"value":2846},{"type":22,"tag":207,"props":3409,"children":3410},{"class":209,"line":248},[3411,3416,3420,3425,3430,3435,3440,3445,3450],{"type":22,"tag":207,"props":3412,"children":3413},{"style":2007},[3414],{"type":27,"value":3415},"    if",{"type":22,"tag":207,"props":3417,"children":3418},{"style":214},[3419],{"type":27,"value":2926},{"type":22,"tag":207,"props":3421,"children":3422},{"style":2007},[3423],{"type":27,"value":3424},"!",{"type":22,"tag":207,"props":3426,"children":3427},{"style":214},[3428],{"type":27,"value":3429},"resultSet ",{"type":22,"tag":207,"props":3431,"children":3432},{"style":2007},[3433],{"type":27,"value":3434},"||",{"type":22,"tag":207,"props":3436,"children":3437},{"style":2007},[3438],{"type":27,"value":3439}," !",{"type":22,"tag":207,"props":3441,"children":3442},{"style":214},[3443],{"type":27,"value":3444},"resultSet.",{"type":22,"tag":207,"props":3446,"children":3447},{"style":226},[3448],{"type":27,"value":3449},"getSize",{"type":22,"tag":207,"props":3451,"children":3452},{"style":214},[3453],{"type":27,"value":3454},"())\n",{"type":22,"tag":207,"props":3456,"children":3457},{"class":209,"line":292},[3458],{"type":22,"tag":207,"props":3459,"children":3460},{"style":214},[3461],{"type":27,"value":2994},{"type":22,"tag":207,"props":3463,"children":3464},{"class":209,"line":335},[3465,3470,3474,3478,3482,3486,3490,3494,3498,3503,3507],{"type":22,"tag":207,"props":3466,"children":3467},{"style":214},[3468],{"type":27,"value":3469},"        that.debug ",{"type":22,"tag":207,"props":3471,"children":3472},{"style":2007},[3473],{"type":27,"value":2972},{"type":22,"tag":207,"props":3475,"children":3476},{"style":214},[3477],{"type":27,"value":3282},{"type":22,"tag":207,"props":3479,"children":3480},{"style":2007},[3481],{"type":27,"value":2972},{"type":22,"tag":207,"props":3483,"children":3484},{"style":214},[3485],{"type":27,"value":3291},{"type":22,"tag":207,"props":3487,"children":3488},{"style":226},[3489],{"type":27,"value":3296},{"type":22,"tag":207,"props":3491,"children":3492},{"style":214},[3493],{"type":27,"value":2027},{"type":22,"tag":207,"props":3495,"children":3496},{"style":2007},[3497],{"type":27,"value":2972},{"type":22,"tag":207,"props":3499,"children":3500},{"style":214},[3501],{"type":27,"value":3502},"quot;No Results Found.",{"type":22,"tag":207,"props":3504,"children":3505},{"style":2007},[3506],{"type":27,"value":2972},{"type":22,"tag":207,"props":3508,"children":3509},{"style":214},[3510],{"type":27,"value":3511},"quot;);\n",{"type":22,"tag":207,"props":3513,"children":3514},{"class":209,"line":366},[3515,3520],{"type":22,"tag":207,"props":3516,"children":3517},{"style":2007},[3518],{"type":27,"value":3519},"        return",{"type":22,"tag":207,"props":3521,"children":3522},{"style":214},[3523],{"type":27,"value":2873},{"type":22,"tag":207,"props":3525,"children":3526},{"class":209,"line":399},[3527],{"type":22,"tag":207,"props":3528,"children":3529},{"style":214},[3530],{"type":27,"value":3020},{"type":22,"tag":207,"props":3532,"children":3533},{"class":209,"line":416},[3534],{"type":22,"tag":207,"props":3535,"children":3536},{"style":508},[3537],{"type":27,"value":3538},"// Higher scoring items should be displayed first\n",{"type":22,"tag":207,"props":3540,"children":3541},{"class":209,"line":433},[3542,3546,3550],{"type":22,"tag":207,"props":3543,"children":3544},{"style":214},[3545],{"type":27,"value":3444},{"type":22,"tag":207,"props":3547,"children":3548},{"style":226},[3549],{"type":27,"value":2352},{"type":22,"tag":207,"props":3551,"children":3552},{"style":214},[3553],{"type":27,"value":3554},"({\n",{"type":22,"tag":207,"props":3556,"children":3557},{"class":209,"line":450},[3558,3563,3568,3572,3576,3580,3585,3590],{"type":22,"tag":207,"props":3559,"children":3560},{"style":226},[3561],{"type":27,"value":3562},"    lower_than",{"type":22,"tag":207,"props":3564,"children":3565},{"style":214},[3566],{"type":27,"value":3567},": ",{"type":22,"tag":207,"props":3569,"children":3570},{"style":2007},[3571],{"type":27,"value":2374},{"type":22,"tag":207,"props":3573,"children":3574},{"style":214},[3575],{"type":27,"value":2027},{"type":22,"tag":207,"props":3577,"children":3578},{"style":2381},[3579],{"type":27,"value":30},{"type":22,"tag":207,"props":3581,"children":3582},{"style":214},[3583],{"type":27,"value":3584},",",{"type":22,"tag":207,"props":3586,"children":3587},{"style":2381},[3588],{"type":27,"value":3589},"b",{"type":22,"tag":207,"props":3591,"children":3592},{"style":214},[3593],{"type":27,"value":3594},") {\n",{"type":22,"tag":207,"props":3596,"children":3597},{"class":209,"line":467},[3598,3602,3607,3611],{"type":22,"tag":207,"props":3599,"children":3600},{"style":2007},[3601],{"type":27,"value":3519},{"type":22,"tag":207,"props":3603,"children":3604},{"style":214},[3605],{"type":27,"value":3606}," a.score ",{"type":22,"tag":207,"props":3608,"children":3609},{"style":2007},[3610],{"type":27,"value":2972},{"type":22,"tag":207,"props":3612,"children":3613},{"style":214},[3614],{"type":27,"value":3615},"amp;gt; b.score;\n",{"type":22,"tag":207,"props":3617,"children":3618},{"class":209,"line":790},[3619],{"type":22,"tag":207,"props":3620,"children":3621},{"style":214},[3622],{"type":27,"value":3623},"    },\n",{"type":22,"tag":207,"props":3625,"children":3626},{"class":209,"line":806},[3627,3632,3636,3640,3644,3648,3652,3656],{"type":22,"tag":207,"props":3628,"children":3629},{"style":226},[3630],{"type":27,"value":3631},"    equals",{"type":22,"tag":207,"props":3633,"children":3634},{"style":214},[3635],{"type":27,"value":3567},{"type":22,"tag":207,"props":3637,"children":3638},{"style":2007},[3639],{"type":27,"value":2374},{"type":22,"tag":207,"props":3641,"children":3642},{"style":214},[3643],{"type":27,"value":2027},{"type":22,"tag":207,"props":3645,"children":3646},{"style":2381},[3647],{"type":27,"value":30},{"type":22,"tag":207,"props":3649,"children":3650},{"style":214},[3651],{"type":27,"value":3584},{"type":22,"tag":207,"props":3653,"children":3654},{"style":2381},[3655],{"type":27,"value":3589},{"type":22,"tag":207,"props":3657,"children":3658},{"style":214},[3659],{"type":27,"value":3594},{"type":22,"tag":207,"props":3661,"children":3662},{"class":209,"line":822},[3663,3667,3671,3676],{"type":22,"tag":207,"props":3664,"children":3665},{"style":2007},[3666],{"type":27,"value":3519},{"type":22,"tag":207,"props":3668,"children":3669},{"style":214},[3670],{"type":27,"value":3606},{"type":22,"tag":207,"props":3672,"children":3673},{"style":2007},[3674],{"type":27,"value":3675},"===",{"type":22,"tag":207,"props":3677,"children":3678},{"style":214},[3679],{"type":27,"value":3680}," b.score;\n",{"type":22,"tag":207,"props":3682,"children":3683},{"class":209,"line":838},[3684],{"type":22,"tag":207,"props":3685,"children":3686},{"style":214},[3687],{"type":27,"value":3020},{"type":22,"tag":207,"props":3689,"children":3690},{"class":209,"line":1293},[3691],{"type":22,"tag":207,"props":3692,"children":3693},{"style":214},[3694],{"type":27,"value":3695},"});\n",{"type":22,"tag":207,"props":3697,"children":3698},{"class":209,"line":1309},[3699],{"type":22,"tag":207,"props":3700,"children":3701},{"style":508},[3702],{"type":27,"value":3703},"// Filter for unique values in resultSet\n",{"type":22,"tag":207,"props":3705,"children":3706},{"class":209,"line":1319},[3707,3711,3716,3720],{"type":22,"tag":207,"props":3708,"children":3709},{"style":2007},[3710],{"type":27,"value":2931},{"type":22,"tag":207,"props":3712,"children":3713},{"style":214},[3714],{"type":27,"value":3715}," values ",{"type":22,"tag":207,"props":3717,"children":3718},{"style":2007},[3719],{"type":27,"value":234},{"type":22,"tag":207,"props":3721,"children":3722},{"style":214},[3723],{"type":27,"value":3724}," [],\n",{"type":22,"tag":207,"props":3726,"children":3727},{"class":209,"line":1328},[3728,3733,3737,3742,3746],{"type":22,"tag":207,"props":3729,"children":3730},{"style":214},[3731],{"type":27,"value":3732},"    len ",{"type":22,"tag":207,"props":3734,"children":3735},{"style":2007},[3736],{"type":27,"value":234},{"type":22,"tag":207,"props":3738,"children":3739},{"style":214},[3740],{"type":27,"value":3741}," resultSet.data.",{"type":22,"tag":207,"props":3743,"children":3744},{"style":1996},[3745],{"type":27,"value":2908},{"type":22,"tag":207,"props":3747,"children":3748},{"style":214},[3749],{"type":27,"value":2873},{"type":22,"tag":207,"props":3751,"children":3752},{"class":209,"line":1370},[3753,3758,3763,3768],{"type":22,"tag":207,"props":3754,"children":3755},{"style":2007},[3756],{"type":27,"value":3757},"while",{"type":22,"tag":207,"props":3759,"children":3760},{"style":214},[3761],{"type":27,"value":3762},"(len",{"type":22,"tag":207,"props":3764,"children":3765},{"style":2007},[3766],{"type":27,"value":3767},"--",{"type":22,"tag":207,"props":3769,"children":3770},{"style":214},[3771],{"type":27,"value":2037},{"type":22,"tag":207,"props":3773,"children":3774},{"class":209,"line":1411},[3775],{"type":22,"tag":207,"props":3776,"children":3777},{"style":214},[3778],{"type":27,"value":3060},{"type":22,"tag":207,"props":3780,"children":3781},{"class":209,"line":1469},[3782,3787,3792,3797,3802,3807,3812,3817,3822,3826,3831,3836,3840,3844],{"type":22,"tag":207,"props":3783,"children":3784},{"style":214},[3785],{"type":27,"value":3786},"    (values.",{"type":22,"tag":207,"props":3788,"children":3789},{"style":226},[3790],{"type":27,"value":3791},"indexOf",{"type":22,"tag":207,"props":3793,"children":3794},{"style":214},[3795],{"type":27,"value":3796},"(resultSet.data[len].value) ",{"type":22,"tag":207,"props":3798,"children":3799},{"style":2007},[3800],{"type":27,"value":3801},"!==",{"type":22,"tag":207,"props":3803,"children":3804},{"style":2007},[3805],{"type":27,"value":3806}," -",{"type":22,"tag":207,"props":3808,"children":3809},{"style":1996},[3810],{"type":27,"value":3811},"1",{"type":22,"tag":207,"props":3813,"children":3814},{"style":214},[3815],{"type":27,"value":3816},") ",{"type":22,"tag":207,"props":3818,"children":3819},{"style":2007},[3820],{"type":27,"value":3821},"?",{"type":22,"tag":207,"props":3823,"children":3824},{"style":214},[3825],{"type":27,"value":3741},{"type":22,"tag":207,"props":3827,"children":3828},{"style":226},[3829],{"type":27,"value":3830},"splice",{"type":22,"tag":207,"props":3832,"children":3833},{"style":214},[3834],{"type":27,"value":3835},"(len, ",{"type":22,"tag":207,"props":3837,"children":3838},{"style":1996},[3839],{"type":27,"value":3811},{"type":22,"tag":207,"props":3841,"children":3842},{"style":214},[3843],{"type":27,"value":3816},{"type":22,"tag":207,"props":3845,"children":3846},{"style":2007},[3847],{"type":27,"value":3848},":\n",{"type":22,"tag":207,"props":3850,"children":3851},{"class":209,"line":1497},[3852,3857,3862],{"type":22,"tag":207,"props":3853,"children":3854},{"style":214},[3855],{"type":27,"value":3856},"        values.",{"type":22,"tag":207,"props":3858,"children":3859},{"style":226},[3860],{"type":27,"value":3861},"push",{"type":22,"tag":207,"props":3863,"children":3864},{"style":214},[3865],{"type":27,"value":3866},"(resultSet.data[len].value);\n",{"type":22,"tag":207,"props":3868,"children":3869},{"class":209,"line":1537},[3870],{"type":22,"tag":207,"props":3871,"children":3872},{"style":214},[3873],{"type":27,"value":3309},{"type":22,"tag":207,"props":3875,"children":3876},{"class":209,"line":1595},[3877],{"type":22,"tag":207,"props":3878,"children":3879},{"style":508},[3880],{"type":27,"value":3881},"// For each result in the resultSet, create a direct link to the appropriate section, and\n",{"type":22,"tag":207,"props":3883,"children":3884},{"class":209,"line":1624},[3885],{"type":22,"tag":207,"props":3886,"children":3887},{"style":508},[3888],{"type":27,"value":3889},"// display a collapsible div showing context.\n",{"type":22,"tag":207,"props":3891,"children":3892},{"class":209,"line":1640},[3893,3897,3902,3906,3910,3914,3919],{"type":22,"tag":207,"props":3894,"children":3895},{"style":214},[3896],{"type":27,"value":3444},{"type":22,"tag":207,"props":3898,"children":3899},{"style":226},[3900],{"type":27,"value":3901},"forEach",{"type":22,"tag":207,"props":3903,"children":3904},{"style":214},[3905],{"type":27,"value":2027},{"type":22,"tag":207,"props":3907,"children":3908},{"style":2007},[3909],{"type":27,"value":2374},{"type":22,"tag":207,"props":3911,"children":3912},{"style":214},[3913],{"type":27,"value":2027},{"type":22,"tag":207,"props":3915,"children":3916},{"style":2381},[3917],{"type":27,"value":3918},"entry",{"type":22,"tag":207,"props":3920,"children":3921},{"style":214},[3922],{"type":27,"value":2846},{"type":22,"tag":207,"props":3924,"children":3925},{"class":209,"line":1656},[3926,3930,3935,3939],{"type":22,"tag":207,"props":3927,"children":3928},{"style":2007},[3929],{"type":27,"value":2854},{"type":22,"tag":207,"props":3931,"children":3932},{"style":214},[3933],{"type":27,"value":3934}," result ",{"type":22,"tag":207,"props":3936,"children":3937},{"style":2007},[3938],{"type":27,"value":234},{"type":22,"tag":207,"props":3940,"children":3941},{"style":214},[3942],{"type":27,"value":3943}," that.gContent[entry.value];\n",{"type":22,"tag":207,"props":3945,"children":3946},{"class":209,"line":1672},[3947],{"type":22,"tag":207,"props":3948,"children":3949},{"style":508},[3950],{"type":27,"value":3951},"    // Create links, etc. here\n",{"type":22,"tag":207,"props":3953,"children":3954},{"class":209,"line":1688},[3955,3960,3964,3969,3973,3978,3982],{"type":22,"tag":207,"props":3956,"children":3957},{"style":214},[3958],{"type":27,"value":3959},"    that.debug ",{"type":22,"tag":207,"props":3961,"children":3962},{"style":2007},[3963],{"type":27,"value":2972},{"type":22,"tag":207,"props":3965,"children":3966},{"style":214},[3967],{"type":27,"value":3968},"amp;amp;",{"type":22,"tag":207,"props":3970,"children":3971},{"style":2007},[3972],{"type":27,"value":2972},{"type":22,"tag":207,"props":3974,"children":3975},{"style":214},[3976],{"type":27,"value":3977},"amp;amp; console.",{"type":22,"tag":207,"props":3979,"children":3980},{"style":226},[3981],{"type":27,"value":3296},{"type":22,"tag":207,"props":3983,"children":3984},{"style":214},[3985],{"type":27,"value":3986},"(that.gContent[entry.value]);\n",{"type":22,"tag":207,"props":3988,"children":3990},{"class":209,"line":3989},30,[3991],{"type":22,"tag":207,"props":3992,"children":3993},{"style":214},[3994],{"type":27,"value":3695},{"type":22,"tag":207,"props":3996,"children":3998},{"class":209,"line":3997},31,[3999],{"type":22,"tag":207,"props":4000,"children":4001},{"emptyLinePlaceholder":1313},[4002],{"type":27,"value":1316},{"type":22,"tag":207,"props":4004,"children":4006},{"class":209,"line":4005},32,[4007],{"type":22,"tag":207,"props":4008,"children":4009},{"style":214},[4010],{"type":27,"value":3695},{"type":22,"tag":23,"props":4012,"children":4013},{},[4014,4016,4022],{"type":27,"value":4015},"So, we call ",{"type":22,"tag":175,"props":4017,"children":4019},{"className":4018},[],[4020],{"type":27,"value":4021},"this.engine.lookup",{"type":27,"value":4023}," with the value we want to search for, receving a resultSet (an object of type fullproof.ResultSet), which we then proceed to set a comparator on (in order to get the order we desire), filter to make sure only unique entries are returned, and for each, create some element to represent the result.",{"type":22,"tag":23,"props":4025,"children":4026},{},[4027],{"type":27,"value":4028},"Besides the UI elements involved, that's about all there is to it! It works quite well (surprisingly so, for an entirely client-side solution to search). If you happen to be involved in a project that can't rely on a server-side solution to search, fullproof might well be the answer you've been looking for.",{"type":22,"tag":1829,"props":4030,"children":4031},{},[4032],{"type":27,"value":1833},{"title":8,"searchDepth":292,"depth":292,"links":4034},[4035,4036],{"id":1973,"depth":335,"text":1976},{"id":2074,"depth":248,"text":2077,"children":4037},[4038],{"id":3354,"depth":335,"text":3357},"content:ckeefer:2013-08:fullproof-fulltext-search.md","ckeefer/2013-08/fullproof-fulltext-search.md","ckeefer/2013-08/fullproof-fulltext-search",{"user":1850,"name":1851},1780330271277]