The goal of XMLVM is to offer a flexible and extensible cross-compiler toolchain. Instead of cross-compiling on a source code level, XMLVM cross-compiles byte code instructions from Sun Microsystem's virtual machine and Microsoft's Common Language Runtime. The benefit of this approach is that byte code instructions are easier to cross-compile and the difficult parsing of a high-level programming l
Configure Java APIs (SAX, DOM, dom4j, XOM) using JAXP 1.3 to validate XML Documents with DTD and Schema(s). Many Java XML APIs provide mechanisms to validate XML documents, the JAXP API can be used for most of these XML APIs but subtle configuration differences exists. This article shows five ways of how to configure different Java APIs (including DOM, SAX, dom4j and XOM) using JAXP 1.3 for checki
Mohamed SanaullaFebruary 19th, 2011Last Updated: October 24th, 2012 This is a post originally published by Mohamed Sanaulla from Experiences Unlimited, our latest JCG partner. Mohamed explains how to use JAXB to generate XML from a given XSD. (NOTE: The original post has been slightly edited to improve readability) We can use JAXB to marshal the Java objects into XML using the given Schema and vic
XMLプログラミングでは、DOMやSAXといったAPIを使用すると単調なコードを繰り返し書くことになり生産性が上がらないものだ。本連載では開発者が“楽をする”ために役立つXML関連ツールを紹介していく。(編集局) 前回のJAXBに引き続き、XMLモデルからオブジェクトモデルへのマッピングを行う、データバインディングツールを紹介します。今回、取り上げるのはCastorです。 CastorはExolab Groupが開発したオープンソースのデータバインディングツールで、無償で利用できます。この分野では最もよく使われているツールといえるでしょう。また、CastorはXML-オブジェクト間のマッピングだけではなく、SQLやLDAPとオブジェクトのマッピングにも対応しています。今回の記事ではSQL/LADPは取り上げませんが、このようなところまでカバーしている多機能な点も人気の一因のようです。 現在
ソフトウエアがXML出力を作成する場合には、多くの根拠があります。XML文書は異なるアプリケーション間のデータ交換のために使われますし、webアプリケーションはわずかなXMLスニペットを使って(X)HTML出力を作成したりAJAXリクエストに答えたりします。XMLが生成されるところには多くの利用ケースがあるので、その出力は他のアプリケーションの部分と同様にテストされるべきなのです。 生成されたXMLをテストするには幾つかの方法があります。その各々が分離して使用される際のフローを持っています。 例えば、下記のようなことができます。 生成されたXMLがDTDに対して、またXMLスキーマや、或いは他の文法的代替物に対して正当であると確認することができます。残念なことに、このような文法はいつも文書中に存在するとは限りませんし、もしあったとしても、どのテストも出力の構造のみをテストするだけで、その内
For those of you who've got into it you'll know that test driven development is great. It gives you the confidence to change code safe in the knowledge that if something breaks you'll know about it. Except for those bits you don't know how to test. Until now XML has been one of them. Oh sure you can use "<stuff></stuff>".equals("<stuff></stuff>"); but is that really gonna work when some joker deci
XML Schemaがあるシンプルな構造のXMLデータは、JAXB(id:sunflat:20080430:p1)を使って簡単に読み書きできるけど、XML Schemaが無い場合や複雑に入り組んだXMLデータの場合は、XPathを使うと便利そう。 だた、XPathで、名前空間(namespace URI)のついた要素を検索するのが結構面倒っぽい。NamespaceContextインタフェースを実装したクラスを作れば良いみたいなんだけど。 とりあえず、NamespaceContextインタフェースを実装した以下のようなクラスを作って、 import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import javax.xml.XMLConstants; import javax.xml.n
ストリーミングで XML - StAX 第 3 の刺客? 今まで、Java で XML を扱うのには 3 種類の方法がありました。 DOM SAX JAXB JAXB はちょっと毛色が違うので、単に XML をパースするならば DOM か SAX です。 ところが、Java SE 6 では新たにもう 1 つパーサが追加されました。 それが今回紹介する Streaming API for XML、通称 StAX です。StAX は JCP の JSR-173 で策定されており、BEA がスペックリードになっています。 さて、この 3 つのパーサの違いというのは何なのでしょう。よく説明されるのが、 DOM - オブジェクトモデル SAX - プッシュモデル StAX - プルモデル というものです。 DOM がオブジェクトモデルというのはすぐに分かりますね。DOM ツリーとしてヒープに持つわけ
Welcome to the Hyperjaxb2, relational presistence extension of the JAXB RI. This is a project in the JWSDP subcommunity of the Java community on Web Services and XML at java.net. Overview Hyperjaxb provides a solution for the prevalent task of XML persistence which essentially lies in the following three operations: importing or saving the document; exporting or loading the document; querying for
またも、別の方法があるというコメントいただきました。(id:toolkit:20060719) transformer.setOutputProperty(javax.xml.transform.OutputKeys.INDENT, ”yes”); transformer.setOutputProperty(javax.xml.transform.OutputKeys.METHOD, ”xml”); transformer.setOutputPropert(org.apache.xml.serializer.OutputPropertiesFactory.S_KEY_INDENT_AMOUNT, ”2”); なので、記事を書いた責任上(?)検証してみます。 実は、最初にこれと似たような事を試しました。 でも、うまく行かなかったんですねぇ。 OutputKeys.INDENT , "yes"
Overview XINS is an open-source Web Services framework supporting HTTP protocols such as REST, SOAP, XML-RPC, JSON, JSON-RPC and more. From the specifications written in simple XML, XINS generates the Client API (.jar), the Java server code template (.war), the WSDL and the documentation of the specification in HTML (with the test forms) or in OpenDocument format. Examples can be included in the s
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く