Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

xml-pastor runtime error?

by sglai (Initiate)
on Mar 07, 2009 at 12:04 UTC ( [id://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::Pas +tor::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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2025-06-15 03:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.