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.
Unfortunately, activation email could not send to your email. Please try again.

Hyperlink with the multiple query string parameters in AppendHTML throws error

Thread ID:

Created:

Updated:

Platform:

Replies:

102045 Dec 19,2011 04:24 AM Dec 21,2011 03:28 AM ASP.NET Web Forms (Classic) 5
loading
Tags: DocIO
Suman Pendyala
Asked On December 19, 2011 04:24 AM

We are trying create a word document using Syncfusion DocIO

We have a problem with the rendering of HTML when using the AppendHTML() method when the HTML text contains a hyperlink with more than one querystring parameters.

example :

When the HTML is of the form

'This is a sample HTML link Google Search
which is causing the error'

throws an error that the HTML is not in the correct format

but works fine if the HTML is of the form

'This is a sample HTML link Google Search
which is causing the error'

with only one query string parameter

We are using code as below

WTableRow tableRow = new WTableRow(document);
WTableCell tableCell = new WTableCell(document);
table.Rows.Add(tableRow);
tableRow.Cells.Add(tableCell);
IWParagraph para = tableCell.AddParagraph();
para.AppendHTML();


Any idea how the above issue can be solved is greatly appreciated

-Suman





Suman Pendyala
Replied On December 19, 2011 08:40 PM

Sorry there is correction to the post , the hyperlink in the first case was
http://www.google.com.sg/search?hl=en&source=hp&q=google&gbv=2
with multiple query string parameters

and the in second case it is
http://www.google.com.sg/search?hl=en
with only one query string parameter


Poornima R [Syncfusion]
Replied On December 20, 2011 12:26 AM

Hi Suman,


Thank you for your interest in Syncfusion Products.

Regarding the mentioned “Exception issue on appending the Html code (Hyperlink with multiple queries) using AppendHtml() method”:
Currently DocIO supports Html code or Html file that is XHTML 1.0 complaint. Here the provided html code is not XHTML1.0 complaint. Please find the html code from below and this code fails online W3c validation (http://validator.w3.org/check). According to XHTML1.0 standard any html code starting with & character is considered as an Html entity (such as &   etc). In the below html code, “&source” is considered as an invalid html entity causing the mentioned validation fail. Hence the mentioned exception issue (in AppendHtml() method) is the expected behavior of DocIO and not an issue with DocIO.

Html Code:
Google
Google

For more information about support XHTML elements and attributes, please refer the below link.

http://help.syncfusion.com/ug_94/Reporting/DocIO/ASP.NET/default.htm?turl=Documents%2F4427importingxhtml.htm


Please let us know if you have any questions.

Regards,
Poornima




Poornima R [Syncfusion]
Replied On December 20, 2011 12:28 AM

Hi Suman,


Please ignore my previous update.

Regarding the mentioned “Exception issue on appending the Html code (Hyperlink with multiple queries) using AppendHtml() method”:
Currently DocIO supports Html code or Html file that is XHTML 1.0 complaint. Here the provided html code is not XHTML1.0 complaint. Please find the html code from below and this code fails online W3c validation (http://validator.w3.org/check). According to XHTML1.0 standard any html code starting with & character is considered as an Html entity (such as &   etc). In the below html code, “&source” is considered as an invalid html entity causing the mentioned validation fail. Hence the mentioned exception issue (in AppendHtml() method) is the expected behavior of DocIO and not an issue with DocIO.

Html Code:
http://www.google.com.sg/search?hl=en&source=hp&q=google&gbv=2

For more information about support XHTML elements and attributes, please refer the below link.
http://help.syncfusion.com/ug_94/Reporting/DocIO/ASP.NET/default.htm?turl=Documents%2F4427importingxhtml.htm


Please let us know if you have any questions.

Regards,
Poornima




Suman Pendyala
Replied On December 20, 2011 11:27 AM

Hi Poornima,

So what is the solution you recommend for given issue?

Regards,
Suman


Poornima R [Syncfusion]
Replied On December 21, 2011 03:28 AM

Hi Suman,

Thank you for your update.

For your requirement of “Preserving multiple query hyperlinks in Html to Doc conversion without any exception”, please try replacing the invalid symbol & in the hyperlink with its equivalent html entity (&_amp ;( with underscore removed)) in the input html code. We have prepared the sample illustrating the same. Please find the sample from the below link. Try running the sample and let us know if this helps you.

Sample:
Sample53959409.zip


Please let us know if you have any questions.

Regards,
Poornima




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;