フィルターのクリア

Will not publish to pdf

20 ビュー (過去 30 日間)
Kevin Castillo Balcaceres
Kevin Castillo Balcaceres 2021 年 8 月 29 日
回答済み: Shanmukha Voggu 2021 年 9 月 1 日
Error reported by XML parser: An invalid XML character (Unicode: 0x1a) was found in the element content of the document.
Error using publish
.m file must contain valid XML 1.0 Standard characters.
Error in mdbpublish (line 54)
outputPath = publish(file, options);
Error using open (line 52)
File or variable name must be a character vector or string scalar.
My file name does not have any spaces and neither do any of the names of the path. I am unsure what is causing this.

回答 (1 件)

Shanmukha Voggu
Shanmukha Voggu 2021 年 9 月 1 日
Hi Kevin,
It is likely there is a special character somewhere in your file. If you are able to run the file without any issues, it is likely somewhere in the comments.
Attached is an example of an M file with a special character in its comments.
If you cannot find a special character in your file, another thing to check would be any places where "char" is called on a number. The way "char" function works is to create unicode commands of the numbers, so this is an easy way to generate invalid XML characters. For example:
char(20)
ans = ''
For converting numbers to characters it is recommended to use "num2str" instead of "char":
num2str(20)
ans = '20'

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

タグ

製品


リリース

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by