Martian eyrie

January 16, 2007

xmlcodec a XML importer/exporter framework for Ruby

Filed under: RubyOnRails

xmlcodec a XML importer/exporter framework for Ruby

xmlcodec - a XML importer/exporter framework for Ruby

What is this? This is a framework to create importers/exporters of XML formats for Ruby. To create a new importer/exporter all you have to do is create a ruby class for each of the XML elements.

Where do I get it? This project is hosted on RubyForge. You can see the project page or go straight to the files section to get the latest version. If you have RubyGems installed you can just do "gem install xmlcodec" and it will fetch the latest version from the network.

What features does it have? The basic model of the framework is that an importer/exporter maps a XML tree into a Ruby object tree. To do this you write Ruby classes for each of the XML format’s elements. After that you get several API’s for free:

  • Import/Export XML text
  • Import/Export REXML DOM
  • A stream parser whose events are whole elements imported into a Ruby object
  • A partial export API that can be used to create huge XML files with constant memory usage

The first two API’s treat the XML as a whole tree at once.

The stream parser allows you to parse a very big XML file as a stream but with more meaningfull events than a regular XML stream parser.

The partial export API allows you to create huge XML files the same way you’d create a small one (by putting elements in the Ruby tree) but without having to create the whole tree in memory. This is done by exporting an element into the output file and then removing it from the tree. This is not done automatically, but it’s pretty easy to do.

Научная библиотека

Filed under: It's my life

Научная библиотека

Ruby: Pippin and Roog

Filed under: RubyOnRails

File: ReadMe.txt Pippin and Roog Pippin is a high level XML Schema based tool for:

  •  Marshaling Ruby Objects to XML
  •  Unmarshaling XML into Ruby Objects.

If you are familiar with other Ruby XML tools, you may want to know how Pippin differs from REXML (www.germane-software.com/software/rexml/). Pippin is a layer on top of REXML that makes it even easier to work with XML documents that are described by XML schemas. Using Pippin is not much harder than digesting the XML schema, and pointing Pippin to an instance file to unmarshal, or an Object graph to marshal. Examples are shown in a later section.

Библиотека электронных публикаций

Filed under: It's my life

Библиотека электронных публикаций Института исследований природы времени при МГУ

Почему фантасты не предсказали интернет и сотовую связь?

Filed under: It's my life

Почему фантасты не предсказали интернет и сотовую связь? - Статьи - ЖУРНАЛ «MOBI»

В диких дебрях паутины Интернет — в том виде, который доступен сегодня любому пользователю компьютера, КПК или мобильного телефона с WAP, — явление достаточно специфическое. В немалой степени потому, что большая часть информации в сети никем не проверяется и не контролируется. Каждый может вывесить свое видение политической ситуации, приватное фото кинозвезды, а то и новую Теорию Всего-и-Сразу. Благодаря поисковым машинам любая, даже самая бредовая или откровенно провокационная информация становится всеобщим достоянием. Непроверенные новости, факты и псевдонаучные теории разбредаются по сети, попадая, в конце концов, на страницы популярных блогов или новостных лент, а из них — и в официальную печать. В итоге пресловутая свобода слова оказывается свободной не только от контроля (что, конечно, неплохо), но и от любых форм ответственности.

Статистика: Мировые религии - распределение в мире

Filed under: It's my life

Распределение мировых религий в мире






















Get free blog up and running in minutes with Blogsome
Theme designed by Minz Meyer