Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I have put some time and energy into this, I decided to write an XSLT to transform the schema to a mapping based on the enumeration documentation found in every xs:simpleType.</p> <p>This code:</p> <pre><code>&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0"&gt; &lt;xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/&gt; &lt;xsl:strip-space elements="*"/&gt; &lt;xsl:template match="xs:schema"&gt; &lt;mappings&gt; &lt;xsl:for-each select="//xs:element[contains(@type, 'Enum')] | //xs:element[contains(@type, 'JaNee')]"&gt; &lt;xsl:variable name="type" select="@type" /&gt; &lt;xsl:element name="{concat(@name, 'Mapping')}" &gt; &lt;xsl:apply-templates select="//xs:simpleType[@name=$type]"&gt; &lt;xsl:with-param name="elemname" select="@name" /&gt; &lt;/xsl:apply-templates&gt; &lt;/xsl:element&gt; &lt;/xsl:for-each&gt; &lt;/mappings&gt; &lt;/xsl:template&gt; &lt;xsl:template match="xs:enumeration"&gt; &lt;xsl:param name="elemname" select="'undefined'" /&gt; &lt;xsl:element name="{$elemname}"&gt; &lt;xsl:attribute name="value"&gt; &lt;xsl:value-of select="@value" /&gt; &lt;/xsl:attribute&gt; &lt;xsl:value-of select="xs:annotation/xs:documentation" /&gt; &lt;/xsl:element&gt; &lt;/xsl:template&gt; </code></pre> <p></p> <p>Outputs exactly what I was hoping for:</p> <pre><code> ...snip... &lt;typewoningMapping&gt; &lt;typewoning value="1"&gt;vrijstaande woning&lt;/typewoning&gt; &lt;typewoning value="2"&gt;twee-onder-een-kap/rijwoning hoek&lt;/typewoning&gt; &lt;typewoning value="3"&gt;rijwoning tussen&lt;/typewoning&gt; &lt;typewoning value="4"&gt;galerijflat (hoogbouw)&lt;/typewoning&gt; &lt;typewoning value="5"&gt;portiekflat (etage)&lt;/typewoning&gt; &lt;typewoning value="6"&gt;maisonnettewoning&lt;/typewoning&gt; &lt;typewoning value="7"&gt;flatwoning (overig)&lt;/typewoning&gt; &lt;typewoning value="8"&gt;woongebouw met niet-zelfstandige woonruimte&lt;/typewoning&gt; &lt;/typewoningMapping&gt; ...snip... </code></pre> <p>Now I only have to write something that makes an xsl with the xsl:key tags defined for the mappings I want to use.</p> <p>Thanks to all for helping me along the way.</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.
    1. VO
      singulars
      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