草庐IT

GL_INVALID_VALUE

全部标签

c# - XML 验证 : decimal attribute value starting with a space

我开发了一个小的C#脚本,它可以打开一个XLS文件,解析它并创建一个XML文件列表来验证它们XSD文件。我已尝试将这些经过验证的文件上传到第三方在线服务(为我提供文档/xsd内容的同一家公司),但一个生成的文件未被接受,因为无效.该文件不被接受,因为它在节点属性中的十进制值的开头有一个空格;删除此空格可解决问题。我创建了一个简单的测试用例,其中XDocumentValidate方法使用额外空间验证XML没有任何问题。usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSys

xml - XML 数据类型方法 "value"的参数 1 必须是字符串文字

我已通读SO:XMLdatatypemethod“value”mustbeastringliteral但我的问题有点不同。我在一个变量中有一些xml,我想分开并给出一个路径。最初我试过这个:declare@xxmlselect@x='....'select@x.value('('+@path+')[1]','varchar(max)')但是,当然,那失败了。然后我找到了sql:variable并尝试了这个:select@x.value('(sql:variable("@path"))[1]','varchar(max)')但这奇怪地返回了@path的值(为什么?)。我一直在搞乱它,但无

.net - "Token Text in state EndRootElement would result in an invalid XML document"

我看到这条异常消息来自XslCompiledTransform.Transform(),但在处理异常之后,XSL转换似乎仍然成功。完整的异常消息是:TokenTextinstateEndRootElementwouldresultinaninvalidXMLdocument.MakesurethattheConformanceLevelsettingissettoConformanceLevel.FragmentorConformanceLevel.AutoifyouwanttowriteanXMLfragment.样式表如下所示:IXMLBARBAZFTP生成的XML如下所示:a5e

xml - 释放时 TXMLDocument 'Invalid pointer operation'

我正在使用TXMLDocument编写一个在网络服务器中使用的XML字符串。当服务器收到请求时创建组件,生成XML,将其传递回客户端,然后组件被释放。然而,当这个组件被释放时,我得到了Invalidpointeroperation。XML:=TXMLDocument.Create(nil);tryXML.Active:=True;nRoot:=XML.AddChild('topics');forX:=0toFCHM.Topics.Count-1dobeginnTopic:=nRoot.AddChild('topic');//Addmoredata...end;Response.Cont

xml - Groovy XmlSlurper : get value of attribute that has an associated namespace

我有一个XML文档,其中包含具有限定名称的属性。我想使用XmlSlurper获取属性值,但尝试在不指定命名空间的情况下访问属性不起作用(下面是一个最小示例)。defrootNode=newXmlSlurper().parseText('''Sometext!''')assertrootNode.one[0].@a1.text()=='uno!'rootNode.one[0].@a1.text()将产生一个空字符串。如果使用rootNode.one[0].'@ex:a1'.text()我们会得到正确的值,但这取决于文档中使用的namespace前缀-并且不能依赖于其他文档相同,关联的命名

python - Unicode解码错误: 'utf-8' codec can't decode byte 0xe2 in position 434852: invalid continuation byte

我正在使用hfcca计算C++代码的圈复杂度。hfcca是一个简单的python脚本(https://code.google.com/p/headerfile-free-cyclomatic-complexity-analyzer/)。当我尝试运行脚本以生成xml文件形式的输出时,出现以下错误:Traceback(mostrecentcalllast):"./hfcca.py",line802,inmain(sys.argv[1:])File"./hfcca.py",line798,inmainprint(xml_output([fforfinr],options))File"./hf

Python XPath 语法错误 : invalid predicate

我正在尝试像这样解析一个xmlXBVGHFashlplp这是我的代码importxml.etree.ElementTreeasETtree=ET.parse("../../xml/test.xml")root=tree.getroot()path="./pages/page/paragraph[text()='GHF']"printroot.findall(path)但是我得到一个错误printroot.findall(path)File"X:\Anaconda2\lib\xml\etree\ElementTree.py",line390,infindallreturnElementP

xml - 这个 "PCDATA invalid Char value 11"错误是什么?

这个问题在这里已经有了答案:Howtoparseinvalid(bad/notwell-formed)XML?(4个答案)PHPgeneratedXMLshowsinvalidCharvalue27message(2个答案)关闭5年前。我必须使用一个XML文件,但我没有得到所有的项目,因为这个错误显示在我的导航器中,在文件内容之前。确切的错误是:Thispagecontainsthefollowingerrors:erroronline4099atcolumn10:PCDATAinvalidCharvalue11Belowisarenderingofthepageuptothefirs

.net - XML 反序列化 : Deserialize missing element into null property value

我的xml文档有一个元素可以包含多个子元素。在我的类里面,我将该属性声明为:[XmlArray("files",IsNullable=true)][XmlArrayItem("file",IsNullable=false)]publicListFiles{get;set;}在反序列化过程中,如果元素丢失,我希望Files属性为null。但是,发生的情况是Files被反序列化为一个空的List对象。我该如何防止呢? 最佳答案 实现这一点的一个选项是封装列表:publicclassFoo{[XmlElement("files",IsNu

c# - 在 C# 中使用 Value 属性从 Xml 中反序列化枚举

我正在尝试用C#为图书导入工具编写一个ONIX。我首先使用Xsd2Code创建类,并获得了一个包含所有属性的巨大文件,经过一些调整后反序列化时不会产生任何错误。我试图一次性将整个元素反序列化为内存中的一个大对象,然后用它做一些事情(比如将它保存到数据库)。Xsd2Code生成类的方式,除了有很多属性之外,有点奇怪,至少对我来说是这样。下面是一个应该是Product对象的属性的类:publicpartialclassNotificationType{publicNotificationTypeRefnamerefname{get;set;}publicNotificationTypeSh