Note that there are some explanatory texts on larger screens.

plurals
  1. POLookup table inside xslt
    primarykey
    data
    text
    <p>I have 2 xml files like that</p> <p>The lookup table, its from url <a href="http://www.and.com/lookup/administrative_division" rel="nofollow">http://www.and.com/lookup/administrative_division</a></p> <pre><code>&lt;lookup table="administrative_division"&gt; &lt;entry&gt; &lt;code&gt;01&lt;/code&gt; &lt;name&gt;ACT&lt;/name&gt; &lt;/entry&gt; &lt;entry&gt; &lt;code&gt;02&lt;/code&gt; &lt;name&gt;NSW&lt;/name&gt; &lt;/entry&gt; &lt;entry&gt; &lt;code&gt;03&lt;/code&gt; &lt;name&gt;NT&lt;/name&gt; &lt;/entry&gt; </code></pre> <p>The main xml that will link to the lookup table to find out the name of the code</p> <pre><code>&lt;features&gt; &lt;feature&gt; &lt;administrative_division&gt;01&lt;/administrative_division&gt; &lt;/feature&gt; &lt;feature&gt; &lt;administrative_division&gt;02&lt;/administrative_division&gt; &lt;/feature&gt; &lt;feature&gt; &lt;administrative_division&gt;03&lt;/administrative_division&gt; &lt;/feature&gt; &lt;/features&gt; </code></pre> <p>This is my effort:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:variable name="administrative" select="document('http://www.and.com/lookup/administrative_division')/lookup/entry" /&gt; &lt;xsl:template match="/"&gt; &lt;table border="1"&gt; &lt;tbody&gt; &lt;xsl:for-each select="features/feature"&gt; &lt;tr&gt; &lt;td&gt; &lt;xsl:value-of select="$administrative[code=current()]/name" /&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/xsl:for-each&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>The idea is parsing the feature xml via jsp then passing it into xsl, from xsl will load the lookup xml to compare with the code after that display the actual name instead of code. My prolbme is the page is blank when i run. So could anyone point me to the correct way, Im very beginner with xls. Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload