[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Carriage return in XML
Matthew, '~' indicates the type of document, and is called BOM (Byte Order Mark) used with UTF-8 text documents. Possibly changing the encoding to UTF-8 isn't supported. A thing you can try is to change the output encoding before saving your xml, or adding it to the returned xml string before saving it to disk. HTH, <prs/> -----Original Message----- From: Matthew Day [mailto:mday@xxxxxxxxx] Sent: Wednesday, February 09, 2005 5:29 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: Carriage return in XML Hmm Actually the problem seems to be the encoding not the CR at all. In a hex editor I see a ~ at the start of their XML file but not mine. However when I change my xml template to <?xml version="1.0" encoding="UTF-16"?> from <?xml version="1.0" encoding="UTF-"8"?> the process now produces an empty file. Any idea why this may be? This is the template. <?xml version="1.0" encoding="UTF-16"?> <CSM xmlns:sql="urn:schemas-microsoft-com:xml-sql"> <sql:query> exec CSM.dbo.querystrCR </sql:query> </CSM> Cheers Matt -----Original Message----- From: Brad Williams [mailto:brad.williams@xxxxxxxxxxxx] Sent: Thursday, 10 February 2005 12:05 p.m. To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: RE: Carriage return in XML Matt, Add the below xslt after the end tag of the call that is generating the output and you will get the desired results. The first is a CR and second is NL <xsl:text>
</xsl:text> Regards, Brad -----Original Message----- From: Matthew Day [mailto:mday@xxxxxxxxx] Sent: Wednesday, February 09, 2005 2:34 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Carriage return in XML Hi I am trying to generate a file of XML which is imported into a third party App. So Far I have an wsh script var xml= new ActiveXObject("Msxml2.DomDocument.4.0"); xml.async = false; xml.preserveWhiteSpace = true; xml.load("http://localhost/routingtwo/template/test.xml"); xml.save("testoutput.xml"); XML template <?xml version="1.0" encoding="UTF-8"?> <csm xmlns:sql="urn:schemas-microsoft-com:xml-sql"> <sql:query> exec CSM.dbo.querystrCR </sql:query> </csm> So the XML file is created by accessing SQL server over http and saved locally. In a web browser the xml looks identical to an example xml file which can be imported into the app. However the xml file I generate will not import into the app, and I've narrowed the problem to a CR (carriage return) problem. I can manually add them in and it does import In WordPad my XML looks like <csm> <field1>value</field1><field2>value</field2> </csm> But is should be like <csm> <field1>value</field1> <field2>value</field2> </csm> Using google I see some other people with this problem and a solution of <xsl:text></xsl:text> However I'm not sure how to impliment this into my process. Any help appreciated. Cheers Matt
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|