What I am trying to achieve is clusters (subgraphs) side by side while their content is also side by side as demonstrated in this image:
but all I can make is the top-bottom behavior of the subgraphs as in this image:
I am aware that this is an open issue (Allow different rankdir for subgraph cluster)
But I also saw some workarounds for similar issues ( i.e. top-down subgraphs, left-right inside subgraphs, GraphViz - How to have a subgraph be left-to-right when main graph is top-to-bottom?)
Based on the workarounds I could get a diagonal representation:
but not the desired one.
this is my .Dot file:
digraph {
node [shape=plain]
rankdir=LR;
subgraph cluster_Asia {
label = "Asia";
China [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>China</i></td></tr>
<tr><td bgcolor="yellow" port="Shanghai">Shanghai</td></tr>
<tr><td bgcolor="white" port="Beijing">Beijing</td></tr>
<tr><td bgcolor="white" port="Chongqing">Chongqing</td></tr>
<tr><td bgcolor="white" port="Tianjin">Tianjin</td></tr>
</table>>];
India [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>India</i></td></tr>
<tr><td bgcolor="yellow" port="NewDelhi">NewDelhi</td></tr>
<tr><td bgcolor="white" port="Mumbai">Mumbai</td></tr>
<tr><td bgcolor="white" port="Bangalore">Bangalore</td></tr>
<tr><td bgcolor="white" port="Ahmadabad">Ahmadabad</td></tr>
</table>>];
Thailand [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Thailand</i></td></tr>
<tr><td bgcolor="yellow" port="Bangkok">Bangkok</td></tr>
<tr><td bgcolor="white" port="ChiangRai">ChiangRai</td></tr>
</table>>];
Nepal [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Nepal</i></td></tr>
<tr><td bgcolor="yellow" port="Kathmandu">Kathmandu</td></tr>
<tr><td bgcolor="white" port="Birgunj">Birgunj</td></tr>
</table>>];
China:Shanghai->Thailand:Bangkok[color="blue", style=solid ]
China:Beijing->Nepal:Kathmandu[color="blue", style=solid ]
China:Tianjin->India:NewDelhi[color="blue",style=solid ]
China:Chongqing->India:Ahmadabad[color="blue", style=solid ]
India:Ahmadabad->India:Mumbai[color="blue", style=solid ]
}
subgraph cluster_Europe {
label = "Europe";
Spain [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Spain</i></td></tr>
<tr><td bgcolor="yellow" port="Madrid">Madrid</td></tr>
<tr><td bgcolor="white" port="Malaga">Malaga</td></tr>
<tr><td bgcolor="white" port="Barcelona">Barcelona</td></tr>
<tr><td bgcolor="white" port="Valencia">Valencia</td></tr>
</table>>];
Netherlands [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Netherlands</i></td></tr>
<tr><td bgcolor="yellow" port="Amsterdam">Amsterdam</td></tr>
<tr><td bgcolor="white" port="Rotterdam">Rotterdam</td></tr>
<tr><td bgcolor="white" port="Dokkum">Dokkum</td></tr>
</table>>];
Italy [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Italy</i></td></tr>
<tr><td bgcolor="yellow" port="Rome">Rome</td></tr>
<tr><td bgcolor="white" port="Venice">Venice</td></tr>
<tr><td bgcolor="white" port="Milan">Milan</td></tr>
</table>>];
France [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>France</i></td></tr>
<tr><td bgcolor="yellow" port="Paris">Paris</td></tr>
<tr><td bgcolor="white" port="Nice">Nice</td></tr>
<tr><td bgcolor="white" port="Marseille">Marseille</td></tr>
</table>>];
Spain:Madrid->Netherlands:Dokkum[ color="blue",style=solid ]
Spain:Barcelona->Italy:Milan[ color="blue",style=solid ]
Spain:Malaga->Netherlands:Amsterdam[color="blue", style=solid ]
Spain:Valencia->France:Nice[color="blue", style=solid ]
}
// { rank=same;
// 00 [style=invis];
// 01 [style=invis];
// 00 -> 01 [constraint=false,style=invis];
// }
// 00 -> Spain [style=invis];
// 01 -> China [style=invis];
// Spain -> China [ style=invis];
}
Notice that the diagonal code is commented out at the bottom of the code scope.
My question:
How can I change my code to get a result as similar as possible to the first image?
Thanks to the comment by Albert I've found the solution:
This is the code:
digraph {
node [shape=plain]
rankdir=LR;
subgraph cluster_Asia {
label = "Asia";
China [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>China</i></td></tr>
<tr><td bgcolor="yellow" port="Shanghai">Shanghai</td></tr>
<tr><td bgcolor="white" port="Beijing">Beijing</td></tr>
<tr><td bgcolor="white" port="Chongqing">Chongqing</td></tr>
<tr><td bgcolor="white" port="Tianjin">Tianjin</td></tr>
</table>>];
India [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>India</i></td></tr>
<tr><td bgcolor="yellow" port="NewDelhi">NewDelhi</td></tr>
<tr><td bgcolor="white" port="Mumbai">Mumbai</td></tr>
<tr><td bgcolor="white" port="Bangalore">Bangalore</td></tr>
<tr><td bgcolor="white" port="Ahmadabad">Ahmadabad</td></tr>
</table>>];
Thailand [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Thailand</i></td></tr>
<tr><td bgcolor="yellow" port="Bangkok">Bangkok</td></tr>
<tr><td bgcolor="white" port="ChiangRai">ChiangRai</td></tr>
</table>>];
Nepal [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Nepal</i></td></tr>
<tr><td bgcolor="yellow" port="Kathmandu">Kathmandu</td></tr>
<tr><td bgcolor="white" port="Birgunj">Birgunj</td></tr>
</table>>];
China:Shanghai->Thailand:Bangkok[color="blue", tyle=solid ]
China:Beijing->Nepal:Kathmandu[color="blue", style=solid ]
China:Tianjin->India:NewDelhi[color="blue",style=solid ]
China:Chongqing->India:Ahmadabad[color="blue", style=solid ]
India:Ahmadabad->India:Mumbai[color="blue", style=solid ]
}
subgraph cluster_Europe {
label = "Europe";
Spain [label=<<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Spain</i></td></tr>
<tr><td bgcolor="yellow" port="Madrid">Madrid</td></tr>
<tr><td bgcolor="white" port="Malaga">Malaga</td></tr>
<tr><td bgcolor="white" port="Barcelona">Barcelona</td></tr>
<tr><td bgcolor="white" port="Valencia">Valencia</td></tr>
</table>>];
Netherlands [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Netherlands</i></td></tr>
<tr><td bgcolor="yellow" port="Amsterdam">Amsterdam</td></tr>
<tr><td bgcolor="white" port="Rotterdam">Rotterdam</td></tr>
<tr><td bgcolor="white" port="Dokkum">Dokkum</td></tr>
</table>>];
Italy [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>Italy</i></td></tr>
<tr><td bgcolor="yellow" port="Rome">Rome</td></tr>
<tr><td bgcolor="white" port="Venice">Venice</td></tr>
<tr><td bgcolor="white" port="Milan">Milan</td></tr>
</table>>];
France [label=<
<table border="0" cellborder="1" cellspacing="0">
<tr><td><i>France</i></td></tr>
<tr><td bgcolor="yellow" port="Paris">Paris</td></tr>
<tr><td bgcolor="white" port="Nice">Nice</td></tr>
<tr><td bgcolor="white" port="Marseille">Marseille</td></tr>
</table>>];
Spain:Madrid->Netherlands:Dokkum[ color="blue",style=solid ]
Spain:Barcelona->Italy:Milan[ color="blue",style=solid ]
Spain:Malaga->Netherlands:Amsterdam[color="blue", style=solid ]
Spain:Valencia->France:Nice[color="blue", style=solid ]
}
{
00 [style=invis];
01 [style=invis];
02 [style=invis];
03 [style=invis];
00 -> 01 -> 02 -> 03 [style=invis];
00 -> Spain [style=invis];
01 -> Netherlands [style=invis];
01 -> Italy [style=invis];
01 -> France [style=invis];
02 -> China [style=invis];
03 -> Nepal [style=invis];
03 -> Thailand [style=invis];
03 -> India [style=invis];
Spain -> China [ style=invis];
}
}
The last scope is fixing the layout.
Related
I'd like to automatically retrieve the results of searching for a Chinese character on this webpage. After inputting a character such as '馬' into the search field labelled '字形', submitting the form produces a form called 'HiddenFrom' as follows, the contents of which I'm aiming to output (which would look like the following):
<form Id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });"><input id="ZiOrder" name="ZiOrder" type="hidden" value="" />
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬" />
<input id="PageNo" name="PageNo" type="hidden" value="" />
<input id="Reference" name="Reference" type="hidden" value="" />
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0" />
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom" /></td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="10" align="right" class="Information">
共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize">
<option value="16">16</option>
<option value="20">20</option>
<option value="24">24</option>
<option value="28">28</option>
<option value="32">32</option>
<option value="36" selected="selected">36</option>
<option value="40">40</option>
<option value="44">44</option>
<option value="48">48</option>
<option value="54">54</option>
<option value="60">60</option>
<option value="66">66</option>
<option value="72">72</option>
</select>點
</td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom" /><br />鐵2.2(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom" /><br />乙9092(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom" /><br />甲1286(甲)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom" /><br />林1.23.20(甲)<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom" /><br />戊寅作父丁方鼎(金)<br />商代晚期<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom" /><br />彔伯戈冬簋蓋(金)<br />西周中期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom" /><br />大𤔲馬簠(金)<br />春秋早期<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom" /><br />伯亞臣𦉢(金)<br />春秋<td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom" /><br />妾子𧊒壺(金)<br />戰國晚期<td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom" /><br />燕侯載器(金)<br />戰國<td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom" /><br />曾150(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom" /><br />包2.30(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom" /><br />包2.103(楚)<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom" /><br />說文古文<br /><td><td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom" /><br />說文籀文<br /><td><tr>
<tr><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom" /><br />說文‧馬部<br /><td><td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom" /><br />睡.雜26(秦)<br /><td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListA"> <td><td align="center" class="VariantListB"> <td></tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,古文。<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />,籀文馬與<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom" />同,有髦。”</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">字體:<a id="smallSize" class="size">小</a>.<a id="middleSize" class="size">中</a>.<a id="largeSize" class="size">大</a></dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
... However, my program only outputs the contents of the default landing page, and thus contains no mention of that form:
<td id="PageResult" align="left" valign="top" style="margin: 0px;">
<div style="width: 95%"></div>
<div id="Index">
<p class="MessageTitle" style="width: 64px">最新消息</p>
<ul style="width: 95%">
<li class="MessageList">小學堂字形演變資料庫由行政院國家科學委員會經費補助,中央研究院歷史語言研究所和資訊科學研究所共同開發,歡迎大家使用!(2013/09/25)</li>
<li class="MessageList">本資料庫共收錄字頭13098個,字形28321個。(2016/3/23)</li>
</ul>
<p class="MessageTitle" style="width: 64px">快速入門</p>
<ul style="width: 95%">
<li>適用瀏覽器:IE 8.0 以上版本、Firefox 4 以上版本、Google Chrome、Safari 5 以上版本</li>
<li>檢索條件的文字方塊內按<span class="MessagePoint">F1</span>鍵,可快速取得操作指引。</li>
<li>小學堂字形演變資料庫使用簡介。</li>
</ul>
</div> </td>
The code I've produced, based on what I can gather from other StackOverflow posts, is as follows. It successfully connects to the page, but either the post fails or the results aren't being read correctly:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Document doc = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian")
.data("ZiOrder", "") // The 'ZiOrder' form field can be left blank.
.data("EudcFontChar", kanjiToSearch)
// 'EudcFontChar' is the id of the search field I want to enter my query '馬' into.
.method(Connection.Method.POST)
.post();
Elements target = doc.select("#PageResult");
// The table row '#PageResult' should contain the 'HiddenFrom' form.
System.out.println(target.toString());
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
Thanks if anyone can help.
Looking at the Network tab of Chrome's Developer Tools (or Firefox) you can examine the exact request that is sent to the server. The response from the server is what you are looking for.
Here is a snapshot of the Dev Tools: (you can see the POST request URL and also the data being sent)
So all you need to do is to imitate sending this request to the server and get what you need in the response.
Here is a sample Java code for sending a POST request using OkHttp library:
package com.sample;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
public class PostExample {
private static final MediaType FORM = MediaType.parse("application/x-www-form-urlencoded; charset=UTF-8");
private OkHttpClient client = new OkHttpClient();
private String post(String url, String formData) throws IOException {
RequestBody body = RequestBody.create(FORM, formData);
Request request = new Request.Builder().url(url).post(body).build();
Response response = client.newCall(request).execute();
return response.body().string();
}
private String createFormData(String ziOrder, String eudcFontChar) throws UnsupportedEncodingException {
return "ZiOrder=" + URLEncoder.encode(ziOrder, "UTF-8") +
"&EudcFontChar=" + URLEncoder.encode(eudcFontChar, "UTF-8") +
"&ImageSize=36&X-Requested-With=XMLHttpRequest";
}
public static void main(String[] args) throws IOException {
PostExample example = new PostExample();
String formData = example.createFormData("", THE_CHINESE_CHAR);
String response = example.post("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult", formData);
System.out.println(response);
}
}
Running this code will return the HiddenFrom:
<form Id="HiddenFrom"...
Thanks to Navid (above) putting me back on the right track with his OkHttp code (showing that I should point to the PageResult/PageResult directory instead of the root), and finding an example usage of the 'org.jsoup.Connection.Response' class, I was able to also get the program working in JSoup. Here it is for reference:
import org.jsoup.Connection;
import org.jsoup.Jsoup;
import org.jsoup.Connection.Response;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.nodes.FormElement;
import org.jsoup.select.Elements;
import java.io.IOException;
public class ImgURLExtractor {
public void sendPostAndPrintResponse(String kanjiToSearch) throws IOException {
Response response = Jsoup.connect("http://xiaoxue.iis.sinica.edu.tw/yanbian/PageResult/PageResult")
.data("ZiOrder", "")
.data("EudcFontChar", kanjiToSearch)
.data("ImageSize", "36")
.data("X-Requested-With", "XMLHTTPRequest")
.method(Connection.Method.POST)
.timeout(10000) // This website can actually take a while to respond
.execute();
System.out.println(response.parse());
// Payload should include: /ImageText2/ShowImage.ashx?text=&font=中研院甲骨文重文三&size=36&style=regular&color=%23000000
}
public static void main(String[] args) throws IOException {
ImgURLExtractor example = new ImgURLExtractor();
example.sendPostAndPrintResponse("馬");
}
}
It returns:
<html>
<head></head>
<body>
<form id="HiddenFrom" action="/yanbian/PageResult/PageResult" method="post" onclick="Sys.Mvc.AsyncForm.handleClick(this, new Sys.UI.DomEvent(event));" onsubmit="Sys.Mvc.AsyncForm.handleSubmit(this, new Sys.UI.DomEvent(event), { insertionMode: Sys.Mvc.InsertionMode.replace, httpMethod: 'Post', updateTargetId: 'PageResult', onSuccess: Function.createDelegate(this, Feedback) });">
<input id="ZiOrder" name="ZiOrder" type="hidden" value="">
<input id="EudcFontChar" name="EudcFontChar" type="hidden" value="馬">
<input id="PageNo" name="PageNo" type="hidden" value="">
<input id="Reference" name="Reference" type="hidden" value="">
<input id="IsZiTou" name="IsZiTou" type="hidden" value="0">
<table border="0" cellspacing="0" cellpadding="0" width="95%" id="yanbian_result">
<tbody>
<tr>
<td colspan="10" align="left">
<table border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="ZiList"><span id="StartOrder">6104</span></td>
<td><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e6%a8%99%e6%a5%b7%e9%ab%94&size=29&style=regular&color=%23000000" alt="&0.99AC;" class="charValue" style="vertical-align:text-bottom"></td>
</tr>
</tbody>
</table> </td>
</tr>
<tr>
<td colspan="10" align="right" class="Information"> 共搜尋到17字,字形大小:<select name="ImageSize" id="ImageSize"> <option value="16">16</option> <option value="20">20</option> <option value="24">24</option> <option value="28">28</option> <option value="32">32</option> <option value="36" selected>36</option> <option value="40">40</option> <option value="44">44</option> <option value="48">48</option> <option value="54">54</option> <option value="60">60</option> <option value="66">66</option> <option value="72">72</option> </select>點 </td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b2&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E372;" class="charValue" style="vertical-align:text-bottom"><br>鐵2.2(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8d%b3&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E373;" class="charValue" style="vertical-align:text-bottom"><br>乙9092(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%82&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E382;" class="charValue" style="vertical-align:text-bottom"><br>甲1286(甲)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%8e%98&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%94%b2%e9%aa%a8%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&43.E398;" class="charValue" style="vertical-align:text-bottom"><br>林1.23.20(甲)<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%81&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E881;" class="charValue" style="vertical-align:text-bottom"><br>戊寅作父丁方鼎(金)<br>商代晚期</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%8a&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E88A;" class="charValue" style="vertical-align:text-bottom"><br>彔伯戈冬簋蓋(金)<br>西周中期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%b9&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8B9;" class="charValue" style="vertical-align:text-bottom"><br>大𤔲馬簠(金)<br>春秋早期</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%bd&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BD;" class="charValue" style="vertical-align:text-bottom"><br>伯亞臣𦉢(金)<br>春秋</td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a2%be&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8BE;" class="charValue" style="vertical-align:text-bottom"><br>妾子𧊒壺(金)<br>戰國晚期</td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a3%80&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e9%87%91%e6%96%87%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&33.E8C0;" class="charValue" style="vertical-align:text-bottom"><br>燕侯載器(金)<br>戰國</td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%86%bb&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E1BB;" class="charValue" style="vertical-align:text-bottom"><br>曾150(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%ab&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16B;" class="charValue" style="vertical-align:text-bottom"><br>包2.30(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%85%af&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e6%a5%9a%e7%b3%bb%e7%b0%a1%e5%b8%9b%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%89&size=36&style=regular&color=%23000000" alt="&53.E16F;" class="charValue" style="vertical-align:text-bottom"><br>包2.103(楚)<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9a&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81A;" class="charValue" style="vertical-align:text-bottom"><br>說文古文<br></td>
<td></td>
<td align="center" class="VariantListB"><img src="/ImageText2/ShowImage.ashx?text=%ee%a0%9b&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.E81B;" class="charValue" style="vertical-align:text-bottom"><br>說文籀文<br></td>
<td></td>
</tr>
<tr>
</tr>
<tr>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%e9%a6%ac&font=%e5%8c%97%e5%b8%ab%e5%a4%a7%e8%aa%aa%e6%96%87%e5%b0%8f%e7%af%86&size=36&style=regular&color=%23000000" alt="&27.99AC;" class="charValue" style="vertical-align:text-bottom"><br>說文‧馬部<br></td>
<td></td>
<td align="center" class="VariantListA"><img src="/ImageText2/ShowImage.ashx?text=%ee%aa%8d&font=%e4%b8%ad%e7%a0%94%e9%99%a2%e7%a7%a6%e7%b3%bb%e7%b0%a1%e7%89%98%e6%96%87%e5%ad%97%e9%87%8d%e6%96%87%e4%b8%80&size=36&style=regular&color=%23000000" alt="&71.EA8D;" class="charValue" style="vertical-align:text-bottom"><br>睡.雜26(秦)<br></td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListA"> </td>
<td></td>
<td align="center" class="VariantListB"> </td>
<td></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top" style="border-style: solid; border-width: 1px 0px 0px 0px; border-color: #808080"> <p class="RemindMessage">(點選字形可取得字形編輯資訊)</p></td>
</tr>
<tr>
<td colspan="10" align="center" valign="top"> </td>
</tr>
</tbody>
</table>
</form>
<p class="MessageTitle" style="width: 80px">漢語大字典</p>
<dl style="width: 95%" class="control">
<dd class="size">
《說文》:“馬,怒也;武也。象馬頭髦尾四足之形。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,古文。
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">,籀文馬與
<img src="/ImageText2/ShowImage.ashx?text=%f0%a2%92%a0&font=%e7%b4%b0%e6%98%8e%e9%ab%94&size=13&style=regular&color=%23000000" class="NtSize" style="vertical-align:text-bottom">同,有髦。”
</dd>
</dl>
<dl style="width: 95%" class="control">
<dd style="text-align: right">
字體:
<a id="smallSize" class="size">小</a>.
<a id="middleSize" class="size">中</a>.
<a id="largeSize" class="size">大</a>
</dd>
</dl>
<p class="MessageTitle" style="width: 64px">相關連結</p>
<ul style="width: 95%">
<li>小學堂異體字表、小篆、金文、甲骨文、楚系簡帛文字、秦系簡牘文字、傳抄古文字</li>
<li>小學堂上古音、中古音、官話、晉語、吳語、贛語、湘語、閩語、粵語、平話、客語、其他土話</li>
<li>小學堂韻書集成、廣韻、集韻、附釋文互註禮部韻略、增修互注禮部韻略、中原音韻、中州音韻、洪武正韻</li>
<li>國際電腦漢字與異體字知識庫(含漢語大字典釋義)</li>
<li>教育部異體字字典</li>
<li>開放康熙字典</li>
<li>遠流活用中文大辭典</li>
</ul>
<p class="MessageTitle" style="width: 64px">相關索引</p>
<ul style="width: 95%">
<li>漢語大字典(遠東圖書公司),冊.頁.字:7.4539.1</li>
<li>漢語大字典(建宏出版社),頁.字:1886.17</li>
<li>康熙字典(中華書局),頁.字:1433.01</li>
<li>中文大辭典(中華學術院),冊.編號:10.45550</li>
<li>說文解字(中華書局),卷.部首:10上.馬部</li>
<li>說文解字詁林正補合編(鼎文書局),冊.頁:8.383</li>
<li>說文新證(藝文印書館),冊頁:下98</li>
<li>說文新證(福建人民出版社),頁:770</li>
<li>金文編(中華書局),頁.行:675.3</li>
<li>金文詁林(香港中文大學),卷.頁:10.1</li>
<li>金文詁林補(中央研究院),冊.卷.頁:5.10.3073</li>
<li>殷周金文集成引得(中華書局),字號.頁:3538.1060</li>
<li>新金文編(作家出版社),冊頁:中1387</li>
<li>甲骨文編(中華書局),頁.行:397.3</li>
<li>甲骨文字詁林(吉林大學),冊.頁:2.1589</li>
<li>甲骨文字集釋(中央研究院),卷.頁:10.3031</li>
<li>殷墟甲骨刻辭類纂(吉林大學),冊頁:中624</li>
<li>新甲骨文編(福建人民出版社),頁.行:539.3</li>
<li>甲骨文字編(中華書局),字號.冊頁:1928.中573</li>
<li>楚系簡帛文字編(增訂本)(湖北教育出版社),頁.行:853.2</li>
<li>睡虎地秦簡文字編(文物出版社),頁.行:153.2</li>
<li>秦簡牘文字編(福建人民出版社),頁:289</li>
<li>戰國古文字典:戰國古文聲系(中華書局),冊頁:上605</li>
<li>傳抄古文字編(綫裝書局),冊頁.行:下963.1</li>
</ul>
</body>
</html>
Process finished with exit code 0
This is the code that is broken in outlook 2013 and 2010 works fine in 2003 and everything else. I am wondering what might be causing the issue. The page is just white and I cant find any of the email template in litmus. If anyone could help that would be great.
<!-- Wrapper 2 (Header) -->
<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" valign="top" bgcolor="#ffffff">
<!-- 1px Height Border -->
<table class="fullWidth" width="740" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" height="1" bgcolor="#dedede"></td>
</tr>
</table>
<!-- Mobile Wrapper -->
<table width="100%" height="300" class="fullWidth" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td width="100%" bgcolor="f6f6f6" background="beachBg.png" style="background-size: 100%; background-position-y: -100px;">
<a href="http://www.something.com">
<div>
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:740px;height:300px;">
<v:fill type="tile" src="beachBg.png" color="#000000" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<table table width="100%" border="0" cellpadding="0" cellspacing="0" align="center" class="scaleForMobile" height="300">
<tr align="right" class="socialNav">
<td width="100%">
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="rss" src="rss.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="vimeo" src="vimeo.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="50" valign="top">
<img alt="instagram" src="instagram.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="tumblr" src="tumblr.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="youtube" src="youtube.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="facebook" src="facebook.png"/>
</td>
</tr>
</tbody></table>
<table width="35" border="0" cellpadding="0" cellspacing="0" align="right" class="clearing">
<tbody><tr>
<td width="375" valign="top">
<img alt="linkedin" src="linkedin.png"/>
</td>
</tr>
</tbody></table>
</tr>
<tr class="beachLogo">
<td style="width:740;" ><img style="margin-left:80px;" src="beachLogo.png"></td>
<td width="400"></td>
</tr>
</table>
<div>
</div>
</div>
</td>
</tr>
</table><!-- End Header -->
</td>
</tr>
</table><!-- End Mobile Wrapper -->
<!-- Space -->
<table bgcolor="ffffff" width="740" border="0" cellpadding="0" cellspacing="0" align="center" class="mobileCenter">
<tr>
<td width="740" height="0">
</td>
</tr>
</table>
</td>
</tr>
</table><!-- End Wrapper 2 -->
A couple of syntax issues I'm seeing.
<a href="http://www.something.com"> is missing a closing tag.
You probably shouldn't be wrapping everything in just 1 <a> tag like that.
The </tr> before <tr class="beachLogo"> is missing a </td>
Fix those issues and see if you get better results in Outlook.
I need to create a graph representing a extendable hashing structure. So far I have had success with creating graphs in graphviz (using the dot tool)... I am however having trouble making top labels representing the number of bits for each bucket... What I want to do is something similar to this:
What I cannot get done are the small 2's and 1's representing bits.. Can anybody explain how I would go around doing this?
My graph so far looks like this:
digraph G {
nodesep = 0.5;
rankdir = LR;
node [shape=record];
node0[label = "<f0>0 | <f1>1"];
node1[label = "0010 | |", toplabel="1"];
subgraph cluster_0 {
style=filled;
color=white;
node [style=filled,color=white];
node0;
label = "i = 1";
}
node0:f0->node1;}
You may consider using HTML-Like labels if you really must do this with graphviz.
I recreated the mentioned example from wikipedia:
rankdir = LR;
node [shape=none];
splines=false;
n1[label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD CELLPADDING="2">2</TD>
<TD BORDER="0"></TD>
</TR>
<TR><TD COLSPAN="2" PORT="port00"> 00 </TD></TR>
<TR><TD COLSPAN="2" PORT="port01"> 01 </TD></TR>
<TR><TD COLSPAN="2" PORT="port10"> 10 </TD></TR>
<TR><TD COLSPAN="2" PORT="port11"> 11 </TD></TR>
</TABLE>>];
a[label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD CELLPADDING="0" BORDER="0" COLSPAN="2">
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="2" FIXEDSIZE="TRUE" WIDTH="1" ALIGN="LEFT"><TR><TD>1</TD></TR></TABLE>
</TD>
</TR>
<TR>
<TD PORT="porta"> A </TD>
<TD>k2</TD>
</TR>
</TABLE>>];
b[label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD CELLPADDING="2">2</TD>
<TD BORDER="0" COLSPAN="2"></TD>
</TR>
<TR>
<TD PORT="portb" COLSPAN="2"> B </TD>
<TD>k1</TD>
</TR>
</TABLE>>];
c[label=<
<TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4">
<TR>
<TD CELLPADDING="2">2</TD>
<TD BORDER="0" COLSPAN="2"></TD>
</TR>
<TR>
<TD PORT="portc" COLSPAN="2"> C </TD>
<TD>k3</TD>
</TR>
</TABLE>>];
n1:port00 -> a:porta;
n1:port01 -> a:porta;
n1:port10 -> b:portb;
n1:port11 -> c:portc;
As you can see, the code is not pretty... however, the result comes close:
http://graph.gafol.net/evEKgxwgj
Please note that there is a variation for the top label for demonstration purposes - node a uses a nested table.
I am using an engine, where for forums Vbulletin is used and for Other thiiings social engine 3 is used,
This was done by some professionals
In one of the page I am having popular tags(In Social Engine)
Its too long I want shortened it,
How can I do it?
here is my code
{* SHOW POPULAR TAGS START *}
<tr>
<td align="left" valign="top"><img src="images/spacer.gif" alt="" width="1" height="10" /></td>
</tr>
<tr>
<td align="left" valign="top"><table width="220" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="12" align="left" valign="top"><img src="images/blog_belowtl.jpg" alt="" width="12" height="10" /></td>
<td width="196" align="left" valign="top" background="images/blog_belowtbg.jpg"><img src="images/spacer.gif" width="1" height="10" /></td>
<td width="12" align="right" valign="top"><img src="images/blog_belowtr.jpg" alt="" width="12" height="10" /></td>
</tr>
<tr>
<td align="left" valign="top" background="images/blog_belowlbg.jpg" style="background-repeat: repeat-y;"> </td>
<td align="left" valign="top"><table width="196" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" >
{*<div class="articletags" >
{foreach from=$popular_tags item=poptag}
<a class="tag{$poptag.class}" href="articles.php?tag={$poptag.name}">{$poptag.name}</a>
{/foreach}
</div>*}
{foreach from=$popular_tags item=poptag}
{if $poptag.count == '1' }
{assign var=cssClass value='tahoma15_cloud'}
{elseif $poptag.count == '2' }
{assign var=cssClass value='tahoma12bold_cloud'}
{elseif $poptag.count == '3'}
{assign var=cssClass value='tahoma13bold_cloud'}
{elseif $poptag.count == '4'}
{assign var=cssClass value='tahoma14bold_cloud'}
{elseif $poptag.count == '5'}
{assign var=cssClass value='tahoma15_cloud'}
{else}
{assign var=cssClass value='tahoma18bold_cloud'}
{/if}
<span class="{$cssClass}">{$poptag.name}</span>
{/foreach}
</td>
</tr>
</table></td>
<td align="left" valign="top" background="images/blog_belowrbg.jpg" style="background-repeat: repeat-y;"> </td>
</tr>
<tr>
<td align="left" valign="top"><img src="images/blog_belowbl.jpg" alt="" width="12" height="10" /></td>
<td align="left" valign="top" background="images/blog_belowbbg.jpg"><img src="images/spacer.gif" alt="" width="1" height="10" /></td>
<td align="right" valign="top"><img src="images/blog_belowbr.jpg" alt="" width="12" height="10" /></td>
</tr>
</table></td>
</tr>
{* SHOW POPULAR TAGS END *}
You can check the lenght of this tag, on this link
http://www.managementparadise.com/articles.php
Currently it is displaying very long on the widget area
I am new on this, so any help will be appreciated
:)
OK I edited
{section name=poptag loop=$popular_tags max=20}
{if $poptag.count == '1' }
{assign var=cssClass value='tahoma15_cloud'}
{elseif $poptag.count == '2' }
{assign var=cssClass value='tahoma12bold_cloud'}
{elseif $poptag.count == '3'}
{assign var=cssClass value='tahoma13bold_cloud'}
{elseif $poptag.count == '4'}
{assign var=cssClass value='tahoma14bold_cloud'}
{elseif $poptag.count == '5'}
{assign var=cssClass value='tahoma15_cloud'}
{else}
{assign var=cssClass value='tahoma18bold_cloud'}
{/if}
<span class="{$cssClass}">{$poptag.name}</span>
{/section}
You should replace the {foreach} template tag with a {section} tag and set the max attribute on it to limit the times it is executed.
http://www.smarty.net/docsv2/en/language.function.section.tpl
I have the html structure below and I'm trying to select the row containing the text 'Related list item:'.
My Jquery is below:
$('#WebPartWPQ3 > table(eq:2) > tbody > tr > td > table > tbody > tr:last').remove();
but not working...
<DIV id="WebPartWPQ3" fixed_bound allowDelete="false" OnlyForMePart="true" HasPers="true" WebPartID="00000000-0000-0000-0000-000000000000" width="100%">
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" fixed_bound>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD fixed_bound>
<TABLE cellSpacing="0" width="100%" border="0" fixed_bound>
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Title:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>Employee annual leave approval
<BR fixed_bound/>
<BR fixed_bound/>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Approved Carry Forward days
<SPAN class="ms-formvalidation" fixed_bound> *
</SPAN>:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<INPUT class="ms-input" id="ctl00_PlaceHolderMain_TaskForm_ff1_1_ctl00_ctl00_TextField" title="Approved Carry Forward days" style="IME-MODE: inactive" size="11" name="ctl00$PlaceHolderMain$TaskForm$ff1_1$ctl00$ctl00$TextField" fixed_bound value=""/>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" width="25%" fixed_bound>
<B fixed_bound>Review Comments:
</B>
</TD>
<TD class="ms-formbody" width="75%" fixed_bound>
<SPAN fixed_bound>
<TEXTAREA class="ms-long" id="ctl00_PlaceHolderMain_TaskForm_ff2_1_ctl00_ctl00_TextField" title="Review Comments" name="ctl00$PlaceHolderMain$TaskForm$ff2_1$ctl00$ctl00$TextField" rows="5" fixed_bound>
</TEXTAREA>
<BR fixed_bound/>
</SPAN>
</TD>
</TR>
<TR fixed_bound>
<TD class="ms-formlabel" vAlign="top" noWrap width="25%" fixed_bound>
<B fixed_bound>Related list item:
</B>
</TD>
<TD class="ms-formbody" vAlign="top" width="75%" fixed_bound>
<A href="http://orange.extra.net/people/hr/Workflows/Expire%20the%20employee%20year%20in%20a%20year/" fixed_bound>
</A>
</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE cellSpacing="0" cellPadding="4" width="100%" border="0" fixed_bound xmlns:ddwrt2="urn:frontpage:internal" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:dsp="http://schemas.microsoft.com/sharepoint/dsp" xmlns:x="http://www.w3.org/2001/XMLSchema">
<TBODY fixed_bound>
<TR fixed_bound>
<TD class="ms-vb" noWrap fixed_bound>
<INPUT style="DISPLAY: none" onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__commit;__redirectsource;__redirectToList={};')" type="button" name="btnSave" fixed_bound jQuery1291028280448="3" value="Save Draft"/>
</TD>
<TD fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__update;__workflowTaskComplete={0*};__commit;__redirectsource;__redirectToList={};')" type="button" name="btnMarkSubmited" fixed_bound value="Complete Task"/>
</TD>
<TD class="ms-vb" noWrap width="99%" fixed_bound>
<INPUT onclick="javascript: __doPostBack('ctl00$PlaceHolderMain$TaskForm','__cancel;__redirectsource;__redirectToList={};')" type="button" name="btnCancel" fixed_bound value="Cancel"/>
</TD>
</TR>
</TBODY>
</TABLE>
</DIV>
$('.ms-formlabel').last().children().remove();
I prefer to give an id to the tr and remove the tr by id.
$('#trid').remove();
$('#WebPartWPQ3').find('Related list item').closest('tr').remove();