MediaWiki:ExtractFirst.xsl

Hallo, je bent hier gekomen op zoek naar de betekenis van het woord MediaWiki:ExtractFirst.xsl. In DICTIOUS vind je niet alleen alle woordenboekbetekenissen van het woord MediaWiki:ExtractFirst.xsl, maar kom je ook meer te weten over de etymologie, de kenmerken en hoe je MediaWiki:ExtractFirst.xsl in enkelvoud en meervoud uitspreekt. Alles wat je moet weten over het woord MediaWiki:ExtractFirst.xsl is hier. De definitie van het woord MediaWiki:ExtractFirst.xsl zal u helpen preciezer en correcter te zijn bij het spreken of schrijven van uw teksten. Kennis van de definitie vanMediaWiki:ExtractFirst.xsl, maar ook van die van andere woorden, verrijkt uw woordenschat en verschaft u meer en betere taalkundige bronnen.
<?xml version="1.0" encoding="UTF-8"?>
 <!-- This is for extracting the first definition of a word from wiktionary, that can be used in a cross site manner. Consider: 
 http://en.wiktionary.org/w/api.php?action=parse&prop=text&page=word&format=xml&xslt=MediaWiki:extractFirst.xsl -->
 <xsl:stylesheet version="1.0"
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 <xsl:output method='html'/>
 <!-- for translation. Also see JS -->
 <xsl:variable name="dir">ltr</xsl:variable>
 <xsl:variable name="more">» Meer</xsl:variable>
 <xsl:variable name="error">Fout: </xsl:variable>
 <xsl:variable name="copyright"> © <a href="http://nl.wiktionary.orghttps://dictious.com/nl/">WikiWoordenboek</a>. Vrijgegeven onder <a href="http://creativecommons.org/licenses/by-sa/3.0/deed.nl" rel="license copyright">CC-BY-SA 3.0</a></xsl:variable>
 <xsl:variable name="contentLang" select="'nl'"/> <!-- make sure quoted-->

<!-- other variables -->

 <!--<xsl:variable name="pageName" select="string(/api@requestid)"/> -->

 <!--<xsl:variable name="pageNamedf" select="escape-html-uri('../foo')"/>-->
 <xsl:variable name="pageName" select="concat('http://', $contentLang, '.wiktionary.org')"/>
<!-- end translation. see js as well -->
 <xsl:template match="/">

 <html dir="{$dir}" lang="{$contentLang}" xml:lang="{$contentLang}">
 <head>
 <meta name="generator" content="Wiktionary Extract XSLT 1.04-NL"/>
 <base target='_blank' href="{$pageName}" />
<title> Wiktionary extract</title>
 
 <style>
 .disambig-see-also, .disambig-see-also-2 {display:inline;}
 #container {background-color:white; padding: 0.5em; border: solid black thin;}
 a.new {color: red;}
 #error {color: red;font-size:larger;}
 </style>
 <script type='text/javascript'>
 /*<![CDATA[*/
 function setup () {
 //Stuff to translate:
 var preferLang = {'nl': 'Nederlands', 'en': 'Engels', 'qqqAny': null}; //for now.
 var extractSeeAlso = /<table class=\"bandeau-voir\"*>*?(*?*?)<\/td>*?<\/table>/; //Modified elsewhere!
 var see_also_process = function (sa) {
  return sa.replace(/<a*><img*\/><\/a>/, '');
 }
 var missing = 'Could not retrieve definition of $1.';
 //Stuff not to translate in general (setup).


 var pageURL = 'https://dictious.com/nl/' +location.search.match(/\&page\=(*)/);
 var src = document.getElementById('src');
 var display = document.getElementById('word-list');
 var loc = location.search.match(/\&page\=(*)/);
 var preferLangCode = location.search.match(/\&lang\=(*)/);
 if (preferLangCode) { preferLangCode = preferLangCode; }
 else {preferLangCode = 'qqqAny';}
 src.normalize();
 var html = src.firstChild.data;
 var def = html //may be redefined later.

  //stuff you might need to translate, but hopefully won't
  var subSectRegex = new RegExp('<h2><span class="mw-headline" id="' + preferLang + '"*>*$'); //this is ugly
  var extractCurLangName = /<span class="mw-headline" id*>(*?)<\/span>/; //first subexpression
 
 try {
  //this assumes attribute order doesn't change!!!
  html = html.replace(/<div id="toctitle">*?<\/div>/, '');
  if (preferLangCode && preferLang) {
   try {
    //strip off all definitions before tagret lang.
    var subSect = html.match(subSectRegex);
    if (subSect.match(/<ol>*?<li>/)) {
     //if it has content
     def = subSect;
    }
   } catch (e) { /*alert(e)*/}
  } 
  var lang = def.match(extractCurLangName);
  display.innerHTML = '(' + lang + ') ' +  def.match(/<ol>*?<\/ol>/).replace(/<dl>*?<\/dl>/g, '').replace(/<div*>*?<\/div>/g, '').replace(/<ul>*?<\/ul>/g, '').match(/<li>(*?)<\/li>/);
 }
 catch (e) {
  //alert(e)
  //page does not exist, not well formed, these regexs suck, etc
  display.appendChild(document.createTextNode(mising.replace('$1', decodeURIComponent(loc))));
  if (decodeURIComponent(loc).match(//) && !location.search.match(/\&rd/)) {
   //make sure don't have loops, if first character is for example % encoded.
   //should probably decode it.
   location = location.href.replace(/(^*?\&page\=)*(*$)/, '$1'+ loc.charAt(0).toLowerCase() + loc.substring(1, loc.length) + '$2&rd');
  }
 }
 var sa = html.match(extractSeeAlso);
 if(sa) {
  document.getElementById('see-also').innerHTML = ' (' + see_also_process(sa) + ')' ;
 }
 document.getElementsByTagName('base').href += pageURL; //this doesn't do anything.
 document.getElementById('more-link').href= pageURL;
 
}

 /*]]>*/
 </script>
</head>
 <body onload='setup()'>
 <div id='container'>
 <div id='word-list'><xsl:apply-templates select='api/error'/></div>
 <div><a id='more-link'><xsl:value-of select="$more"/></a> <span id='see-also'/> <small id="copyright-notice"> <xsl:copy-of select="$copyright"/></small>
 </div>  
 </div>
 <div id='src' style='display:None'>
  <xsl:value-of select='api/parse/text'/>
 </div>
 </body>
 </html>

 </xsl:template>
 <xsl:template match='api/error'>
 <span id='error'><b><xsl:value-of select="$error"/></b> <xsl:value-of select='@info'/></span>
 </xsl:template>

 </xsl:stylesheet>