Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > xsd2ruby error.... base type definition not found

Reply
Thread Tools

xsd2ruby error.... base type definition not found

 
 
Tim Perrett
Guest
Posts: n/a
 
      07-17-2007
Hey guys

Has anyone had any experience working with xsd2ruby? I am getting the
following error and there seems to be little or no documentation on what
the devil it means!

I, [2007-07-17T16:07:27.445714 #1264] INFO -- app: Creates file
'v_3.rb'.
F, [2007-07-17T16:07:27.453521 #1264] FATAL -- app: Detected an
exception. Stopping ... base type definition not found:
{http://www.cip4.org/Schema/JDFSchema_1_3}BaseElement_ (RuntimeError)

Cheers for any help in advance

Tim

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
 
Marcin Raczkowski
Guest
Posts: n/a
 
      07-18-2007
On Tuesday 17 July 2007 15:45, Tim Perrett wrote:
> Hey guys
>
> Has anyone had any experience working with xsd2ruby? I am getting the
> following error and there seems to be little or no documentation on what
> the devil it means!
>
> I, [2007-07-17T16:07:27.445714 #1264] INFO -- app: Creates file
> 'v_3.rb'.
> F, [2007-07-17T16:07:27.453521 #1264] FATAL -- app: Detected an
> exception. Stopping ... base type definition not found:
> {http://www.cip4.org/Schema/JDFSchema_1_3}BaseElement_ (RuntimeError)
>
> Cheers for any help in advance
>
> Tim


xsd2ruby is still beta (if not alfa) and have lots of errors, I tried working
with it and it failed me few times,
I'm working on diffirent solution to generate classes from xsd but i'm not
sure when it'll be availble

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

 
Reply With Quote
 
 
 
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      07-18-2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Tim, the message says that the referred 'BaseElement_' definition is not
found in schema files. I've found the schema at
http://www.cip4.org/Schema/JDFSchema_1_3/JDF.xsd and tried to generate
the class file with xsd2ruby.rb but timeout occurred while getting
schema files. Network problem? I'll try again later.

And please try the newest xsd2ruby.rb in soap4r-1.5.7. Let me know if
it won't work.
http://dev.ctor.org/soap4r/wiki#a2007-07-16:1.5.7
http://dev.ctor.org/soap4r/wiki#Bugr...Featurerequest

Marcin Raczkowski wrote:
> xsd2ruby is still beta (if not alfa) and have lots of errors, I tried working
> with it and it failed me few times,
> I'm working on diffirent solution to generate classes from xsd but i'm not
> sure when it'll be availble


Please please let me know when you find a bug of soap4r!
http://dev.ctor.org/soap4r/wiki#Bugr...Featurerequest
Beside this, I'm very looking forward to your xsd implementation.

// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRp3Wwx9L2jg5EEGlAQKSVgf/ZEbE4mRid3y+EbkLfXXBuaTaOTNG7773
LKBWuXT3f1o1hi8+4SdhKaqqSeI0fR+VkzcM8dm65u7Gce89kW u/8hd/p6XP9jQX
1wJdcYVQ6Q4hLp9gea/fWDG/y7E05MpWuLobGRZxc5Q7iWcab4Y5AINP+PVZSXb/
/EZMbzVqX2ZuU/i61apLLRBgwyJtAZqdsI+Pb8guANmY2bIJA0MSTkPkzrxf8uQA
kCwrFfj3cLEV7KQkgbL67M4+cMhrgL10j96wr9wqwpJLDc2ky8 fIRfmiX+5fKVZK
ipTJMRqn4ZSLOyAoADfB3oUGIni6ZPV9UfACm9Qdmff4cBZOwl FFkw==
=MGEl
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Marcin Raczkowski
Guest
Posts: n/a
 
      07-18-2007
On Wednesday 18 July 2007 09:01, NAKAMURA, Hiroshi wrote:
> Hi,
>
> Tim, the message says that the referred 'BaseElement_' definition is not
> found in schema files. I've found the schema at
> http://www.cip4.org/Schema/JDFSchema_1_3/JDF.xsd and tried to generate
> the class file with xsd2ruby.rb but timeout occurred while getting
> schema files. Network problem? I'll try again later.
>
> And please try the newest xsd2ruby.rb in soap4r-1.5.7. Let me know if
> it won't work.
> http://dev.ctor.org/soap4r/wiki#a2007-07-16:1.5.7
> http://dev.ctor.org/soap4r/wiki#Bugr...Featurerequest
>
> Marcin Raczkowski wrote:
> > xsd2ruby is still beta (if not alfa) and have lots of errors, I tried
> > working with it and it failed me few times,
> > I'm working on diffirent solution to generate classes from xsd but i'm
> > not sure when it'll be availble

>
> Please please let me know when you find a bug of soap4r!
> http://dev.ctor.org/soap4r/wiki#Bugr...Featurerequest
> Beside this, I'm very looking forward to your xsd implementation.
>
> // NaHi


i sent you 2 bug reports - one in wsdl2ruby and one in soap4r i never recived
any feedback - i also started thread here, and posted my bug fixes to one of
the problems, i'm still working on another one, but mayby it was already
fixed in latest release.

here's problem and solution :
file in question was "/soap/mapping/wsdlliteralregistry.rb" there might be
similar problem in /soap/mapping/wsdlencodedregistry.rb

http://blade.nagaokaut.ac.jp/cgi-bin...by-talk/258411


anyway my xml to ruby objects mapping library is out for testing - it's based
on libxml so it's fast, now i'm

right now it can generate classes from xml files
I'm working on generating classes from xsd with validators



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

 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      07-18-2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Marcin,

Marcin Raczkowski wrote:
>> Please please let me know when you find a bug of soap4r!


> i sent you 2 bug reports - one in wsdl2ruby and one in soap4r i never recived
> any feedback - i also started thread here, and posted my bug fixes to one of
> the problems, i'm still working on another one, but mayby it was already
> fixed in latest release.


Oops. Sorry for that. I should have remembered it. I certainly read
the post [ruby-talk:258411] but after I confirmed that the posted patch
was referring to an old version of soap4r (1.5.5?), I slipped to reply it.

Yes, the latest soap4r version is 1.5.7 and it must fix the problem you
wrote. Please let me know it isn't.

// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iQEVAwUBRp3kvB9L2jg5EEGlAQJ2owgAq1PRYZRBOccFsy5zOx lcH3UJV/CQtf14
6sSY4S10NU4N5XBcVDEbaJW5OKqwsvlLOcE4vsVybQqWP1wPDW Eq0jZa38KpaWPv
jveag75vndm4gWB1qySpb1tMbtkNLvaSSuH2Fu7okrcIzU3wVN +FK6QU9blpPbTV
qypbrlcRQS7JjEwgOt2AV21afV1HI8ktcKj78/XeXj6TRyRpWenrsqtE0Yy2SGFv
XmKr6Uy3U3sxIKpuXv8vKNa4Dw5znw9igN0gi9BMRTY0lqtrUm NeqTunqfIxvYRz
wHEfnZoEHjrDDuzRI1Qx71jMx78mchU4FJp5eWeWv+yu9oWDg/oMng==
=oizX
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Tim Perrett
Guest
Posts: n/a
 
      07-19-2007
Hey all

Thanks for all your replys

I have tried it with soap4r 1.5.7 but still no joy im afraid. The schema
I am needing to use is at
http://www.cip4.org/Schema/JDFSchema_1_3_20070212.zip - its an open
standard used in the printing industry. However, when I take that schema
and validate it, it all appears to be fine (as you would expect being an
industry standard)

When I then look to validate the following xml (at bottom of post)
against the JDF schema it fails in rather spectacular fashion (using
libxml) - the error using XML Nanny is "JDF.xsd has a different target
namespace from the one specified in the instance document ." However I
have checked them and they appear to be the same!!

Also, Marcin, when will your XSD class gens be available? I would be
really interested in seeing those

Any help would be great

Cheers

Tim

<?xml version="1.0"?>
<JDF
Activation="Active"
DescriptiveName="Digital Printing example"
ID="C20031030J54321"
JobID="n070719_12414459_000431"
JobPartID="n070719_12414459_000430"
MaxVersion="1.3"
Status="Ready"
Type="Combined"
Types="LayoutPreparation Interpreting Rendering DigitalPrinting"
Version="1.3"
xmlns="http://www.CIP4.org/JDFSchema_1_1"
xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.CIP4.org/JDFSchema_1_1 JDF.xsd">
<ResourceLinkPool>
<RunListLink CombinedProcessIndex="0 1 2 3" ProcessUsage="Document"
Usage="Input" rRef="rl001">
<Part RunIndex="0 ~ -1"/>
</RunListLink>
<LayoutPreparationParamsLink CombinedProcessIndex="0" Usage="Input"
rRef="lpp01"/>
<InterpretingParamsLink CombinedProcessIndex="1" Usage="Input"
rRef="ip001"/>
<RenderingParamsLink CombinedProcessIndex="2" Usage="Input"
rRef="ren001"/>
<ComponentLink Amount="1" CombinedProcessIndex="4" Usage="Output"
rRef="c0001"/>
<MediaLink CombinedProcessIndex="0 3" Usage="Input" rRef="m0001"/>
<MediaLink CombinedProcessIndex="0 3" Usage="Input" rRef="m0002"/>
<DigitalPrintingParamsLink CombinedProcessIndex="3" Usage="Input"
rRef="dpp01"/>
<CustomerInfoLink CombinedProcessIndex="0 1 2 3" Usage="Input"
rRef="r070719_12414458_000428"/>
<NodeInfoLink CombinedProcessIndex="0 1 2 3" Usage="Input"
rRef="r070719_12414459_000429"/>
</ResourceLinkPool>
<ResourcePool>
<Component AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD
40" Class="Quantity" ComponentType="FinalProduct"
DescriptiveName="Digital Printing Output" ID="c0001"
Status="Unavailable"/>
<RunList AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD 40"
Class="Parameter" ID="rl001" PartIDKeys="Run" Status="Available">
<LayoutElement>
<FileSpec MimeType="application/pdf"
URL="file:///c:/Golfer_A4.pdf"/>
</LayoutElement>
<RunList Pages="6" Run="1">
<InsertSheet IsWaste="false" SheetType="InsertSheet"
SheetUsage="Trailer">
<RunList PageCopies="1"/>
<Sheet>
<MediaRef rRef="m0001"/>
</Sheet>
</InsertSheet>
</RunList>
</RunList>
<Media AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD 40"
BackCoatings="None" Class="Consumable" Dimension="1190 842"
FrontCoatings="None" ID="m0001" MediaType="Paper" Status="Available"
Weight="100">
<Location LocationName="AutoSelect"/>
</Media>
<Media AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD 40"
BackCoatings="None" Class="Consumable" Dimension="842 595"
FrontCoatings="None" ID="m0002" MediaType="Paper" Status="Available"
Weight="100">
<Location LocationName="AutoSelect"/>
</Media>
<RenderingParams AgentName="CIP4 JDF Writer Java" AgentVersion="1.3
BLD 40" Class="Parameter" ID="ren001" Status="Available">
<!-- <AutomatedOverprintParams OverPrintBlackText="true"/> -->
</RenderingParams>
<InterpretingParams AgentName="CIP4 JDF Writer Java"
AgentVersion="1.3 BLD 40" Class="Parameter" ID="ip001"
Status="Available">
<ObjectResolution AntiAliasing="AntiAlias" Resolution="200 200"/>
</InterpretingParams>
<DigitalPrintingParams AgentName="CIP4 JDF Writer Java"
AgentVersion="1.3 BLD 40" Class="Parameter" Collate="None" ID="dpp01"
OutputBin="Top" PageDelivery="ReverseOrderFaceUp" PartIDKeys="RunIndex"
Status="Available">
<MediaRef rRef="m0002"/>
<DigitalPrintingParams RunIndex="3 ~ 5">
<MediaRef rRef="m0001"/>
</DigitalPrintingParams>
<DigitalPrintingParams Collate="None" OutputBin="Top"
PageDelivery="ReverseOrderFaceUp" RunIndex="6">
<MediaRef rRef="m0002"/>
</DigitalPrintingParams>
</DigitalPrintingParams>
<LayoutPreparationParams AgentName="CIP4 JDF Writer Java"
AgentVersion="1.3 BLD 40" Class="Parameter" ID="lpp01"
PartIDKeys="RunIndex" Rotate="Rotate0" Sides="OneSidedFront"
Status="Available">
<FitPolicy SizePolicy="FitToPage"/><!-- RotatePolicy="Rotate0" -->
<ImageShift ShiftBack="0 0" ShiftFront="0 0"/>
<!-- Sides and Media for front cover -->
<LayoutPreparationParams Rotate="Rotate0" RunIndex="0 ~ 1"
Sides="OneSidedFront">
<MediaRef rRef="m0001"/>
</LayoutPreparationParams>
<!-- Sides and Media for document body -->
<LayoutPreparationParams RunIndex="3 ~ 5" Sides="OneSidedFront">
<MediaRef rRef="m0001"/>
</LayoutPreparationParams>
<!-- Sides and Media for back cover -->
<LayoutPreparationParams RunIndex="7 ~ 8" Sides="OneSidedFront">
<MediaRef rRef="m0001"/>
</LayoutPreparationParams>
</LayoutPreparationParams>
<CustomerInfo AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD
40" BillingCode="BC-78901" Class="Parameter" CustomerID="Creo-1234"
CustomerJobName="A Test Job" DescriptiveName="A test job"
ID="r070719_12414458_000428" PartUsage="Implicit" Status="Available">
<Contact ContactTypes="Technical">
<Address City="Hertzliya" Country="Israel" CountryCode="IL"
PostalCode="69345" Street="1340 Maskit street"/>
<Company OrganizationName="Creo Inc."/>
<Person FamilyName="Draft" FirstName="Thomas" NamePrefix="Mr."/>
<ComChannel ChannelType="Email" Locator="(E-Mail Removed)"/>
<ComChannel ChannelType="Phone" Locator="+972-9-678-8900"/>
</Contact>
</CustomerInfo>
<NodeInfo AgentName="CIP4 JDF Writer Java" AgentVersion="1.3 BLD 40"
Class="Parameter" ID="r070719_12414459_000429" PartUsage="Implicit"
Status="Available" TargetRoute="file:///d:/OutJDFFiles/"/>
</ResourcePool>
<AuditPool>
<Modified Author="FixJDF Web Service Build: CIP4 JDF Writer Java 1.3
BLD 40" DescriptiveName="update to version 1.3"
ID="a070719_12414464_000432" TimeStamp="2007-07-19T12:41:44+02:00"/>
</AuditPool>
</JDF>


--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
Marcin Raczkowski
Guest
Posts: n/a
 
      07-19-2007
On Thursday 19 July 2007 11:24, Tim Perrett wrote:
> Hey all
>
> Thanks for all your replys
>
> I have tried it with soap4r 1.5.7 but still no joy im afraid. The schema
> I am needing to use is at
> http://www.cip4.org/Schema/JDFSchema_1_3_20070212.zip - its an open
> standard used in the printing industry. However, when I take that schema
> and validate it, it all appears to be fine (as you would expect being an
> industry standard)
>
> When I then look to validate the following xml (at bottom of post)
> against the JDF schema it fails in rather spectacular fashion (using
> libxml) - the error using XML Nanny is "JDF.xsd has a different target
> namespace from the one specified in the instance document ." However I
> have checked them and they appear to be the same!!
>
> Also, Marcin, when will your XSD class gens be available? I would be
> really interested in seeing those
>
> Any help would be great
>
> Cheers
>
> Tim
>


unfortunatelly implementing whole schema is boring and boring and long and
long and di si say ****ing boring job?

I'm working on it, but probably not sooner then 2 weeks from now becouse i'm
going rafting for 10 days

i can commit everything i done tho, and mayby you can take a look and suggest
someting (i'll try to test it against your schema too)

cheers

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

 
Reply With Quote
 
Tim Perrett
Guest
Posts: n/a
 
      07-19-2007
> unfortunatelly implementing whole schema is boring and boring and long
> and long and di si say f***ing boring job?


LOL - i would imagine it is


> I'm working on it, but probably not sooner then 2 weeks from now becouse
> i'm going rafting for 10 days


Very nice - have a good time!

> i can commit everything i done tho, and mayby you can take a look and
> suggest someting (i'll try to test it against your schema too)


That would be brilliant if you could - i could take a look at it then
while your away rafting....
Whats the SVN url?

Cheers

Tim

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      07-19-2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Tim Perrett wrote:
> I have tried it with soap4r 1.5.7 but still no joy im afraid. The schema
> I am needing to use is at
> http://www.cip4.org/Schema/JDFSchema_1_3_20070212.zip - its an open
> standard used in the printing industry.


Thanks! I found that soap4r-1.5.7 fails to cyclic schema inclusion. I
filed a ticket here: http://dev.ctor.org/soap4r/ticket/385 and fixed it.
Now the following command should run through the schema with many warnings.

xsd2ruby.rb --xsd JDF.xsd --classdef --mapping_registry --mapper
- --module_path JDF --force

Anyway, you seem to need XSD validation but xsd2ruby.rb is for
XML <-> Ruby object mapping so it won't help you. After the above
command invoked, the following script can be used to convert an XML into
Ruby object.

require 'v_1_mapper'
xml = File.read("sample.xml") # loads the sample XML you posted
mapper = JDF::V_1Mapper.new
p mapper.xml2obj(xml)

// NaHi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRp+BFh9L2jg5EEGlAQIvfwf9EIIHeNSxQthMlA8wRK osgVrCH7i1+jaC
hG+9wij9DwSpUKkgjx4bVEa5t1ufqs8wNi0rYhUGTScea7iEM8 8Mbn3HV6q96cgl
QfVO6oyHKwXJyHnX13gFhhlN1qvd9NtW1Cf3dK4Zfgjrk7S9al/xlcE3Au23QTtK
bBSFlKlfUIXUJnqNEzja00ASP7DBoeVPZbeZFHHuNFgT2xwViC JyWvK4ADTir2V/
Jy4FmYEXZtpyagn/4rp3yap7IyjzRu3jUwZNSGF7JWwtCmTnnU1Uhdk8jMnELrwf
n/kOrx/+0jGckaWJI+9v6vFOpJxIPt8bjSu0RFSNxC3AIhRhl3YSdQ==
=asQS
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Tim Perrett
Guest
Posts: n/a
 
      07-23-2007
Hey!

I did want to map my xml to ruby objects, as I will need to construct
new messages and things, so wanted some programatic way of doing this
without having to manually code all the classes.

This might be a stupid question, but am i barking up the wrong tree here
if I wanted to programatically construct xml messages to then post out -
I have worked with your soap4 r lib before and thats effectively whats
happening isnt it when you call your specific soap service classes?

My XSD schema wont give me all the class information as wsdl tho will
it? Appologies for the stupid question but I have done very very little
with XSD in the past

Cheers

Tim


> Thanks! I found that soap4r-1.5.7 fails to cyclic schema inclusion. I
> filed a ticket here: http://dev.ctor.org/soap4r/ticket/385 and fixed it.
> Now the following command should run through the schema with many
> warnings.
>
> xsd2ruby.rb --xsd JDF.xsd --classdef --mapping_registry --mapper
> - --module_path JDF --force
>
> Anyway, you seem to need XSD validation but xsd2ruby.rb is for
> XML <-> Ruby object mapping so it won't help you. After the above
> command invoked, the following script can be used to convert an XML into
> Ruby object.
>
> require 'v_1_mapper'
> xml = File.read("sample.xml") # loads the sample XML you posted
> mapper = JDF::V_1Mapper.new
> p mapper.xml2obj(xml)

--
Posted via http://www.ruby-forum.com/.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
base class public type (non template and template base class) Hicham Mouline C++ 1 04-20-2009 03:28 PM
Microsoft Services: Element id cannot be found in type definition redryderridesagain@gmail.com ASP .Net Web Services 0 11-08-2008 07:26 PM
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
type 'slice' is not an acceptable base type Antoon Pardon Python 2 12-21-2005 09:36 AM
xsd2ruby aoco Ruby 0 08-26-2005 04:41 PM



Advertisments