【问题标题】:Peach fails when I use the attribute xmlns当我使用属性 xmlns 时,Peach 失败
【发布时间】:2016-03-20 15:31:19
【问题描述】:

我想创建PeachDataModel,它会模糊XML(准确地说,是来自.docx 的[Content_Types].xml)。但是当我创建一个XmlElement 属性 xmlns 时,桃子会因未处理的异常而崩溃:System.ArgumentException

有效:

<DataModel name="TestTemplate">
        <XmlElement elementName="Types">
                <XmlAttribute attributeName="xmlnsSOMELETTERS">
                        <String value="http://schemas.openxmlformats.org/package/2006/content-types">
                        <Analyzer class="StringToken"/>
                        </String>
                </XmlAttribute>
.......
</DataModel>

它不起作用:

<XmlElement elementName="Types">
                <XmlAttribute attributeName="xmlns">
                        <String value="http://schemas.openxmlformats.org/package/2006/content-types">
                        <Analyzer class="StringToken"/>
                        </String>
                </XmlAttribute>

你能帮我解决这个问题吗?

Full xml

【问题讨论】:

  • xmlns 不是属性。是命名空间声明。您无法使用XmlAttribute 创建它们。 (顺便说一句,仔细阅读 [fuzzing] 的标签描述,我很确定这不是你的意思。)
  • 我必须想办法让“Peach”生成的元素看起来像 schemas.openxmlformats.org/package/2006/content-types"> ...
  • @Tomalak:Peach 的标签可能会更好,但“模糊测试”并不遥远。
  • @kjhughes 标签存根已创建。

标签: xml xml-namespaces fuzzing peach


【解决方案1】:

正如@Tomalak 在 cmets 中提到的,xmlns 不是属性而是命名空间声明,因此您必须以不同的方式处理它。

Peach 中,XmlElement 上有一个特殊属性 (ns) 可用于命名空间声明。

【讨论】:

  • schemas.openxmlformats.org/package/2006/content-types">
猜你喜欢
  • 1970-01-01
  • 2011-07-14
  • 1970-01-01
  • 2013-05-19
  • 2011-12-10
  • 1970-01-01
  • 1970-01-01
  • 2010-12-29
  • 2015-04-13
相关资源
最近更新 更多