Announcement

Collapse
No announcement yet.

How to parse a complexe XML file

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to parse a complexe XML file

    Could you please tell me How I can access for Definition and Price values using untangle, I got always errors messages like AttributeError: 'list' object has no attribute

    HTML Code:
    <Main>
    	<Description>
    		<LocationTable>
    			<Program fragmentId="7cc4" fragmentVersion="100" xml:lang="Eng">
    				<Program cr="tes2354502"/>
    				<ProgramURL>ee2531d018</ProgramURL>
    				<MetadataId>imi:da077aaa83bed59cd008644116924a3e</MetadataId>
    				<InstanceDescription>
    					<Genre href="metadata:" type="other">
    						<[B]Definition[/B] xml:lang="Eng">match.com:</Definition>
    					</Genre>
    					<Genre href="2010:profile" type="other">
    						<Definition xml:lang="Eng">MPEG</Definition>
    					</Genre>
    					<PurchaseList>
    						<PurchaseItem start="2016-09-05T19:00:33.253Z" end="2021-09-05T14:35:00Z">
    							<[B]Price[/B] currency="EUR">0</Price>
    							<Purchase>
    								<PurchaseType href=":availabilityWindow"/>
    							</Purchase>
    							<Purchase>
    								<PurchaseType href="productCrid">
    									<Definition>302c3918f</Definition>
    								</PurchaseType>
    							</Purchase>
    						</PurchaseItem>
    					</PurchaseList>
    					<AVAttributes>
    						<FileSize>200375852</FileSize>
    						<BitRate maximum="3750000">3750000</BitRate>
    						<AudioAttributes>
    							<MixType href="ioPresentationCS:2010:3">
    								<Name xml:lang="en">Stereo</Name>
    								<Definition xml:lang="en">Stereog</Definition>
    							</MixType>
    						</AudioAttributes>
    						<VideoAttributes>
    							<Coding href="urn:CS:2001">
    								<Name xml:lang="Eng">MPEG2-TS</Name>
    							</Coding>
    						</VideoAttributes>
    					</AVAttributes>
    					<MemberOf xsi:type="MemberOfType" cr="-8dde-f33302c3918f"/>
    					<OtherIdentifier type="Vod" organization="ntis" authority="tis">83c8-8dee2531d018</OtherIdentifier>
    					<OtherIdentifier type="PAID" organization="ntis" authority="eventis">match.com</OtherIdentifier>
    				</InstanceDescription>
    				<PublishedDuration>2M</Duration>
    				<StartOfAvailability>2016-09-05</StartOfAvailability>
    				<EndOfAvailability>2021-09-05</EndOfAvailability>
    			</Program>
    		</LocationTable>
    	</Description>
    <Main>

  • #2
    This has nothing to do with the Untangle product

    Are you maybe looking for this product instead:

    ?

    If so, try asking your question over on StackOverflow.com. Be sure to include the python code you've tried.
    Last edited by jcoehoorn; 11-15-2016, 10:18 AM.
    Five time Microsoft ASP.Net MVP managing a Lenovo RD330 / E5-2420 / 16GB with Untangle 16.5.2 to protect a 1Gbps fiber link for ~450 residential college students and associated staff and faculty

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎