title: Getting the failed-assert from the sch file
body: <p>I have an .sch file provided by PEPPOL website: <a href="http://docs.peppol.eu/poacc/billing/3.0/files/PEPPOL-EN16931-UBL.sch" rel="nofollow noreferrer">http://docs.peppol.eu/poacc/billing/3.0/files/PEPPOL-EN16931-UBL.sch</a> and we need to convert it to .xsl. We have done the conversion using a tool called oXygen. </p>
  
  <p>This is the snipped from .sch that generates the [BR-S-06]</p>
  
  <pre><code>&lt;rule context="cac:AllowanceCharge[cbc:ChargeIndicator=false()]/cac:TaxCategory[normalize-space(cbc:ID)='S'][cac:TaxScheme/normalize-space(upper-case(cbc:ID))='VAT']"&gt;
        &lt;assert id="BR-S-06" flag="fatal" test="(cbc:Percent) &gt; 0"&gt;[BR-S-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Standard rated" the Document level allowance VAT rate (BT-96) shall be greater than zero.&lt;/assert&gt;
      &lt;/rule&gt;
  </code></pre>
  
  <p>This is how I am expecting a rule to show as: 
  
    
      </p>
  
  <pre><code>&lt;!--ASSERT --&gt;
  &lt;xsl:choose&gt;
    &lt;xsl:when test="@listID = 'UNCL1001'"/&gt;
    &lt;xsl:otherwise&gt;
      &lt;svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="@listID = 'BR-S-06'"&gt;
        &lt;xsl:attribute name="id"&gt;BR-S-06&lt;/xsl:attribute&gt;
        &lt;xsl:attribute name="flag"&gt;fatal&lt;/xsl:attribute&gt;
        &lt;xsl:attribute name="location"&gt;
          &lt;xsl:apply-templates select="." mode="schematron-select-full-path"/&gt;
        &lt;/xsl:attribute&gt;
        &lt;svrl:text&gt;[BR-S-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Standard rated" the Document level allowance VAT rate (BT-96) shall be greater than zero.&lt;/svrl:text&gt;
      &lt;/svrl:failed-assert&gt;
    &lt;/xsl:otherwise&gt;
  &lt;/xsl:choose&gt;
  &lt;xsl:apply-templates select="@*|*" mode="M7"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is how it is actually shown:
  
     </p>
  
  <pre><code>    &lt;!--ASSERT --&gt;
    &lt;xsl:choose&gt;
       &lt;xsl:when test="(cbc:Percent) &amp;gt; 0"/&gt;
       &lt;xsl:otherwise&gt;
          &lt;xsl:message xmlns:iso="http://purl.oclc.org/dsdl/schematron"&gt;
             &lt;xsl:text&gt;[BR-S-06]-In a Document level allowance (BG-20) where the Document level allowance VAT category code (BT-95) is "Standard rated" the Document level allowance VAT rate (BT-96) shall be greater than zero.&lt;/xsl:text&gt;
          &lt;/xsl:message&gt;
       &lt;/xsl:otherwise&gt;
    &lt;/xsl:choose&gt;
    &lt;xsl:apply-templates select="@*|node()" mode="M10"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>I am expecting to see the failed-assert element because it also contains the id/flag/location rather then what i currently get which is a message.</p>
  
  <p>To run the validation using Saxon we have the following code:</p>
  
  <pre><code>public static Dictionary&lt;string, List&lt;ValidationResult&gt;&gt; ValidateXML(string xslTemplate, string xslName, XmlDocument document)
          {
              Dictionary&lt;string, List&lt;ValidationResult&gt;&gt; resultToReturn = new Dictionary&lt;string, List&lt;ValidationResult&gt;&gt;();
  
              XmlNamespaceManager xmlNamespacesForDocument = GetAllNamespaces(document);
              var transformAssertFailed = new List&lt;ValidationResult&gt;();
              var processor = new Processor();
              var compiler = processor.NewXsltCompiler();
              var executable = compiler.Compile(new MemoryStream(Encoding.UTF8.GetBytes(xslTemplate)));
              var destination = new DomDestination();
  
              MemoryStream xmlStream = new MemoryStream();
              document.Save(xmlStream);
              xmlStream.Position = 0;
              using (xmlStream)
              {
                  var transformer = executable.Load();
  
                  transformer.SetInputStream(xmlStream, new Uri("file:///C:/"));
                  transformer.Run(destination);
              }
              return resultToReturn;
          }
  </code></pre>
  
  <p>I am not sure what is wrong here, maybe the .sch file that I started with or maybe the .sch to .xsl converter.</p>