【问题标题】:How to clone attributes of a SAX Parser如何克隆 SAX 解析器的属性
【发布时间】:2015-06-18 19:46:18
【问题描述】:

在 Java 中使用 SAX Parser 时,我们将属性作为 startElement 方法中的参数之一。

谁能告诉我如何克隆这个属性,以便它可以存储在HashMap<String, Attributes>中。

【问题讨论】:

    标签: java xml-parsing attributes sax saxparser


    【解决方案1】:

    new AttributesImpl(Attributes atts)

    复制现有的 Attributes 对象。这个构造函数特别 在 startElement 事件中很有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-14
      • 2012-07-02
      • 2014-03-16
      • 2013-03-16
      • 2015-04-12
      • 2012-12-19
      • 2011-06-21
      • 1970-01-01
      相关资源
      最近更新 更多