草庐IT

macro_name

全部标签

java - jackson 序列号 : Setting field value as XML element name

我们在基于jax-rs的RESTAPI项目中使用Jacksonjax-rsXML内容提供程序来处理XML内容类型。在序列化POJO列表时,我们需要从POJO中的字段动态设置xml元素名称。publicclassResponsePOJO{@JacksonXmlProperty@JacksonXmlElementWrapper(useWrapping=false)privateListmessage=newArrayList();}publicclassMessage{privateStringtype;//"Error"or"Warning"privateStringmsg;//Thea

xml - 无法解析匹配的构造函数(提示 : specify index/type/name arguments for simple parameters to avoid type ambiguities)

我在将Spring安全版本3迁移到4时遇到此异常。我正在使用基于Sprig4XML的安全性来实现它。您将不胜感激异常:Causedby:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'util:list#f1d6071':Cannotcreateinnerbean'security:filter-chain#1c5c0deb'oftype[org.springframework.security.web.DefaultSecurityFilterChain]whilese

xml - 获取具有 "name"属性的 XML 元素的标记名称

$x=([xml]"").sample鉴于上面的代码行,我想在$x中找到XmlElement描述的标签的名称。通常,您只会使用$x.Name,但name属性会掩盖它。$x.name不是返回sample,而是返回notsample。我发现的唯一解决方法是:[Xml.XmlElement].GetProperty("Name").GetValue($x)...但这很老套。我怎样才能正确地做到这一点? 最佳答案 直接调用属性getter方法即可获取:$x.get_Name()这适用于许多其他类似情况。例如,如果一个类型实现了IDicton

c# - 如何获取具有 : in its name? 的元素

我需要从这个XML中获取CountryName:http://api.hostip.info/?ip=12.215.42.19响应XML是:ThisistheHostipLookupServicehostipinapplicable12.215.42.19SugarGrove,ILUNITEDSTATESUS-88.4588,41.7696问题是我不能在Descendants方法中包含:因为它会抛出:XmlException:The':'chracater,hexadecimalvalue0x3A,cannotbeincludedinaname.谢谢 最佳答

python - 带有 : in name in lxml 的标签

我正在尝试使用lxml.etree来解析Wordpress导出文档(它是XML,有点像RSS)。我只对已发布的帖子感兴趣,因此我使用以下内容循环浏览已发布的帖子:foritemindata.findall("item"):ifitem.find("wp:post_type").text!="post":continueifitem.find("wp:status").text!="publish":continuewrite_post(item)其中data是所有item标签所在的标签。item标签包含帖子、页面和草稿。我的问题是lxml找不到名称中包含:的标签(例如wp:post_t

xml - WIX 实用程序 :xmlfile File name is Source attribute

我正在从WiseInstaller迁移到WIX,并使用util:xmlfile更新配置xml文件。这有效。这是行不通的。当.msi与第一个组件一起执行时,一切正常。在第二个版本中,返回错误“Error25531.FailedtoopenXMLfile...”据我所知,唯一的区别是文件名中的连字符。有什么不同的建议吗? 最佳答案 尝试使用组件的ID而不是硬编码名称[#config]//whichwillrefertotheFileId代替[INSTALLDIR]prod-config.xml

xml - src 解析 : Cannot resolve the name 'ds:Signature' to an 'element declaration' component

我想使用XSD文件进行模式验证。当我将XSD文件导入Eclipse时,没有运行验证类,出现以下错误:src-resolve:Cannotresolvethename'ds:Signature'toan'elementdeclaration'component我对XML与XSD验证过程有点陌生。虽然我在谷歌上寻找过类似的问题,但我无法弄清楚这里出了什么问题。XSD文件如下:我应该如何修改XSD以修复此错误? 最佳答案 如果您有xmldsig-core-schema.xsd在与您的XSD相同的目录中,如果它与thisXSD相同,那么你不

c# - 反序列化错误 : The XML element 'name' from namespace '' is already present in the current scope

这是我第一次使用XML序列化,在尝试解决此问题2天后,这绝对让我疯狂。反序列化开始时出现此错误:TheXMLelement'name'fromnamespace''isalreadypresentinthecurrentscope.UseXMLattributestospecifyanotherXMLnameornamespacefortheelement.错误发生在我代码中的这一行:Albumalbum=(Album)serializer.Deserialize(reader);我不知道为什么。没有重复的“名称”节点,所以我就是不明白。这是从来自第3方RESTAPI的HttpWebR

xml - 使用 local-name() 获取 XSLT 中的第一个子节点

假设我们有这个简单的xml...我正在使用此xpath获取第一本书实例的元素。//books[1]/*返回这很好用,但我必须使用local-name()让它工作。我已经尝试了以下但这些都不起作用......//*[local-name()='books']/*这会返回重复的author和title元素,不好,我只需要来自第一个child的它们//*[local-name()='books'][0]/*这不会返回任何东西基本上,我想创建一个CSV文件,因此输出中的第一行将是一个标题,其中列出了图书属性名称,后跟任意数据值。我只需要让header部分正常工作。author,titlejoh

c# - 系统.Xml.XmlException : Unexpected end of file while parsing Name has occurred

我正在使用通过SqlCommand.ExecuteXmlReader检索的XmlReader。Hereismyinput当我运行这行代码时:XDocumentcurrentXDoc=XDocument.Load(ktXmlReader.ReadSubtree());它第一次工作,按预期读取第一个Product节点。第二次运行时,出现以下异常:System.Xml.XmlException:Message:UnexpectedendoffilewhileparsingNamehasoccurred.Line1,position2048.Stacktrace:atSystem.Xml.Xm