0

I am trying to use an update statement for a column in my SQL Server table but I get the following error message:

Msg 9410, Level 16, State 1, Line 13
XML parsing: line 76, character 78, whitespace expected

The XML code I am to update the xml column is reduced due to the large number of rows. It just as an example. I want to convert Table1/DateForm in dd/MM/yyyy format.

Below is the query that I tried to execute:

UPDATE XSLtable
SET DocuXSL = '
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
xmlns:ms="urn:schemas-microsoft-com:xslt"
xmlns:dt="urn:schemas-microsoft-com:datatypes" version="1.0">
  <xsl:output method="html" indent="no" encoding="iso-8859-1" omit-xml-declaration="yes" />
  <xsl:preserve-space elements="*" />
  <xsl:template match="/">
    <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml" xsl:version="1.0">
      <body style="font-family: Times New Roman;">
        <p style="border-width:3px; border-style:solid; border-color:black; padding: 1em;">
          Date:   <xsl:value-of select="ms: format-date(Table1/DateForm, "MM/dd/yyyy")"/><br /><br /><br />
          <xsl:value-of select="Table1/Name" /><br /><br /><br />
        </p>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>'
WHERE ID = 1

Line no 76 is:

<xsl:value-of select="ms: format-date(Table1/DateForm, "MM/dd/yyyy")"/>

Thank you

Dale K
  • 25,246
  • 15
  • 42
  • 71
Rodrigo Vu
  • 21
  • 6

0 Answers0