in reply to Generate Perl Code from XML Schema?
<!-- W3C XML Schema --> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefa +ult="qualified" attributeFormDefault="unqualified"> <xs:element name="Product"> <xs:complexType> <xs:all> <xs:element name="Owners"> <xs:complexType> <xs:sequence> <xs:element name="FirstName" type="xs:string" /> <xs:element name="LastName" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element>
require AutoGeneratedCode; my $Product = new AutoGeneratedCode::Product->new('product.xml'); +# product.xml is an XML document that conforms to the Schema above $Product->Owners->FirstName('Mark'); $Product->Owners->LastName('Twain'); $Product->Write('modifiedproduct.xml'); # Writes it self to XML fi +le that conforms to Schema above
|
|---|