thickice97 has asked for the wisdom of the Perl Monks concerning the following question:
This is my XML file. I need to parse this data and output it in this format<xs:complexType name="semt.002.001.01"> <xs:sequence> <xs:element name="PrvsRef" type="AdditionalReference2" minOccurs="0" m +axOccurs="unbounded"/> <xs:element name="RltdRef" type="AdditionalReference2" minOccurs="0" m +axOccurs="unbounded"/> <xs:element name="MsgPgntn" type="Pagination"/> <xs:element name="StmtGnlDtls" type="Statement3"/> <xs:element name="AcctDtls" type="SafekeepingAccount1"/> <xs:element name="BalForAcct" type="AggregateBalanceInformation1" minO +ccurs="0" maxOccurs="unbounded"/> <xs:element name="SubAcctDtls" type="SubAccountIdentification1" minOcc +urs="0" maxOccurs="unbounded"/> <xs:element name="TtlVals" type="TotalValueInPageAndStatement" minOccu +rs="0" maxOccurs="1"/> <xs:element name="Xtnsn" type="Extension1" minOccurs="0" maxOccurs="un +bounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="AdditionalReference2"> <xs:sequence> <xs:element name="Ref" type="Max35Text"/> <xs:element name="RefIssr" type="PartyIdentification1Choice" minOccurs +="0" maxOccurs="1"/> <xs:element name="MsgNm" type="Max35Text" minOccurs="0" maxOccurs="1"/ +> </xs:sequence> </xs:complexType> <xs:complexType name="PartyIdentification1Choice"> <xs:sequence> <xs:choice> <xs:element name="BICOrBEI" type="AnyBICIdentifier"/> <xs:element name="PrtryId" type="GenericIdentification1"/> <xs:element name="NmAndAdr" type="NameAndAddress2"/> </xs:choice> </xs:sequence> </xs:complexType> <xs:complexType name="GenericIdentification1"> <xs:sequence> <xs:element name="Id" type="Max35Text"/> <xs:element name="SchmeNm" type="Max35Text" minOccurs="0" maxOccurs="1 +"/> <xs:element name="Issr" type="Max35Text" minOccurs="0" maxOccurs="1"/> </xs:sequence> </xs:complexType>
I tried using XML::Simple but it is SAX parser. But it wont give the output this format. What Perl module could I use for this approach and how like an example would be helpful. Please advise.semt.002.001.01 semt.002.001.01.PrvsRef semt.002.001.01.PrvsRef.Ref semt.002.001.01 semt.002.001.01.PrvsRef semt.002.001.01.PrvsRef.RefIssr semt.002.001.01.PrvsRef.RefIssr.BICOrBEI
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl parsing xml
by GrandFather (Saint) on Jan 22, 2008 at 23:49 UTC | |
by thickice97 (Initiate) on Jan 23, 2008 at 02:53 UTC | |
by GrandFather (Saint) on Jan 23, 2008 at 03:26 UTC | |
by thickice97 (Initiate) on Jan 23, 2008 at 04:41 UTC | |
by GrandFather (Saint) on Jan 23, 2008 at 06:54 UTC | |
|