SOAP-Lite

 view release on metacpan or  search on metacpan

examples/XML/customxml.pl  view on Meta::CPAN

#!perl -w
#!d:\perl\bin\perl.exe

# -- SOAP::Lite -- soaplite.com -- Copyright (C) 2001 Paul Kulchenko --

use SOAP::Lite;

my $d = SOAP::Custom::XML::Deserializer
  -> deserialize(join '', <DATA>)
  -> valueof('/Envelope/Body');

foreach my $portfolio ($d->Report->Request->Composition->PortfolioDistribution) {
  print $portfolio->type, " ", $portfolio->date, "\n";
  foreach my $row ($portfolio->Row) {
    print "  ", $row->Element, " ", $row->Value, "\n";
  }
}

__DATA__
<?xml version="1.0" encoding="UTF-8"?>
<Envelope version="1.1">
  <Header />
  <Body>
    <Report>
      <Header>
        <ClientRef />
        <FundCusip>61744J366</FundCusip>
        <SepAcctDesc />
      </Header>
      <Request>
        <Errors>
          <Error>Returned no data for request: PortfolioDistribution</Error>
          <Error>Returned no data for request: PortfolioDistribution</Error>
          <Error>Returned no data for request: PortfolioDistribution</Error>
          <Error>Returned no data for request: PortfolioDistribution</Error>
          <Error>Could not retrieve PortfolioDistribution</Error>
          <Error>Could not retrieve PortfolioDistribution</Error>
          <Error>Could not retrieve PortfolioDistribution</Error>
          <Error>Could not retrieve PortfolioDistribution</Error>
        </Errors>
        <Composition>
          <PortfolioDistribution type="CE" date="09/30/2000" />
          <PortfolioDistribution type="GB" date="09/30/2000" />
          <PortfolioDistribution type="ST" date="09/30/2000">
            <Row>
              <Element>Common Stocks</Element>
              <Value>0.9991</Value>
            </Row>
            <Row>
              <Element>Other</Element>
              <Value>0.0021</Value>
            </Row>
            <Row>
              <Element>Cash &amp; Cash Equivalents</Element>
              <Value>-0.0012</Value>
            </Row>
          </PortfolioDistribution>
          <PortfolioDistribution type="TT" date="09/30/2000">
            <Row>
              <Element>General Electric Company</Element>
              <Value>0.0458</Value>
            </Row>
            <Row>
              <Element>Cisco Systems Inc</Element>
              <Value>0.033</Value>
            </Row>
            <Row>
              <Element>Microsoft Corporation</Element>
              <Value>0.0263</Value>
            </Row>
            <Row>
              <Element>Exxon Mobil Corp.</Element>
              <Value>0.0263</Value>
            </Row>
            <Row>
              <Element>Pfizer, Inc.</Element>
              <Value>0.0231</Value>
            </Row>
            <Row>
              <Element>Intel Corporation</Element>

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.836 second using v1.00-cache-2.02-grep-82fe00e-cpan-cec75d87357c )