Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Why does the XTSE1015 Error occur when sorting XML document

I’m looking for some help with an XSL error. It’s called XTSE1015 which stands for "An xsl:sort element with a select attribute must be empty". It happens when i try to output file to xml or text. Software such as Oxygen XML Editor or event Notepad++ show this error. I can’t find any solution to this, well except not using sort but that is not a proper solution. Somebody stumbled upon this problem maybe and has some advice or something?

<xsl:variable name="strName">
   <xsl:for-each select="Samochody/Model/Nazwa">
      <xsl:sort select="string-length(.)" data-type="number">
          <xsl:value-of select="."/>
       </xsl:sort>
   </xsl:for-each>
</xsl:variable>

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

The <xsl:sort... /> element is not allowed to have any children. Hence the error. See, for example, here at Tutorialspoint.
So, to make it work, change your code to

<xsl:variable name="strName">
   <xsl:for-each select="Samochody/Model/Nazwa">
      <xsl:sort select="string-length(.)" data-type="number" />
      <xsl:value-of select="."/>
   </xsl:for-each>
</xsl:variable>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading