Google Groups Home
Help | Sign in
xml-map
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Marcin Raczkowski  
View profile  
(1 user)  More options Jul 13 2007, 6:02 am
From: Marcin Raczkowski <swis...@mailx.expro.pl>
Date: Fri, 13 Jul 2007 19:02:14 +0900
Local: Fri, Jul 13 2007 6:02 am
Subject: [ANN] xml-map
Hello.

Thanks to my bas from softwarelab.eu (little advert)
I'm starting to release code that i wrote so far :)
for now there's little - or no- documentation but i'll be working on it

back to the topic:

xml-map is easy to use XML to ruby object library with rails-like models,
validators and more ^^, it uses vary fast libxml instead of slow and old
REXML, you need version 0.4 of libxml to work properly

you can grab it from svn from xml-map.rubyforge.org

What is done:
- Import valid XML
- autogenerate models
- some validators

what i'm working on:
- all validators from XmlSchema
- autogenerating models with validators from xsd

require 'rubygems'
require 'xml/libxml'

require '../lib/xml_models'

require 'pp'

============================================

> cat sample/sample.rb

tfile = ARGV.shift || "test.xml"
# auogenerate required models
xm=XmlMapper.new({:generate=>true, :file=> $stdout})

#load xml file
doc = XML::Document.file(tfile)
root_node = doc.root

# parase xml and create model instances
rn = xm.parse_xml(root_node)

pp rn

rn.content[0].content<<"dwa"

rn.save(out.xml)

============================================

> cat sample/test.xml

<?xml version="1.0"?>
<root>
  <simple>raz</simple>
  <Complicated param2="2" param1="string" param3="3">
    <simple>dwa</simple>
    <simple>trzy</simple>
  </Complicated>
</root>
============================================
ruby sample.rb
class RootNode < XmlNode
 end

class SimpleNode < XmlNode
 end

class ComplicatedNode < XmlNode
 end

#===== class generation ends here, you can copy above classes add
attr_accessors for desired attributes

#<RootNode:0xb7810364
 @content=
  [#<SimpleNode:0xb780fc20 @content=["raz"], @node_name="simple">,
   #<ComplicatedNode:0xb780f39c
    @content=
     [#<SimpleNode:0xb780eac8 @content=["dwa"], @node_name="simple">,
      #<SimpleNode:0xb780e640 @content=["trzy"], @node_name="simple">],
    @node_name="Complicated",
    @param1="string",
    @param2="2",
    @param3="3">],
 @node_name="root">

======================================

soon i'm going to provide more documentation and more compleate support for
xsd and validators, if anyone is interested in helping in this easy but time
consuming work, please let me know ^^

===================================
Marcin Raczkowski
---
Friends teach what you should know
Enemies Teach what you have to know


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Marcin Raczkowski  
View profile  
(1 user)  More options Jul 13 2007, 6:22 am
From: Marcin Raczkowski <swis...@mailx.expro.pl>
Date: Fri, 13 Jul 2007 19:22:57 +0900
Local: Fri, Jul 13 2007 6:22 am
Subject: Re: [ANN] xml-map
two more things:
- this module was tested on nearly 20mb XML file and worked fine, it made
syncing between database and xml piece of cake (i'm going to relase code that
made comparing between AR models and XmlModels so easy)

- it was NOT tested on strange xmls - so PLEASE send me everything you got,
strange xml's with CDATA, strange characters encodings etc if it's not
parased properly by this library

--
Marcin Raczkowski
---
Friends teach what you should know
Enemies Teach what you have to know


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark Gallop  
View profile  
(1 user)  More options Jul 13 2007, 6:53 am
From: Mark Gallop <mark.gal...@gmail.com>
Date: Fri, 13 Jul 2007 19:53:25 +0900
Local: Fri, Jul 13 2007 6:53 am
Subject: Re: [ANN] xml-map
Hi Marcin,

Marcin Raczkowski wrote:
> it made syncing between database and xml piece of cake (i'm going to relase code that
> made comparing between AR models and XmlModels so easy)

I am looking forward to this. I had just been looking at doing a project
which could use AR <-> xml.

Thanks for releasing!

Cheers,
Mark


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ed Howland  
View profile  
(1 user)  More options Aug 13 2007, 1:50 pm
From: "Ed Howland" <ed.howl...@gmail.com>
Date: Tue, 14 Aug 2007 02:50:42 +0900
Local: Mon, Aug 13 2007 1:50 pm
Subject: Re: [ANN] xml-map
Hi,

Where can one get xml-map from?

Thanks

Ed

On 7/13/07, Marcin Raczkowski <swis...@mailx.expro.pl> wrote:

--
Ed Howland
http://greenprogrammer.blogspot.com
"The information transmitted is intended only for the person or entity
to which it is addressed and may contain proprietary, confidential
and/or legally privileged material. Any review, retransmission,
dissemination or other use of, or taking of any action in reliance
upon, this information by persons or entities other than the intended
recipient is prohibited. If you received this in error, please contact
the sender and delete the material from all computers."

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Gregory Brown  
View profile  
(1 user)  More options Aug 13 2007, 2:09 pm
From: "Gregory Brown" <gregory.t.br...@gmail.com>
Date: Tue, 14 Aug 2007 03:09:46 +0900
Local: Mon, Aug 13 2007 2:09 pm
Subject: Re: [ANN] xml-map
On 8/13/07, Ed Howland <ed.howl...@gmail.com> wrote:

> Hi,

> Where can one get xml-map from?

You quoted it in your reply.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google