Jump to content

Topic on Help talk:ExpandTemplates

Expand Templates to HTML RAW

1
חגי1234 (talkcontribs)

Hi!

I want to use ExpandTemplates Api, but I want it to expand templates not to <template> tags etc. but to <div> to other formats, how to do it?

Not to this :

<template lineStart="1">

      <title>עמודות</title>

      <part>

        <name index="1" />

        <value>2</value>

      </part>

</template>

But to this :

<div style="width: 100%; overflow: hidden; display: table;">

<div style="direction: rtl; text-align: right; display: table-cell; *float: right; *width: 49%; padding-left: 5px;">אֲמָרָה</div>

<div style="direction: ltr; text-align: left; display: table-cell; *float: left; *width: 49%; padding-right: 5px;">statement</div>

</div>


I'm using these params in post requset (C#):

                  var values = new NameValueCollection();

                        values["action"] = "parse";

                        values["text"] =  WikiDocument.ToString();

                        values["prop"] = "parsetree";

                        values["format"] = "xml";

                   webClient.Encoding = Encoding.UTF8;

                  var response = webClient.UploadValues("https://en.wikipedia.org/w/api.php", values);

Thanks!

Reply to "Expand Templates to HTML RAW"