|
NAMEXML::Pastor::Schema::Parser - Module for parsing a W3C XSD schema into an internal schema model.WARNINGThis module is used internally by XML::Pastor. You do not normally know much about this module to actually use XML::Pastor. It is documented here for completeness and for XML::Pastor developers. Do not count on the interface of this module. It may change in any of the subsequent releases. You have been warned.ISAThis class descends from Class::Accessor.DESCRIPTIONXML::Pastor::Schema::Parse is used internally by XML::Pastor for parsing a W3C schema into an internal schema model (XML::Pastor::Schema::Model).The parsing is done with the "parse()" method. The schema is not parsed directly. Instead, XML::LibXML is used to first parse the schema into a DOM tree (since the W3C schema is itself represented in XML). Then, the DOM tree hence obtained is traversed recursively in order to construct the schema model which is somewhat like a parse-tree. For more information on the schema model produced, please refer to XML::Pastor::Schema::Model. METHODSCONSTRUCTORSnew()XML::Pastor::Schema::Parser->new(%fields) CONSTRUCTOR. The new() constructor method instantiates a new object. It is inheritable. Any -named- fields that are passed as parameters are initialized to those values within the newly created object. The new() method will create a model and a contextStack if it is not passed values for those fields. . ACCESSORScontextStack()A stack (of type XML::Pastor::Stack) that keeps track of the current context. Every time a new schema is opened for parsing (as a result of include or redefine statements), a new context is pushed on the stack. Each context is of type XML::Pastor::Schema::Context. Basically, the context keeps track of the DOM nodes that are being processed before they are inserted into the model. counter() A simple integer counter that keeps track of the count that is attributed to implicit nodes (typically simple types) that need to be named. Whenever such a node needs to be named, the counter is used to generate a unique name before being incremented. model() The schema model (of type XML::Pastor::Schema::Model) that is currently being constructed. The model is the result of the parsing operation and it is the internal reprsentation (information set) of a series of schemas that are related to each other (via includes or similar means). OTHER METHODSparse()$model = $parser->parse(%options); OBJECT METHOD. This method accomplishes the major role of this module. Namely, it parses a W3C XSD schema into an internal structure called a schema model. Example: my $parser = XML::Pastor::Schema::Parser->new(); my $model = $parser->parse(schema=>'/tmp/schemas/country.xsd'); The W3C schema, which is in XML itself, is not parsed directly. Instead, it is parsed first into a DOM tree with the help of XML::LibXML. Then, a recursive algorithm is used for constructing a schema model which is an internal structure. For more information on the schema model produced, please refer to XML::Pastor::Schema::Model. OPTIONS
. BUGS & CAVEATSThere no known bugs at this time, but this doesn't mean there are aren't any. Note that, although some testing was done prior to releasing the module, this should still be considered alpha code. So use it at your own risk.Note that there may be other bugs or limitations that the author is not aware of. AUTHORAyhan Ulusoy <dev(at)ulusoy(dot)name>COPYRIGHTCopyright (C) 2006-2007 Ayhan Ulusoy. All Rights Reserved. This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSOSee also XML::Pastor, XML::Pastor::ComplexType, XML::Pastor::SimpleTypeAnd if you are curious about the implementation, see XML::Pastor::Schema::Model, XML::Pastor:Generator
Visit the GSP FreeBSD Man Page Interface. |