大型模式文件的xml架构验证(xml schema validation for large schema files)
我正在尝试使用xmllint来验证架构,我相信它使用下面的libxml2库。
问题是我有一个大约10MB的异常大的模式文件。 我这样做的时候:
xmllint --schema j9.xsd --noout jsample.xml
我收到以下错误:
j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))). j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
.....这种情况一直持续下去。 显然错误的行号不应该是65535,如果有错误的话。 我想知道是否有其他库没有此限制,或者如果有人知道如何解决此错误。 谢谢!
I'm trying to use xmllint to validate the schema, which I believe uses the libxml2 library underneath.
The problem is I have a unusually large schema file in about 10MB. When I do this:
xmllint --schema j9.xsd --noout jsample.xml
I got the following errors:
j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))). j9.xsd:65535: element annotation: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
..... This goes on and on. Apparently the line number of error should NOT be 65535, if there is an error. I'm wondering if there is another library that do not have this limitation, or if someone knows how to fix this bug. Thanks!
原文:https://stackoverflow.com/questions/2410806
最满意答案
你是什么意思,你有屏幕上的所有组件,你必须在一分钟内一次ping每个组件?
如果您认为您的应用是平安的,那么会检查网址的时间响应,然后您可以尝试使用此代码进行操作:
var ldr:URLLoader = new URLLoader(); ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus); var url:String = "URL-TO-SITE"; var limit:int = 10; var time_start:Number; var time_stop:Number; var times:int; ping(); function ping():void { trace("pinging", url); times = 0; doThePing(); } function doThePing():void { time_start = getTimer(); ldr.load(new URLRequest(url)); } function ldrStatus(evt:*):void { if(evt.status == 200) { time_stop = getTimer(); trace("got response in", time_stop - time_start, "ms"); } times++; if(times < limit) doThePing(); }
这没什么特别的,
URLLoader
尝试加载url,并监听响应。 如果status
是200
,那么获得了成功的“ping”。 或者乒乓球。另一方面,您可以随时运行服务器端的ping程序,并使用flash进行控制。
如果你的意思是一个应用程序,比如上传下载速度测试程序,它也是以类似的方式开始的,而不是使用Loader对象。
希望这可以帮助。
编辑:
防止缓存问题,您可以使用:
ldr.load(new URLRequest(url + "?rnd="+Math.random()));
现在,此页面可能不会返回网站的确切内容,但可能足以估计响应时间。 用闪光灯。
总的来说,这可以清除缓存并每次加载站点以提供更好的结果。
What do you mean by you have all the components on the screen and you have to ping every component once in a minute?
If by ping you mean an app, what checks the time-response of a url, then you can try to play with this code:
var ldr:URLLoader = new URLLoader(); ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus); var url:String = "URL-TO-SITE"; var limit:int = 10; var time_start:Number; var time_stop:Number; var times:int; ping(); function ping():void { trace("pinging", url); times = 0; doThePing(); } function doThePing():void { time_start = getTimer(); ldr.load(new URLRequest(url)); } function ldrStatus(evt:*):void { if(evt.status == 200) { time_stop = getTimer(); trace("got response in", time_stop - time_start, "ms"); } times++; if(times < limit) doThePing(); }
This is nothing special, the
URLLoader
tries to load the url, and listens to the response. If thestatus
is200
, then got a successful "ping". Or pong.On the other hand, you can always run a server-side ping program, and control that with flash.
If you mean an app, like an upload-download-speedtester, that also starts with something like this, but rather with the Loader object.
Hope this helps.
EDIT:
Preventing cache problems, you can use:
ldr.load(new URLRequest(url + "?rnd="+Math.random()));
Now, this page might not give back the exact content of a site, but might be good enough to estimate the response time. With flash.
So overall, this could clear the cache and load the site everytime to give a better result.
相关问答
更多-
Flash CS3 ActionScript 3.0类编程入门到精通教程哪里有?[2022-03-28]
你也可以看看下面的教程 教程1:金鹰FLASH.CS3活学活用【压缩后532MB】 教程2:Flash CS3 ActionScript 3.0组件高级编程(压缩后 532MB) 教程3:Flash CS3 ActionScript 3.0类编程入门到精通(压缩后780MB) 教程4:Flash CS3 AS3声音视频高级编程(官方价:380元)【压缩后668MB】 教程5:Flash ActionScrip 3.0实用教程(官方价:280元)【压缩后380MB】 教程6:Flex3.0快速入门(官方价:1 ... -
您的类CircleExample包含错误,您无法调用addChild方法,因为您的类需要扩展Sprite或MovieClip 要查看Fla的当前类路径,只需进入文件 - >发布设置,在脚本:Actionscript 3附近,单击Actionscript设置图标。 通常类路径包含“。” 对于当前文件目录。 类文件示例。 package { import flash.display.MovieClip; public class CircleExample extends MovieCli ...
-
myTextField.textColor = 0x634634 myTextField.textColor = 0x634634
-
你是什么意思,你有屏幕上的所有组件,你必须在一分钟内一次ping每个组件? 如果您认为您的应用是平安的,那么会检查网址的时间响应,然后您可以尝试使用此代码进行操作: var ldr:URLLoader = new URLLoader(); ldr.addEventListener(HTTPStatusEvent.HTTP_STATUS, ldrStatus); var url:String = "URL-TO-SITE"; var limit:int = 10; var time_start:Numbe ...
-
haXe的 基于现代高级严格类型编程语言的开源工具包,最先进的轻速交叉编译器,完整的跨平台标准库以及访问每个平台本机功能的方法。 学到更多... Haxe an open source toolkit based on a modern high level strictly typed programming language, a state-of-the-art light-speed cross-compiler, a complete cross-platform standard library ...
-
如何使用flash / actionscript 3调用javascript函数(How to call javascript function with flash/actionscript 3)[2023-04-22]
您可以使用ExternalInterface.call。 import flash.external.ExternalInterface; ExternalInterface.call('update', id); You can use ExternalInterface.call. import flash.external.ExternalInterface; ExternalInterface.call('update', id); -
你在想像素。 试着在矢量中思考。 您在屏幕上看到的像素线不完全在该像素上,位于该像素的左上角。 0到200宽度的线是200.点0在像素-1和像素0之间,并且点200在像素199和像素200之间。 -1到199宽度的线是200点-1在像素-2和像素-1之间,点199在像素198和像素199之间。 lineTo的行为很好。 You are thinking in Pixels. Try to think in Vectors. The line you see in screen over a pixel is ...
-
如果要获取显示对象容器的子对象的所有对象的列表,请查看getObjectsUnderPoint方法。 否则,您可以使用hitTestPoint并使用mouseX和mouseY坐标传递一个点。 Check out the getObjectsUnderPoint method if you want to get a list of all the objects that are children of a display object container. Otherwise, you could use ...
-
有基于Eclipse , Flash Develop或IntelliJ 构建的Flash Builder 。 可以使用Flex SDK中的MXMLC编译器构建应用程序或库,可以将其作为插件安装到Eclipse。 还有一些项目,如HaXe ,可以编译到Flash运行时。 There's Flash Builder built on Eclipse, FlashDevelop, or IntelliJ. Apps or libraries can be built with the MXMLC compiler ...
-
目前正在问题17814中进行 UDP广播在主机之间的多主机网络中不起作用。 UDP广播仅在两个容器在同一主机上运行时才起作用。 通过255.255.255.255上的ping操作播放icmp广播,我只收到来自本地主机的回复: # ping -b 255.255.255.255 WARNING: pinging broadcast address PING 255.255.255.255 (255.255.255.255) 56(84) bytes of data. 64 bytes from 172.18. ...