有一个老外的库,他们的例子是本地Application project,可以成功运行.但我们放在web上,就出错了.
大致原因问了一下他们有这样一个函数,输入一个本地文件,第二个参数看半天也没看懂,他们给的例子是传成null,我也没管.
输出一个他们格式的文件.
public IFILE XXX_Creat(java.net.URI schemaLocation,
org.xml.sax.ext.EntityResolver2 resolver)
throws DFDLException,
java.io.IOException
他们说是本地相对路径,跟网络那种相对路径不一样.得转一下.自己要实现一个resolver.
本人java盲,多包涵(用过类似的C#). 大家懂吗?
大致原因问了一下他们有这样一个函数,输入一个本地文件,第二个参数看半天也没看懂,他们给的例子是传成null,我也没管.
输出一个他们格式的文件.
public IFILE XXX_Creat(java.net.URI schemaLocation,
org.xml.sax.ext.EntityResolver2 resolver)
throws DFDLException,
java.io.IOException
他们说是本地相对路径,跟网络那种相对路径不一样.得转一下.自己要实现一个resolver.
本人java盲,多包涵(用过类似的C#). 大家懂吗?
猜测里面的逻辑也是对Schema的二次处理。
是个接口
你们用的应该是jdk的,是个接口,你要实现下方法就能用了。
package org.xml.sax.ext;import java.io.IOException;
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;public abstract interface EntityResolver2 extends EntityResolver
{
public abstract InputSource getExternalSubset(String paramString1, String paramString2)
throws SAXException, IOException; public abstract InputSource resolveEntity(String paramString1, String paramString2, String paramString3, String paramString4)
throws SAXException, IOException;
}
schemaLocation="filename.xml"
http://download.java.net/jdk7/archive/b123/docs/api/java/net/URI.html