|
Rank: Newbie
Joined: 10/21/2016 Posts: 3
|
Hello!
I try to create a macros, and stack with using the Documents.NewFileFromText() methods. I have a plain html source, similar to this:
Code:<!DOCTYPE html> <html> <head> <META http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Some Title</title> </head> <body> ...... </body> </html> I want to create a new file with this content by using the:
Code:Application.Documents.NewFileFromText(htmlcontent, "html"); but I get Code:"0x800406a9 - Altova.Application: Documents: Documents: error setting text as xml content" Even when I try to use:
Code:Application.Documents.NewFileFromText("text", "txt"); I get the same error. What am I doing wrong?
|
|
Rank: Member
Joined: 12/11/2013 Posts: 18 Location: everywhere
|
This would appear to be a bug and has been logged in the internal bug database
The bug entry number is TTP# 52761
Application.Documents.NewFileFromText method returns an error if the first parameter is not well formed xml (even for non xml file types)
As soon as this issue has been addressed it will appear on our release notes page:
|
|
Rank: Newbie
Joined: 10/21/2016 Posts: 3
|
I am looking forward to fix!
Thank you!
|
|
Rank: Member
Joined: 12/11/2013 Posts: 18 Location: everywhere
|
Note that the following will work (META tag is closed with forward slash at end of tag) and quotes are prepended with a backslash:
var str = "<!DOCTYPE html><html><head><META http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"/><title>Some Title</title></head><body></body></html>"
Application.Documents.NewFileFromText(str , "html");
|
|
guest |