1

我正在寻找通过 WDDX 将数据转换为 XML 输出

但是,输出在俄语字符上崩溃-我被告知这将发生-但是,如果有人知道,我愿意接受解决此问题的方法吗?

代码如下:

<cfwddx action="cfml2wddx" input="#variables.csPages#" output="variables.xmlOutput" />
<cfset variables.xmlOutput = ReplaceNoCase(variables.xmlOutput, "&lt;", "<", "all")>
<cfset variables.xmlOutput = ReplaceNoCase(variables.xmlOutput, "&gt;", ">", "all")>
<cfset variables.xmlOutput = '<?xml version="1.0" encoding="UTF-8"?>' & variables.xmlOutput>
<cffile action="write" file="#variables.filePath#" output="#variables.xmlOutput#" charset="utf-8" />

错误如下:应为字符串文字,但未找到开头的引号字符。错误处理资源 'file:///D:/csroot/dev/c...

<var name='includePageTitle'><string>1</string></var><var name='IncludeRightColumn'><string...PAN>> </DIV> <char code="0a" /> 
4

1 回答 1

0

Use the element in question as a standalone file, such as russian.xml:

<?xml version="1.0" encoding="UTF-16"?>
 <root>
  <var name='includePageTitle'><string>1</string></var><var name='IncludeRightColumn'><string...PAN>> </DIV> <char code="0a" />
 </root>

Use xmllint to find the errors:

xmllint russian.xml

russian.xml:3: parser error : Opening and ending tag mismatch: string...PAN line 3 and DIV e'>1> ^ russian.xml:4: parser error : Opening and ending tag mismatch: var line 3 and root ^ russian.xml:5: parser error : Premature end of data in tag root line 2

References

于 2014-06-03T19:07:36.350 回答