RE: wheres the API
Declan Shanaghy <[email protected]> Mon, 19 Jan 2004 15:32:07 -0800 (PST)
| Newsgroups | gmane.comp.web.zope.parsed-xml |
|---|---|
| Message-ID | <[email protected]> |
Thanks for the help getting started.
Now unless im understanding the DOM incorrectly the following code
should work but getElementsByTagName is throwing an exception.
I also tried getElementById("Express"), getElementById("Priority") and
it returned None in both cases
Traceback:
* Line 19
* Module Products.ParsedXML.ParsedXML, line 252, in
getElementsByTagName
AttributeError: __getattr__
Python Code line 19
packagesElem = rateRequestObj.getElementsByTagName("Package")
ParsedXML object:
<RateRequest USERID="xxx" PASSWORD="xxx">
<Package ID="Express">
<Service>Express</Service>
<ZipOrigination>xxxxx</ZipOrigination>
<ZipDestination>xxxxx</ZipDestination>
<Pounds>0</Pounds>
<Ounces>0</Ounces>
<Container>None</Container>
<Size>Regular</Size>
<Machinable>False</Machinable>
</Package>
<Package ID="Priority">
...
</Package>
</RateRequest>
--- [email protected] wrote:
> The API is W3C DOM level 2; just get the nodes using
> getElementsByTagName()
> (returns a DOM nodelist, which you would then traverse, do with what
> you
> need).
>
> Use the DOM level 2 API reference on w3.org or use the appendix to
> the book
> Python and XML.
>
> Sean
>
> > -----Original Message-----
> > From: Declan Shanaghy [mailto:[email protected]]
> > Sent: Monday, January 19, 2004 11:20 AM
> > To: [email protected]
> > Subject: [Parsed-XML-Dev] wheres the API
> >
> > I just downloaded ParsedXML but cant find the API anywhere on
> > zope.org or even with a google search.
> >
> > I need to know how to search for a particular tag within the xml.
> >
> >
> > Dek
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! SiteBuilder - Free, easy-to-use web site design
> > software http://sitebuilder.yahoo.com
> >
> > _______________________________________________
> > Parsed-XML-Dev mailing list
> > [email protected]
> > http://mail.python.org/mailman/listinfo/parsed-xml-dev
> >
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com