打印XML文件时出错 [英] Error while printing XML file

查看:180
本文介绍了打印XML文件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在下面有这个XML作为输出.使用XSLT 2.0转换xml.

I have this XML below as my output. Used XSLT 2.0 to tranform xml.

<?xml version="1.0" encoding="UTF-8"?>
- <Envelope>
- <Header>
  <TimeStamp>2012-08-17T12:04:21-05:00</TimeStamp>
  <ServiceName>ShipmentUpdate</ServiceName>
  </Header>
  <OtherReference>GREENFIELD</OtherReference>
  <Reference>03330</Reference>
  <OrderReference>6141</OrderReference>
  <AdditionalReference />
  <BillofLadingNumber />




但是当我尝试打开文件时出现此错误


在文档的顶层无效.处理错误




But i''m getting this error when i try to open the file


Invalid at the top level of the document. Error processing

The XML page cannot be displayed
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.


--------------------------------------------------------------------------------

Invalid at the top level of the document. <?xml version="1.0" encoding="UTF-8"?>




请帮助




Please Help

推荐答案

这不是XML文件.这是您在打开文件而不打开节点时在IE中看到的文本.因此,这意味着如果您保存此确切的文本,则不是XML,但是,如果这是在IE中打开的XML文件的复制/粘贴,则肯定是有效的XML.因此,如果是这样,我想您需要发布失败的代码.
That''s not an XML file. It''s the text you see in IE when you open the file and don''t open the nodes. As such, it means that if you saved this exact text, it''s not XML, but, if this is a copy/paste of the XML file opened in IE, then it IS valid XML, for sure. So, if that is true, you need to post the code that is failing, I guess.


如果显示的XML完整,则可能是< Envelope>元素未关闭.
否则,如果出现破折号(-") ,则如克里斯蒂安所说:无效的XML.
If the XML shown is complete, it may be that the <Envelope> element is not closed.
Otherwise, if the dash characters (''-'') are present, it is as Christian stated: not valid XML.


这篇关于打印XML文件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆