xml-schema-collection 相关问题


错误:cvc-elt.1.a:找不到元素“beans”的声明

添加此代码时,出现此错误,我尝试将 beans:beans 添加到标记中,但随后出现相同的错误,请帮我解决此问题 添加此代码时,出现此错误,我尝试将 beans:beans 添加到标签中,但随后出现相同的错误,请帮我解决这个问题 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="testBean" class="alishev.spring.demo.TestBean"> <constructor-arg value="Neil"/> </bean> </beans> 您拥有 xmlns:beans="http://www.springframework.org/schema/beans",这意味着您需要为该命名空间中的所有标签添加前缀 beans:。 从 :beans 中删除 xmlns:beans="http://www.springframework.org/schema/beans",这样您的 XML 应如下所示 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"> <bean id="testBean" class="alishev.spring.demo.TestBean"> <constructor-arg value="Neil"/> </bean> </beans>


Struts 2 与 Apache Shiro 集成时如何显示结果页面

使用: struts2 2.5.10, 春天 4.x, struts2-spring-插件2.5.10, 希罗1.4.0, Shiro-Spring 1.4.0。 网络.xml: 使用: struts2 2.5.10, 春季 4.x, struts2-spring-插件2.5.10, 四郎1.4.0, shiro-spring 1.4.0. web.xml: <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" version="3.1"> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:beans.xml</param-value> </context-param> <filter> <filter-name>shiroFilter</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> <init-param> <param-name>targetFilterLifecycle</param-name> <param-value>true</param-value> </init-param> </filter> <filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter</filter-class> </filter> <!-- shiro filter mapping has to be first --> <filter-mapping> <filter-name>shiroFilter</filter-name> <url-pattern>/*</url-pattern> <dispatcher>REQUEST</dispatcher> <dispatcher>FORWARD</dispatcher> <dispatcher>INCLUDE</dispatcher> <dispatcher>ERROR</dispatcher> </filter-mapping> <filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> beanx.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd "> <bean name="loginAction" class="example.shiro.action.LoginAction" > </bean> <bean id="shiroFilter" class="org.apache.shiro.spring.web.ShiroFilterFactoryBean"> <property name="securityManager" ref="securityManager" /> <property name="loginUrl" value="/login.jsp" /> <property name="filterChainDefinitions"> <value> /login.jsp = authc /logout = logout /* = authc </value> </property> </bean> <bean id="iniRealm" class="org.apache.shiro.realm.text.IniRealm"> <property name="resourcePath" value="classpath:shiro.ini" /> </bean> <bean id="securityManager" class="org.apache.shiro.web.mgt.DefaultWebSecurityManager"> <property name="realm" ref="iniRealm" /> </bean> <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor"/> </beans> struts.xml: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.devMode" value="true" /> <package name="default" extends="struts-default"> <action name="list" class="loginAction" method="list"> <result name="success">/success.jsp</result> <result name="error">error.jsp</result> </action> </package> </struts> index.jsp: <body> <s:action name="list" /> </body> login.jsp 看起来像: <form name="loginform" action="" method="post"> <table align="left" border="0" cellspacing="0" cellpadding="3"> <tr> <td>Username:</td> <td><input type="text" name="username" maxlength="30"></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="password" maxlength="30"></td> </tr> <tr> <td colspan="2" align="left"><input type="checkbox" name="rememberMe"><font size="2">Remember Me</font></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="submit" value="Login"></td> </tr> </table> </form> LoginAction.list(): public String list() { Subject currentUser = SecurityUtils.getSubject(); if(currentUser.isAuthenticated()) {System.out.println("user : "+currentUser.getPrincipal()); System.out.println("You are authenticated!"); } else { System.out.println("Hey hacker, hands up!"); } return "success"; } shiro.ini: [users] root=123,admin guest=456,guest frank=789,roleA,roleB # role name=permission1,permission2,..,permissionN [roles] admin=* roleA=lightsaber:* roleB=winnebago:drive:eagle5 index.jsp、login.jsp、success.jsp放在webapp下 我想要的是:输入LoginAction.list()需要进行身份验证,如果登录成功,则运行LoginAction.list()并返回"success"然后显示定义为Struts操作结果的success.jsp。 现在登录成功后可以执行LoginAction.list(),但是success.jsp不显示,浏览器是空白页面。 为什么? 我找到了原因:我在index.jsp中使用了<s:action name="list" />,但是struts文档说如果我们想用<s:action>看到结果页面,那么我们必须将其属性executeResult设置为true,即就像<s:action name="list" executeResult="true"/>。 在我看来,这有点奇怪,这个属性默认应该是 true。 有一个示例,您应该如何使用 Shiro applicationContext.xml 进行配置: <property name="filterChainDefinitions"> <value> # some example chain definitions: /admin/** = authc, roles[admin] /** = authc # more URL-to-FilterChain definitions here </value> </property> 以 /admin/ 开头的 URL 通过角色 admin 进行保护,任何其他 URL 均不受保护。如果 Struts 操作和结果 JSP 不在受保护区域中,则会显示它们。


Flutter Firebase Firestore 固定消息查询

我喜欢这个查询 查询> pageChat = _fireStore .collection('聊天') .where('chatUsersId', arrayContains: firebaseUser!.uid) .where('聊天...


耶拿有没有办法看到OntClass来自导入的本体?

我有一个导入 bfo 的本体。在我的测试用例中,我只有一个类,它是实体的子类: 我有一个导入bfo的本体。在我的测试用例中,我只有一个类,它是 entity: 的子类 <rdf:RDF xmlns="http://my.ontology/ontologyTest#" xml:base="http://my.ontology/ontologyTest" xmlns:da="http://my.ontology/ontologyTest#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:obo="http://purl.obolibrary.org/obo/" xmlns:owl="http://www.w3.org/2002/07/owl#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xml="http://www.w3.org/XML/1998/namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:skos="http://www.w3.org/2004/02/skos/core#" xmlns:terms="http://purl.org/dc/terms/"> <owl:Ontology rdf:about="http://my.ontology/ontologyTest"> <owl:imports rdf:resource="http://purl.obolibrary.org/obo/bfo/2019-08-26/bfo.owl"/> </owl:Ontology> <owl:Class rdf:about="http://my.ontology/ontologyTest#Event"> <rdfs:subClassOf rdf:resource="http://purl.obolibrary.org/obo/BFO_0000001"/> </owl:Class> </rdf:RDF> 当我打开本体时,我正在做: OntModel model = createModel("OWL_MEM"); FileManager.get().readModel(model, uri.toString()); Model _model = model.getRawModel(); model = new OntModelImpl(OntModelSpec.OWL_MEM, _model); ExtendedIterator classes = model.listClasses(); while (classes.hasNext()) { OntClass theOwlClass = (OntClass) classes.next(); if (thisClass.getNameSpace() == null && thisClass.getLocalName() == null) { continue; } ... } 我从我的本体中获取所有类(这里是Event),也从导入的本体中获取。 Jena 有没有办法知道 OntClass 是来自导入的本体并且未在我当前的本体中声明? 正如 UninformedUser 的评论中所说,感谢他,您可以执行以下操作: 列出所有导入本体的URI model.listImportedOntologyURIs() 列出导入本体的所有类model.getImportedModel(uri).listClasses() 在模型的所有类上创建一个迭代器,删除所有导入的类model.listClasses().filterDrop(importedClasses::contains) 因此,要打印模型的所有类而无需导入类: import java.util.HashSet; import java.util.Set; import org.apache.jena.ontology.OntClass; import org.apache.jena.ontology.OntModel; import org.apache.jena.ontology.OntModelSpec; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.util.iterator.ExtendedIterator; OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM); model.read("file:///Users/von/tools/data.owl", "RDF/XML"); Set<OntClass> importedClasses = new HashSet<>(); for (String uri : model.listImportedOntologyURIs()) { importedClasses.addAll(model.getImportedModel(uri).listClasses().toSet()); } ExtendedIterator<OntClass> it = model.listClasses().filterDrop(importedClasses::contains); while (it.hasNext()) { OntClass cls = it.next(); System.out.println(cls); }


react中firestore onSnapshot的返回值

我在函数中有一个 onSnapshot 查询: //firebaseutil.js 导出异步函数 getShorts(uid) { const q = query(collection(db, 'shorted'), where('owner', '==', uid)); 常量取消订阅 = onSnapsh...


PHP 5.x 是否有某种 HashSet 或 Set 类?

我习惯了 Java,其中有 HashSet、ArrayList 和其他 Collection。但我现在正在开发一个 PHP 项目。 我需要创建一个集合,用对象填充该集合(在本例中为字符串),但是...


将文件夹添加到 Firestore 时出错:无法使用空路径调用函数 collection()

我试图在我的项目模式中创建一个“AddFolderButton”,所以我想要的是添加后我单击按钮,它应该更新 firebase 云中的名称和 userId。 ...


如何下载使用 StreamWriter 编写的 xml 文件作为 xml 文件

我有一个使用 StreamWriter 用 C# 编写的 XML 文件,代码如下: 字符串文件名 = Session.SessionID + ".xml"; 字符串文件路径 = "h:\root\home\mchinni-001\www\site1\OUTFolde...


有没有办法在任何“向下”函数触发时禁用外键约束?

我正在讨论一种在执行 artisan migrate:refresh 命令时执行 Schema::disableForeignKeyConstraints() 的有效方法。例如,我们可以将其集成到迁移中......


如何知道当前的schema级别?大纲级别?

Excel 允许您使用 Outline.ShowLevels 建立显示轮廓的级别。 有什么方法可以知道当前方案中显示的级别吗? 像 level = Outline.Levels 这样的东西 T...


我开始收到此错误:错误:架构验证失败,出现以下错误:数据路径“”必须具有必需的属性“browserTarget”

如何解决? 这是我的 angular.json 文件: { "$schema": "./node_modules/@angular/cli/lib/config/schema.json", “版本”:1, "newProjectRoot": "项目...


如何为 JSON 数组指定 $schema

我有一个数组的 json 模式。该架构是正确的,我的数组可以根据它进行验证。现在我想在 json 中定义模式,就像我可以使用这样的对象一样: { ...


如何将自定义错误消息添加到 openapi 中自动生成的字段

如果我有一个 openapi 模式,其中包含以下条目 必需的: - 姓 特性: 姓: 类型:字符串 我得到生成的代码,例如 @NotNull() @Schema(name = "lastName&quo...


如何定义 XML 模式并使用 JS 验证 XML

我正在寻找一种在 XSD 文件中定义 XML 架构的方法,然后使用所述架构来验证存储在字符串中的 XML。我希望能够使用 JavaScript 来完成这一切,因为我...


如何将xml树放入单独的python文件中?

我使用 python 和 xml.etree.ElementTree 来构建 xml 文件。但只有基础树有超过 350 行,我想将其放在一个单独的文件中。我怎么做? 我的代码: 导入 xml...


从 xml 中的 php 输出中删除字符

我编写了一个从 Magento Commerce 数据库中提取的 xml/php 文档,以创建包含其中所有项目的 XML 文档,以便 Google 购物可以导入这些项目。谷歌的...


在Python中将注释xml转换为文本

我有一个文件夹,里面有大量带有图像注释数据的xml文件。我想将xml文件转换为文本文件,以便它们可以用于YOLO模型 我已经通过


Django-channels 实例关闭时间过长而被杀死

谁能告诉我可能是什么问题? 警告应用程序实例 谁能告诉我可能是什么问题? 警告应用程序实例 wait_for=> 连接 关闭时间过长并被终止。 我的阿斯吉 "^subscription", channels_jwt_middleware(MyConsumer.as_asgi(schema=schema)) ) application = ProtocolTypeRouter({ "http": django_asgi_app, "websocket": QueryAuthMiddleware( URLRouter([ subscription_url, ]) ), })``` my custom MyConsumer ```class MyConsumer(GraphQLWSConsumer): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.profile_id = None async def __call__(self, scope, receive, send): user = scope.get("user", None) time_zone = await get_current_timezone(user) self.profile_id = scope.get("active_profile_id", None) self.timezone = time_zone if time_zone else settings.TIME_ZONE await super().__call__(scope, receive, send) async def connect(self): await super().connect() await change_status(True, self.profile_id) async def disconnect(self, close_code, *args, **kwargs): await super().disconnect(close_code) await change_status(False, self.profile_id)``` 解决我的问题 daphne -b 0.0.0.0 -p $SERVER_PORT --application-close-timeout 60 --proxy-headers server.asgi:application


.NET:从 XPath 中定位原始 XML 文档中的节点

我正在尝试以编程方式定位由 XPath 标识的 XML 文本中的元素。也就是说,不仅要在解析的 XML 结构中找到引用的元素,还要确定开始和结束


Java XML解析:文档(DeferredDocumentImpl)与文档(XMLDocument)在不同环境下的差异

我在 Java 8 中遇到 XML 解析问题,其中相同的代码在生产环境中的行为与较低环境中的行为不同。 这是打印 XML nodeValue 的 Java 代码片段...


PHP Curl 下载远程 XML 文件

我正在尝试自动化工作流程并下载远程 xml 文件 (google-shopping-feed.xml) 我的函数如下所示 函数 saveRemoteFile($url, $filename) { 全球$


在 Java 中使用 JAXB 从 XML 反序列化 HashMap

这是我的 XML 内容: 我自己制作的,所以我可以改变它,只是发现这个结构适合我的数据。 道具 ...


如何将xml文件嵌入到资源文件中

我想将xml文件嵌入到我的项目中的资源文件中,每当我需要该文件时,我必须从资源中获取它并使用它,如何做到这一点,我想修改xml文件的内容取决于。 ..


如何在XML中对不同级别的标签进行分组?

这里是源xml。 我们有 1 个标头级别标签。 行级别标签包含在 1 个标题级别下。 ABC公司 在 ...


如何使用wcf通过post发送xml

如何在 WCF 的帮助下通过 post 发送 xml 数据? 例如我有一些代码: 公共接口 IServiceForILobby { 【运营合同】 [WebInvoke(方法 = "POST")] 字符串 SendXml(


如何通过正则表达式在字符串中重复查找相同的xml元素

我想通过正则表达式找到字符串中重复出现的多个相同的xml元素(但它在xml元素中包含不同的值)。 我尝试过,但无法在 python 中找到正确的编码...


Java Apache 在“Content-Disposition:”中设置附加参数

我正在使用 java Apache 5.3.1,我正在尝试使用 XML 发送多部分,并且需要以下“Content-Disposition:”集 - 内容处置:表单数据;名称=“xml”;文件名=...


Saxon XSLT 可以将 XML 保存到 eXist-db 吗?

Saxon XSLT 可以将 XML 保存到 eXist-db 吗?我搜索了文档和论坛,但找不到任何明确记录的内容。我可以使用 doc('http://localhost:8080/exist/rest...


将 Unix 文件的内容复制到 Postgres 表列

我有一个要求,即在 Unix 路径上接收 XML 文件。我想将此 xml 文件的内容复制到 Postgres 表的一列中。 收到的示例文件:/home/bojack/test.xml ...


确实 API XML 在多次请求后被阻止

我一直在使用 Indeed.com XML Feed API 来收集测试申请的职位信息。看来我们的服务器 IP 的 API 被阻止并抛出以下错误。 卷曲:(56) 接收 f...


XML 文档位于包中,但从未复制到输出目录

生成的包确实包含 DLL 文件旁边的 XML 文件,但是,当使用其他项目的包时,文档永远不会复制到输出目录。 这是重新...


使用组时无法识别 TestNG 参数

使用 testNG xml 运行测试套件时,测试将正常运行,并且 xml 文件中的所有参数均按预期使用。当我将分组添加到我的 @Test 方法并添加组时...


Nuget 包不复制内容(XML 文件)

我们正在使用 TFS 构建步骤来创建 nuget 包。所以 TFS 自动完成这项工作,我的意思是,它首先创建 nuspec 文件,然后创建 nupkg。 所以,这个包包含我的 xml setti...


OWASP ZAP 扫描工具不支持 XML 格式的请求

我想使用 ZAP 工具执行扫描并使用 CI 管道生成报告。 .Net Web API 接受请求并返回 XML 格式的响应。 API 工作正常。 每当我运行 ZAP 工具时...


如何使用布尔属性定义 XML 模式并使用 JS 验证 XML [重复]

我正在寻找一种根据自定义 XML 模式(XSD 文件)解析 XML 字符串的方法,其中包括布尔属性,例如在 HTML 中使用“选中”或“隐藏”等进行的操作: 我正在寻找一种根据自定义 XML 模式(XSD 文件)解析 XML 字符串的方法,其中包括布尔属性,例如在 HTML 中使用“选中”或“隐藏”等进行的操作: <div checked hidden> hello world </div> 我不能只使用 HTML 和 HTML 解析器,因为我希望能够定义自己的允许布尔属性列表。我无法使用纯 XML,因为纯 XML 根本不允许布尔属性。 有什么方法可以利用带有布尔属性的 XML 吗? 我希望能够在 JavaScript 中完成这一切,但如果绝对必要,我可以使用其他东西。 Java 脚本不存在使用 XSD 对客户端 XML 验证的直接支持。我能找到的最好的客户端是这个用于 java 脚本的第三方库:xmljs。还有一个展示其用法的演示:demo. 对于复杂且更强大的验证,我建议在服务器端进行,使用 Node.js 库(例如 libxmljs)或其他语言的支持,例如 Java 库 Xerces 或 C# 中的 XmlSchemaSet 类。


AppleScript。可能是不合理的语法复杂化。从 xml 导入 iTunes 播放计数

我是 AppleScript 新手,只练习了几周。我编写了一段代码,用于从音乐应用程序导入的 xml 文件(实际上更像是 plist)传输信息(


使用 kotlin/compose 与 java/xml 指南相比

我猜我应该说我对 kotlin 的 compose 很陌生,我只用过 java/xml 的项目,我在这里很困惑。 使用java,我们为每个屏幕提供具有自己的逻辑/设计的片段。这里...


使用 xml 中多个位置存在的元素创建 tde 模板

我正在使用 MarkLogic 进行 TDE。我有一个特定的场景,需要提取 XML 中不同级别可用的城市。城市值必须转到同一列值而不是选项卡


在 Python 中分割大型 XML 文件

我希望将一个巨大的 XML 文件分割成更小的部分。我想扫描文件查找特定标签,然后获取 和 之间的所有信息,然后将其保存到文件中,然后继续


将嵌套 XML 转换为 R 中的数据帧

我正在尝试将 ClinicalTrials.gov 中的 XML 数据转换为数据框架,以便在 R 中进行分析。我有一个 URL,允许我在每项研究中选择我要查找的特定字段。每行和


如何通过值匹配 xml 属性名称并仅从元素列表中显示该元素

我是 xslt 的新手。我只想显示 xml 列表中匹配的项目。 使用 xslt 转换。 在这种情况下,我只想显示名称为“一”和“二”的属性 那...


如何使用powershell更新xml文件中的节点类型元素

我有一个下面的 xml 文件示例。我想更新元素设置节点并将其更改为“NewSettings”(以粗体突出显示)。我尝试通过 powershell 使用不同的属性来完成此操作...


另一个模型中的模型列表仅保存列表中所有项目中最后添加的项目

对于 (int x=0; x for (int x=0; x<listaEquipes.length; x++) { await _loadEquipe(listaEquipes[x].id.toString()); TabelaListaEquipes _reg = TabelaListaEquipes(); _reg.equipeId = listaEquipes[x].id.toString(); _reg.equipe = listaAtletaEquipe; //print (_reg.equipe![0].nome.toString()); listaEquipesGeral.add(_reg); } 此型号: class TabelaListaEquipes { String? equipeId; List<TabelaInscricoes>? equipe; TabelaListaEquipes( { this.equipeId, this.equipe}); } 现在我看到最后一个reg保存在列表的所有iten中,为什么? 这就对了: listaEquipesGeral[0].equipe == listEquipesGeral[1].equipe ...仍然添加了最后一项。为什么?? _loadEquipe 函数,它也有效,我已经测试过了, List<TabelaInscricoes> listaAtletaEquipe = []; Future<void> _loadEquipe(equipId) async { setState(() { listaAtletaEquipe.clear(); carregandoEquipe = true; }); TabelaInscricoes _result = TabelaInscricoes(); CollectionReference _dbCollection = FirebaseFirestore.instance.collection('campeonatos').doc(resultSelect.campId).collection('divisoes').doc(resultSelect.divId).collection('equipes').doc(equipId).collection('atletas'); await _dbCollection.orderBy('pos2', descending: false).get().then((QuerySnapshot querySnapshot) async { if (querySnapshot.docs.isNotEmpty) { querySnapshot.docs.forEach((element) async { _result = TabelaInscricoes.fromJson(element.data()! as Map<String, dynamic>); if (_result.campId == resultSelect.campId && _result.divId == resultSelect.divId) { _result.id = element.id; _result.filePath = ""; setState(() { listaAtletaEquipe.add(_result); }); } }); for (int x = 0; x<listaAtletaEquipe.length; x++) { for (int y = 0; y<listaAtletas.length; y++) { if (listaAtletaEquipe[x].atletaId.toString() == listaAtletas[y].id.toString()) { setState(() { listaAtletaEquipe[x].nome = listaAtletas[y].nome; listaAtletaEquipe[x].fotoNome = listaAtletas[y].fotoNome; listaAtletaEquipe[x].filePath = listaAtletas[y].filePath; listaAtletaEquipe[x].dataN = listaAtletas[y].dataN; listaAtletaEquipe[x].fone1 = listaAtletas[y].fone1; listaAtletaEquipe[x].fone2 = listaAtletas[y].fone2; listaAtletaEquipe[x].nTitulo = listaAtletas[y].nTitulo; listaAtletaEquipe[x].info = listaAtletas[y].info; listaAtletaEquipe[x].email = listaAtletas[y].email; }); } } } for (int x=0; x<listaAtletaEquipe.length; x++) { if (listaAtletaEquipe[x].fotoNome.toString().isNotEmpty) { await MyStorage.getUrl(context, "atletas/${listaAtletaEquipe[x].fotoNome.toString()}").then((value) { setState(() { listaAtletaEquipe[x].filePath = value; }); }); } } setState(() { carregandoEquipe = false; }); }else { setState(() { carregandoEquipe = false; }); } }); } AtletaEquipes 型号操作系统列表: class TabelaInscricoes{ bool? carregando = true; String? id; String? campId; String? divId; String? atletaId; String? nome_responsavel; String ?posicao; String? filePath; Uint8List? imageFile; String? usuario; String? nInscricao; String? nome; String? dataN; String? nTitulo; String? fone1; String? fone2; String? info; String? email; String? fotoNome; String? pos2; String? selected; TabelaInscricoes({ this.carregando, this.nome, this.dataN, this.nTitulo, this.fone1, this.fone2, this.info, this.email, this.id, this.campId, this.divId, this.posicao, this.nome_responsavel, this.nInscricao, this.atletaId, this.selected, this.pos2, this.fotoNome, this.filePath, this.imageFile, this.usuario}); Map<String, dynamic> toJson() => { 'campId': campId, 'divId': divId, 'atletaId': atletaId, 'nome_responsavel': nome_responsavel, 'posicao': posicao, 'usuario': usuario, 'nInscricao': nInscricao, 'pos2': pos2, 'selected': selected }; TabelaInscricoes.fromJson(Map<String, dynamic> json) : campId = json['campId'], divId = json['divId'], atletaId = json['atletaId'], nome_responsavel = json['nome_responsavel'], posicao = json['posicao'], nInscricao = json['nInscricao'], pos2 = json['pos2'], selected = json['selected'], usuario = json['usuario']; } 这里发生了什么,listaEquipesGeral 总是保存最后添加的所有项目。 我明白了,解决方案是在模型内的列表中逐项添加: for (int x=0; x<listaEquipes.length; x++) { await _loadEquipe(listaEquipes[x].id.toString()); TabelaListaEquipes _reg = TabelaListaEquipes(); _reg.equipeId = listaEquipes[x].id.toString(); _reg.equipe = []; //here above the solution, include for to put item by item, and it works for (int y = 0; y<listaAtletaEquipe.length; y++) { _reg.equipe!.add(listaAtletaEquipe[y]); } //print (_reg.equipe![0].nome.toString()); listaEquipesGeral.add(_reg); }


Ansible 无法通过 XPath 读取属性(不是元素)

我尝试从 XML 文件读取 XML 属性的值,但收到此错误: Xpath /sca:composite/@revision 未引用节点! 我的 XML 文件如下所示: 我试图从 XML 文件中读取 XML 属性的值,但收到此错误: Xpath /sca:composite/@revision 未引用节点! 我的 XML 文件如下所示: <composite revision="1.0.1" xmlns="http://xmlns.oracle.com/sca/1.0"> ... </composite> 我的 Ansible 命令是: - name: 'Get revision' xml: path: 'composite.xml' xpath: '/sca:composite/@revision' content: attribute namespaces: sca: 'http://xmlns.oracle.com/sca/1.0' register: my_revision 我尝试过不少于20种XPath的排列方式,比如: /composite/@revision /composite/revision /sca:composite/@revision /sca:composite/revision /sca:composite/@sca:revision 并使用 content 作为 text 和 attribute。 我能得到的最接近的结果是用 XPath 匹配根节点:/sca:composite。 但我就是找不到该属性。 有什么建议吗? 我找到了一个做作的两步解决方法。首先,XPath 仅匹配元素。其次,导航 JSON 结果/匹配属性。 -name: 'Match XPath' xml: path: 'composite.xml' xpath: '/sca:composite/@revision' content: attribute namespaces: sca: 'http://xmlns.oracle.com/sca/1.0' register: xpath_match -name: 'Get revision' set_fact: my_revision: '{{xpath_match.matches[0]["{http://xmlns.oracle.com/sca/1.0}composite"].revision}}' 注意:XPath 匹配返回一个 JSON 对象,例如: { "matches": [ { "{http://xmlns.oracle.com/sca/1.0}composite": { "revision": "1.0.1" } } ] } 不要对 "composite" 的 JSON 字段名称感到困惑。它的语法是"{xmlnamespace}composite"


从表中生成嵌套的 xml;什么方法是最好的路径、元素?

我需要从我的表中生成如下格式的 XML。你能建议我应该使用什么方法(路径、元素、原始)或者可以是几种方法的组合吗? 请在下面找到我的测试...


如何摆脱>< (html tags) in woot.com API?

我正在制作一个woot应用程序,并且我正在使用API。 XML rss 文件的描述部分,总是有很多 > 和 < (l...


如何根据值确定节点的位置

我试图根据节点的值获取节点的位置,以便我可以获取相应的条目。 这是源 XML: ...


以编程方式设置 windowlightstatusbar 属性

如您所知,我们可以通过以下代码从 xml 设置 windowLightStatusBar。 真实 我需要将此属性 true 更改为 false 或 fal...


如何使用 XML 查询功能从 XML 节点查询值

我有以下 XML 数据: 声明@x XML 设置@x=' 订购 我有以下 XML 数据: DECLARE @x XML SET @x='<Orders> <HeadingSection> <DocumentNameCode>Order</DocumentNameCode> <DetailSection> <LineItem LineItemNumber="10"> <ItemId>123456789</ItemId> <ItemTypeId>EN</ItemTypeId> <AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>ABC</ItemId> <TypeId>SA</TypeId> </Item> </AdditionalProductId> <AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>XYZ</ItemId> <TypeId>IN</TypeId> </Item> </AdditionalProductId> </LineItem> </DetailSection> <SummarySection/> </HeadingSection> </Orders>' 我已经使用了以下T-Sql脚本(必须有光标) DECLARE @xmlQuittungPOS XML DECLARE quittungCurPOS CURSOR FOR SELECT QuittungXMLPOS = T.X.query('.') FROM @x.nodes('/Orders/HeadingSection/DetailSection/LineItem') AS T(X) OPEN quittungCurPOS FETCH NEXT FROM quittungCurPOS INTO @xmlQuittungPOS WHILE @@FETCH_STATUS = 0 BEGIN INSERT INTO dbo.tempPOS ( GTIN ,edi_PIA_SA ,edi_PIA_IN ) SELECT GTIN = T.X.query('/LineItem[ItemTypeId = "BP"]').value('(/LineItem/ItemId)[1]','VARCHAR(100)') -- funktioniert / works ,edi_PIA_SA = T.X.query('/LineItem/AdditionalProductId/Item[TypeId = "SA"]').value('(/LineItem/AdditionalProductId/Item/ItemId)[1]','VARCHAR(255)') -- funktioniert nicht / doesn't work ,edi_PIA_IN = T.X.query('/LineItem/AdditionalProductId/Item[TypeId = "IN"]').value('(/LineItem/AdditionalProductId/Item/ItemId)[1]','VARCHAR(255)') -- funktioniert nicht / doesn't work FROM @xmlQuittungPOS.nodes('/LineItem') AS T(X) FETCH NEXT FROM quittungCurPOS INTO @xmlQuittungPOS END CLOSE quittungCurPOS DEALLOCATE quittungCurPOS 1.) GTIN -> 查询有效 2.) PIA_SA 和 PIA_IN -> 查询不起作用 问题: 我认为这是因为 '/LineItem/AdditionalProductId/Item[TypeId = "SA"]' 位于附加节点中。 问题: 如何获取中TypeId“SA”和“IN”的值 <AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>**ABC**</ItemId> <TypeId>SA</TypeId> </Item> </AdditionalProductId> <AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>**XYZ**</ItemId> <TypeId>IN</TypeId> </Item> </AdditionalProductId> with .value('(/LineItem/AdditionalProductId/Item/ItemId)[1]','VARCHAR(255)') !处于 1 级! -- 我知道。 级别 1 上的 SA -> .value('(/LineItem/AdditionalProductId/Item/ItemId)[1]','VARCHAR(255)') 级别 2 上的 SA -> .value('(/LineItem/AdditionalProductId/Item/ItemId)[2]','VARCHAR(255)') 但我现在需要查询类型 谢谢 不清楚你在这里追求什么,所以我回答两者。如果您想要每个 Item 节点 1 行,那么您只需对 nodes 节点使用 Item 并获取 value 文本的 ItemId: DECLARE @xml xml = '<AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>**ABC**</ItemId> <TypeId>SA</TypeId> </Item> </AdditionalProductId> <AdditionalProductId Qualifier="ProductId"> <Item> <ItemId>**XYZ**</ItemId> <TypeId>IN</TypeId> </Item> </AdditionalProductId> '; SELECT AP.I.value('(ItemId/text())[1]','varchar(15)') AS ItemId, AP.I.value('(TypeId/text())[1]','varchar(15)') AS TypeId FROM (VALUES(@XML))V(X) --To give impression it's against a table CROSS APPLY V.X.nodes ('AdditionalProductId/Item')AP(I); 但是,如果您希望每个不同的 TypeID 值各有 1 列,您可以在 XML 中进行过滤: SELECT X.AP.value('(AdditionalProductId/Item[TypeId[(text()[1])="SA"]]/ItemId/text())[1]','varchar(15)') AS ItemSA, X.AP.value('(AdditionalProductId/Item[TypeId[(text()[1])="IN"]]/ItemId/text())[1]','varchar(15)') AS ItemIN FROM @xml.nodes ('/')X(AP); --To give impression it's against a table 或者使用之前的查询并使用条件聚合: WITH Items AS( SELECT AP.I.value('(ItemId/text())[1]','varchar(15)') AS ItemId, AP.I.value('(TypeId/text())[1]','varchar(15)') AS TypeId FROM @xml.nodes ('AdditionalProductId/Item')AP(I)) SELECT MAX(CASE TypeID WHEN 'SA' THEN ItemId END) AS ItemSA, MAX(CASE TypeID WHEN 'IN' THEN ItemId END) AS ItemIN FROM Items;


Android:在文本视图周围添加边框

如何使用 xml 布局在文本周围添加边框,如图所示 我尝试在布局中添加边框,但它与文本重叠。


© www.soinside.com 2019 - 2024. All rights reserved.