Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

xml-pastor runtime error?

by sglai (Initiate)
on Mar 07, 2009 at 12:04 UTC ( #749040=perlquestion: print w/replies, xml ) Need Help??
sglai has asked for the wisdom of the Perl Monks concerning the following question:

Need help on this? I am running this on Win32. Thanks.

use XML::Pastor;
$pastor = XML::Pastor->new();
$pastor->generate( mode =>'offline', style => 'multiple', schema=>'my.xsd', class_prefix=>'MyApp::Data', destination=>'.');

Can't locate object method "effectiveAttributes" via package "XML::Pastor::Schema::SimpleType" at...

Replies are listed 'Best First'.
Re: xml-pastor runtime error?
by ramrod (Curate) on Mar 07, 2009 at 16:34 UTC
    It seems to me that something's worng with your schema. I used one of the examples from the w3schools website, and the your code executed with no errors. Here's the sample xsd I used:
    <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3schools.com" xmlns="http://www.w3schools.com" elementFormDefault="qualified"><xs:element name="note"> <xs:complexType> <xs:sequence> <xs:element name="to" type="xs:string"/> <xs:element name="from" type="xs:string"/> <xs:element name="heading" type="xs:string"/> <xs:element name="body" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element></xs:schema>
    Provide some info towards what you need your data to look like for better help.
Re: xml-pastor runtime error?
by kennethk (Abbot) on Mar 07, 2009 at 15:41 UTC

    Please read Writeup Formatting Tips, especially the section on <code> tags.

    Are you certain your .xsd is valid? Can you post it so we can replicate the issue? There are no bug reports on this issue registered with CPAN.

Re: xml-pastor runtime error?
by Anonymous Monk on Jun 09, 2009 at 15:33 UTC
    I experienced similar errors in two situations: (1) When you have multiple inheritance (your XSD elements are of extended type, where your class needs to have 'SimpleType' as well as your type in @ISA array, but Pastor adds only one). (2) When your XSD does not specify 'type' for any leaf elements (your generated code shows 'class' => undef). Check for these two situations. -Bhaskar

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://749040]
Approved by moritz
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2016-10-01 22:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?






    Results (8 votes). Check out past polls.