xml 传图片问题(急,在线等)
我数据库图片放的是blob字段,取出来后,要让进xml 通过webservice传到客户端,客户端在解析。服务端和客户端怎么写!
是这样取出来的
while(rs.next())
{
Blob pic = rs.getBlob("LICENSE_PIC");
}
以什么形式存在xml中,并且在解析出来!
字节转字符 字符转字节
字符和字节之间的转换
怎么做呢?Blob pic = rs.getBlob("LICENSE_PIC");
String str = "";
if(pic != null)
{
try {
InputStream in = pic.getBinaryStream();
System.out.println(in);
byte[] bt = new byte[1024];
int len=in.read(bt,0,1024);
str=new String(bt,0,len);
in.close();
} catch (Exception e) {
e.printStackTrace();
}
row.addAttribute("LICENSE_PIC",str);
}
但是xml报错
Exception in thread "main" org.dom4j.DocumentException: Error on line 2 of document : Character reference "�" is an invalid XML character. Nested exception: Character reference "�" is an invalid XML character.
at org.dom4j.io.SAXReader.read(SAXReader.java:482)
at org.dom4j.DocumentHelper.parseText(DocumentHelper.java:278)
at com.webservice.LicenseCompanyService.main(License
相关问答:
请问各位大师,我现在需要将XML的数据实时的存入到数据库中,我是用asp编的程序,大量们帮忙分析 一下!!!
下面是我的XML文件代码
XML code:
<?xml version="1.0" encoding="utf-8"? ......
我是想用PHP从数据库中读取数据,然后写入xml,然后FLASH显示XML中的数据
但是本地测试PHP能读出XML,传到空间里就读不出来了,请问怎么回事?
错误代码如下:
Fatal error: Cannot instantiate non-exis ......
如何用c++程序判断xml中各元素的合法性,针对格式上的合法性,返回0或者1
使用MSXML,加载XML后,使用validate方法验证
据说你要在linux下使用。
linux下可以使用Libxml2来操作xml,同样提供了validate的方法 ......
<?xml version="1.0" encoding="gb2312" ?>
<sites>
<site>
<name>.Net开发者园地</name>
<url>http://dotnet.aspx.cc</url>
<img&g ......
如何对xml内容数据进行比较
例如:
<?xml version='1.0' encoding='utf-8'?>
<TestLIST>
<PID>40</PID>
<TestName>深圳市</TestName>
......