我正在尝试通过使用JAXB创建XBRL实例。我可以基于xbrl-instance模式使用xjc成功创建Java模型(http://www.xbrl.org/2003/xbrl-instance-2003-12-31.xsd)
当使用xjc创建Java类时,我遵循了本文的建议(除了maven部分,因为im未使用它):JAXB无法为XBRL生成Java类
<bindings xmlns="http://java.sun.com/xml/ns/jaxb" xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" version="2.1">
<bindings schemaLocation="xl-2003-12-31.xsd" version="1.0">
<bindings node="//xs:schema//xs:element[@name='title']">
<property name="xlTitle"/>
</bindings>
</bindings>
</bindings>
Run Code Online (Sandbox Code Playgroud)
所以现在我试图产生一个XBRL实例,但是在初始化上下文时得到了Java.lang.IllegalArgumentException。我找到了另一篇推荐通过引用包和ObjectFactory(使用类加载器)来调用newInstance()的帖子。但是仍然会发生错误,我无法真正从stacktrace中提取任何有用的信息。
public class JaxbXbrlInstanceCreationTest {
public static void main(String[] args) {
org.xbrl._2003.instance.ObjectFactory instObjFact = new ObjectFactory();
Xbrl xbrl = instObjFact.createXbrl();
xbrl.setId("Test");
org.xbrl._2003.linkbase.ObjectFactory linkbaseObjFact = new org.xbrl._2003.linkbase.ObjectFactory();
org.xbrl._2003.xlink.ObjectFactory xlinkObjFact = new org.xbrl._2003.xlink.ObjectFactory();
org.xbrl._2003.xlink.SimpleType schemaRefvalue = xlinkObjFact.createSimpleType();
schemaRefvalue.setHref("http://eiopa.europa.eu/eu/xbrl/s2md/fws/solvency/solvency2/2014-07-23/mod/ars.xsd");
schemaRefvalue.setType("simple");
List<SimpleType> schemaRefList = xbrl.getSchemaRef();
schemaRefList.add(linkbaseObjFact.createSchemaRef(schemaRefvalue).getValue());
List<Object> contextList = xbrl.getItemOrTupleOrContext();
Context context = instObjFact.createContext();
context.setId("Context");
ContextEntityType entityType = instObjFact.createContextEntityType();
Identifier identifier …
Run Code Online (Sandbox Code Playgroud) 当试图启动amy gae应用程序时,我收到这个奇怪的错误,并没有真正提供有关错误的信息.
raise yaml_errors.EventListenerYAMLError(e)
google.appengine.api.yaml_errors.EventListenerYAMLError: mapping values are not allowed here
in "C:\Program Files\Google\Cloud SDK\helloworld\app.yaml", line 8, column 11
Run Code Online (Sandbox Code Playgroud)
有谁知道什么是错的?
我的app.yaml看起来如下:
application: pivotal-stacker-729
version: 1
runtime: python
api_version: 1
handlers:
- url: /data/.*
script: data.py
- url: /.*
script: asklogin.py
Run Code Online (Sandbox Code Playgroud) 我正在通过匹配日期在python中查找数据存储区条目.我想要的是每天选择"今天"的条目.但出于某种原因,当我将我的代码上传到gae服务器时,它只能工作一天,第二天它仍会返回相同的值.
例如,当我上传我的代码并在07-01-2014执行它时,它返回07-01-2014的值,但是在08-01-2014的第二天它仍然返回07-01-2014.
如果我重新部署相同的代码并再次执行它,则会转到08-01-2014,但第二天将再次失败.
在我的开发环境中它工作得很好......
为什么?谢谢你的帮助!
class ClosingValueHandler(webapp2.RequestHandler):
def get(self):
sct()
Run Code Online (Sandbox Code Playgroud)
(......)
def sct(from_date=datetime.datetime.now().date()):
value = getValueByDate(from_date)
def getValueByDate(date):
query = "SELECT * FROM Value WHERE date = DATE('%s')" % str(date)
try:
q = db.GqlQuery(query)
value = q.get()
except Exception as e:
logging.error("Could not fetch Value value for date '%s' \n Error message: %s \n" % (str(date), str(e)))
return
return value
Run Code Online (Sandbox Code Playgroud)