Xsd2ruby error.... base type definition not found

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/.

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 :slight_smile:

···

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

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

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#BugreportorFeaturerequest

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 :slight_smile:

Please please let me know when you find a bug of soap4r!
http://dev.ctor.org/soap4r/wiki#BugreportorFeaturerequest
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/scat.rb/ruby/ruby-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

···

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#BugreportorFeaturerequest

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 :slight_smile:

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

// NaHi

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

Hey all

Thanks for all your replys :slight_smile:

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 :slight_smile:

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"
  xmlns:xsi="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="tom@creo.com"/>
        <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/.

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

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

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

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

···

On Thursday 19 July 2007 11:24, Tim Perrett wrote:

Hey all

Thanks for all your replys :slight_smile:

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 :slight_smile:

Any help would be great

Cheers

Tim

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

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

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 :slight_smile:

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

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/\.

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 :slight_smile:

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/\.