Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have this XML below as my output. Used XSLT 2.0 to tranform xml.

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
XML
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
Posted
Updated 17-Aug-12 6:36am
v2

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.
 
Share this answer
 
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900