Tbpgr Blog

Employee Experience Engineer tbpgr(てぃーびー) のブログ

2013-05-03から1日間の記事一覧

書籍 Ruby Cookbook | Extracting Data from a Document's Tree Structure

パンくず Ruby Cookbook Extracting Data from a Document's Tree Structure 概要 Extracting Data from a Document's Tree Structure 内容 XMLを木構造のデータで取得するには REXMLのインスタンスをeach_elementで取得する。 サンプルコード # encoding: u…

書籍 Ruby Cookbook | Checking XML Well-Formedness

パンくず Ruby Cookbook Checking XML Well-Formedness 概要 Checking XML Well-Formedness 内容 XMLをパースすることでXMLの正当性を検証できる。 サンプルコード # encoding: utf-8 require 'rexml/document' VALID_HOGE_XML = %{ <hoge> <child_hoge>child_hoge</child_hoge> </hoge> } INVALID_…