Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

XSD / Ruby Translator

License

LGPL-3.0, Unknown licenses found

Licenses found

LGPL-3.0
LICENSE
Unknown
COPYING
NotificationsYou must be signed in to change notification settings

movitto/RXSD

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copyright © 2010 Mohammed Morsi <movitto@yahoo.com>

RXSD is made available under the GNU LESSER GENERAL PUBLIC LICENSE as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

RXSD is a library that translates XSD XML Schema Definitions into Ruby Classes on the fly. It is able to read XSD resources and use them to define Ruby classes in memory or string class definitions to be written to the filesystem

RXSD implements a full XSD parser that not only defines the various xsd schema classes, parsing them out of a XSD file, but translates them into a meta-class heirarchy, for use in subsequent transformations. The builder interface can easily be extended to output any format one could want including classes in other languages (Python, C++, Java, etc), other XML formats, etc.

RXSD also parses XML conforming to a XSD schema, and instantiates objects corresponding to the XSD classes created. Furthermore, RXSD will work with existing class definitions resulting in a quick way to map XSD to Ruby constructs, letting you define the schema features that you need, and autogenerting handlers to the others.

To install rxsd simply run:

geminstallrxsd

Source code is available via:

git clone http://github.com/movitto/rxsd
require'lib/rxsd'xsd_uri ="file:///home/user/schema.xsd"xml_uri ="file:///home/user/data.xml"schema =RXSD::Parser.parse_xsd:uri=>xsd_uriputs"=======Classes======="classes =schema.to:ruby_classesputsclasses.collect{|cl|!cl.nil?? (cl.to_s+" < "+cl.superclass.to_s):""}.sort.join("\n")puts"=======Tags======="putsschema.tags.collect {|n,cb|n+": "+cb.to_s+": "+ (cb.nil??"ncb":cb.klass_name.to_s+"-"+cb.klass.to_s) }.sort.join("\n")puts"=======Objects======="data =RXSD::Parser.parse_xml:uri=>xml_uriobjs =data.to:ruby_objects,:schema=>schemaobjs.each {|obj|puts"#{obj}"}

About

XSD / Ruby Translator

Resources

License

LGPL-3.0, Unknown licenses found

Licenses found

LGPL-3.0
LICENSE
Unknown
COPYING

Stars

Watchers

Forks

Packages

No packages published

Contributors5

Languages


[8]ページ先頭

©2009-2026 Movatter.jp