We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DocIO support only welformatted xhtml Error

Hello,
We  are using DOCIO to render Word reports. We  have some html data which is giving us the following error

System.NotSupportedException: 'DocIO support only welformatted xhtml
Details:
Name cannot begin with the ' ' character, hexadecimal value 0x20. Line 18, position 39.'

The data is

Maximum train speed < 20 mph and no crashes within last 5 years;
 Active warning devices and no crashes within last 5 years;
 Average Annual Daily Traffic (AADT) < 100 and no crashes within last 5 years;
 No main tracks and no crashes within last 5 years;
 Total daily trains < 2 and no crashes within last 5 years; and

Would like to know whether DOCIO supports   “<” & “>” characters   . The AppendHTML method breaks for "<"  sign.  We tried Regex expression to replace "<" characters with &lt;.. But that ends up replacing the html tags e.g. <div> </div>. It ends up with &lt;div>&lt/div.

Thanks,





5 Replies

MJ Mohanaselvam Jothi Syncfusion Team May 7, 2019 09:21 AM UTC

Hi Robin,

Thank you for contacting Syncfusion support.

While opening the given data as HTML string, the mentioned symbols are considered as syntax for the HTML tags. Essential DocIO supports HTML with XHTML 1.0 compliant for HTML conversions, so the reported problem occurs at your end.

To preserve the mentioned symbols (“<” and “>”) in HTML conversion using DocIO, we suggest you to change the symbols as escape characters “&lt;” and “&gt;”. So, it doesn’t interact with the syntax of markup and it will be preserved properly. We have modified the html as per this and it can be download from the below link.
http://www.syncfusion.com/downloads/support/forum/144443/ze/Template-347653710


Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 



RK Robin Knight replied to Mohanaselvam Jothi May 8, 2019 10:53 PM UTC

Hi Robin,

Thank you for contacting Syncfusion support.

While opening the given data as HTML string, the mentioned symbols are considered as syntax for the HTML tags. Essential DocIO supports HTML with XHTML 1.0 compliant for HTML conversions, so the reported problem occurs at your end.

To preserve the mentioned symbols (“<” and “>”) in HTML conversion using DocIO, we suggest you to change the symbols as escape characters “&lt;” and “&gt;”. So, it doesn’t interact with the syntax of markup and it will be preserved properly. We have modified the html as per this and it can be download from the below link.
http://www.syncfusion.com/downloads/support/forum/144443/ze/Template-347653710


Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 


Hello,
I  was able to generate the report but it keeps the character as &lt; .. I want to show it as "<" when I  use the ApplyHTML method. I am using Encoding/Decoding in C#

Any recommendations?

Thanks,

  • Maximum train speed &lt; 20 mph and no crashes within last 5 years;

  • Active warning devices and no crashes within last 5 years;

  • Average Annual Daily Traffic (AADT) &lt; 100 and no crashes within last 5 years;

  • No main tracks and no crashes within last 5 years;

  • Total daily trains &lt; 2 and no crashes within last 5 years; and

  • Section 130 Program project within last 5 years and no crashes within last 5 years.



MJ Mohanaselvam Jothi Syncfusion Team May 9, 2019 09:11 AM UTC

Hi Robin,

Thank you for your update.

We have tried to reproduce the reported problem when converting HTML into Word document using the given details, but it works properly at our end. For your reference, we have attached the sample application which we tried at our end and it can be downloaded from the below link:
http://www.syncfusion.com/downloads/support/forum/144443/ze/SampleApplication422240118

Note: Please find the input HTML in “Data” folder of above sample application.

We suspect that the problem might be due to the code snippets which used at your end. So, could you please provide us the below details:
  1. Modified sample of above along with the complete code snippets.
  2. Input HTML document.
  3. Output Word document generated at your end.
  4. Details about the Syncfusion product version used in your application.
Note: If you have any confidential data in your HTML, please replace with some dummy data and provide us the same. We just need your document to recreate the problem you face.

Based on the above details, we will analyze further at our end and provide you the appropriate solution at the earliest.


Please let us know if you have any other questions.

Regards,
Mohanaselvam J 



RK Robin Knight May 12, 2019 08:17 PM UTC

Hello,
I download the sample application and used it generate the report. It did not render the out put correctly.

I have included the sample input html document and the output sample word report.

You can use the same sample application use the input html and let me know the out put word report

Thanks,

Attachment: Data_dcb4d2cd.zip


MJ Mohanaselvam Jothi Syncfusion Team May 13, 2019 08:51 AM UTC

Hi Robin,

Thank you for sharing us the details.

On further checking the given input HTML document, we have found that mentioned symbol (“<”) is replaced as “&amp;lt;” instead of “&lt;”.

As per HTML behavior, “&amp;” is used to preserve ampersand symbol. When opening the provided HTML in browser “&amp;” is preserved as ampersand symbol (&) and the following text are considered as normal text. Essential DocIO parsed the given HTML as same, so the reported problem occurs at your end in HTML to Word conversions.

To resolve this problem, we suggest you to set valid escape characters for symbol (“<”). We have modified the HTML document to preserve the symbols properly in HTML to Word conversion. Please find the modified HTML and the output Word document from the below link:
http://www.syncfusion.com/downloads/support/forum/144443/ze/Modified160987935

Please let us know if you have any other questions.

Regards,
Mohanaselvam J
 


Loader.
Live Chat Icon For mobile
Up arrow icon