RubyGems Navigation menu

xml-smart 0.3.0.1

XML::Smart - A Ruby class for fast and simple XML access

Copyright © 2004-2012 Jürgen Mangler <juergen.mangler@univie.ac.at>

Ruby/XML/Smart is freely distributable according to the terms of the GNU Lesser General Public License (see the file ‘COPYING’).

This program is distributed without any warranty. See the file ‘COPYING’ for details.

Installation

  • Based on Nokogiri 1.5.5

  • Thus works for MRI ruby 1.8.7, 1.9.x, JRuby (basically everything that is Nokogiri ready)

  • Works on Linux, OSX, Windows

Features

Principle of least surprise
  • Nokogiri is messy - violence always is

  • libxml smells like old-school C-Binding ;-)

  • rex is … strange

Inherits Nokogiris GREAT compatibility for platforms and Ruby interpreters
XML only
  • sorry, no css selectors, html, … go to Nokogiri if you

look for these
Great and convenient namespace support, compared to everything else out there
  • use namespaces in xpaths without any additional work

    doc = XML::Smart.string('<test xmlns:aaa="uri:aaa"><aaa:test/></test>')
    doc.find('string(aaa:test)')
    doc.close
    
  • register your own shortcusts to be available in all XPaths

    doc = XML::Smart.string('<test xmlns:aaa="uri:aaa"><aaa:test/></test>')
    doc.register_namespace :a, 'uri:aaa'
    doc.find('string(aaa:test)')
    doc.close
    
NFS safe file locking while editing / reading from an XML fileA

XML::Smart.modify(“EXAMPLE.xml”,“<test><names/></test>”) { |doc|

doc.root.add("test_node")

}

Changes since 0.2.x (see Changelog):

  • qname instead of name

  • #register_namespace instead of #namespaces= to register shortcuts

  • no more namespaces for #find necessary, all namespaces in document are automatically available.

  • signals removed

  • pull parser removed

Documentation

Sorry, no inline code documentation yet. We have an extensive test suite, look for examples there for now.

Gemfile:
= 复制到剪贴板 已复制!

安装:
=

版本列表:

  1. 0.5.2 - June 11, 2023 (28.5 KB)
  2. 0.5.1 - March 21, 2023 (28.5 KB)
  3. 0.5.0 - March 17, 2023 (28.5 KB)
  4. 0.4.4 - December 08, 2021 (28.5 KB)
  5. 0.4.3 - June 05, 2020 (28.5 KB)
  6. 0.3.0.1 - December 12, 2012 (32.5 KB)
显示所有版本 (共 44 个)

Runtime 依赖 (4):

业主:

作者:

  • Juergen eTM Mangler

SHA 256 校验和:

09c1e97b39f93f40e21232902d16e527fa8c215520eaa9b2cc5fd36b4bbb40e2

下载总量 98,607

这个版本 2,694

许可:

需要的 Ruby 版本:

链接: