Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

XMLѹËõ´«Êä - PowerBuilder / Web Ó¦ÓÃ

¹¦ÄÜ˵Ã÷:Java servlet °ÑXMLÊý¾ÝѹËõºó·¢Ë͵½PBÓû§¶Ë,PBÊÕµ½Êý¾Ýºó½âѹ³öÀ´.

´«ÊäÒª¾­¹ýBase64±àÂë.

ÎÊÌâÊÇ:ÄÜÊÕµ½Êý¾Ýµ«Êǽâѹ²»³öÀ´.ÏëÇë½Ì´ó¼Ò»òÕßÓÐʲôºÃµÄ°ì·¨?

PB¿ÉÒÔÓÃ"zlibwapi.DLL" ½âѹ

////////////////////////////// 

Java CODE:

//ѹËõÊý¾Ý
if(strXML !=null){
byte[] byte_XMLData=null;

StringZip strZip =new StringZip();
byte_XMLData =StringZip.ZipString(strXML.toString());

String encode = Base64.getEncodedText(byte_XMLData);  

//Êä³öÊý¾Ý
PrintWriter outputWriter =null;
try {
outputWriter = res.getWriter();
} catch (IOException e) {
e.printStackTrace();
}
outputWriter.println(encode.toString());
outputWriter.close();
}

package org.peng.util;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
import java.util.zip.ZipOutputStream;

public class StringZip{
/**
* ѹËõ×Ö·û´®Îª byte[]
* ±£´æΪ×Ö·û´®
*
* @param str ѹËõÇ°µÄÎı¾
* @return
*/
public static final byte[] ZipString(String str) {
if(str == null)
return null;

byte[] compressed;
ByteArrayOutputStream out = null;
ZipOutputStream zout = null;
try {


Ïà¹ØÎÊ´ð£º

Êý¾ÝÒÔxml¸ñʽ·µ»Ø - MS-SQL Server / Ó¦ÓÃʵÀý

´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽ
XML code:
<folder state="unchecked" label="È«²¿">
¡¡¡¡ <folder state="unchecked&qu ......

Êý¾Ý±íÉú³ÉÌض¨¸ñʽµÄxml - .NET¼¼Êõ / ASP.NET

´ÓÊý¾Ý¿âÖвéѯһÕűíµÄÊý¾Ý
select ²¿ÃÅ,ÐÕÃû from tb
ÈçºÎ²ÅÄÜÉú³ÉÏÂÃæµÄxml¸ñʽÎļþ
<folder state="unchecked" label="È«²¿">
¡¡¡¡<folder state="unchecked" isBra ......

wince³ÌÐòÔõô°ÑXMLÎļþ´«Èëwebservice

ÎÒÔÚ±àдһ¸öwince5.0µÄ³ÌÐò£¬ÏëʵÏÖ°ÑPDAÉϵÄÒ»¸öLIST <STRING>ÀàÐ͵ÄÊý¾ÝÐòÁл¯ÎªXML£¬È»ºóÔÚPCÉϵÄÒ»¸öwebserviceÄõ½Õâ¸öXML£¬×ª»¯ÎªDataset£¬¸üÐÂPCÉϵÄÊý¾Ý¿â£¬ÎÒÏëÎÊÔõô°ÑXML´«¸øwebserviceµÄÄØ£¿
......

Ϊʲôxml²»ÄÜÏÔʾ°¢À­²®ÎÄ - C/C++ / C++ ÓïÑÔ

ΪʲôÎҵijÌÐòµ÷ÓÃXMLÅäÖÃÎļþÖеİ¢À­²®ÎÄÏÔʾ²»³öÀ´£¿ÆäËûµÄÓïÖÖ¶¼¿ÉÒÔ£¬ÈçÖÐÎÄ£¬Ó¢ÎÄ£¬µÂÎĶ¼¿É¡£
ÎÒ½«XMLµÄ±àÂë¸ÄΪutf-8ºÍunicodeµÄµ½µÃ½á¹û¶¼Ò»Ñù.
°¢À­²®ÎĵÄ×Ö¿âÄãÓÐô£¿

ÓÐ,ÎÒµÄEXEÊÇ·ÅÔÚpc»úÉÏÖ´Ðе ......

C# xmlÎļþutf-8תgb2312ÎÊÌâ - Web ¿ª·¢ / XML/SOAP

ÎÒÒªÔÚÍøÒ³ÉÏÉÏ´«Ò»¸öXMLÎļþ£¬ÎÒÔÚC#ÖÐдÁËÒ»¸öÑéÖ¤XMLÎļþ¸ñʽµÄ·½·¨£º 
private bool ValidateXml(string xmlFilePath) 
  { 
  string xsdPath = Request.PhysicalApp ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ