• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdom and jaxen question

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using jdom (to parse xml) and jaxen for using xpath expressions to query my xml file.

So if i have for example a complex conditional to bring back the order element:
Where JusticelinkOrderType attribute is CRMORD0455 or CRMORD0102 and
ConcurrentCumulativeType attribute is not Cumulative and
NoOfHours attribute is null or 0


[sample xml message at the end]
java code:


Is this a good standard of coding for bringing back my expected result or not? I am just wondering every time i create a new instance of xpath to query the jdom object model will this reduce the efficiency of my application?

Thanks,
Shane.


<Offence ProceedingType="PT CRM CMT 0001">
<Defendant PartyRole="ACCUSED">
<Person InCustody="false">
<Name>
<GivenName>NERIDA</GivenName>
<FamilyName>INTERFACES-SK</FamilyName>
<FullName>INTERFACES-SK, NERIDA</FullName>
</Name>
<Address>
<ContactAddress EndDate="9999-12-31+11:00" EndTime="00:00:00.000+11:00" StartDate="2009-01-27+11:00" StartTime="00:00:00.000+11:00">
<Road Name="TEST" Number1="87" TypeCode="DR"/>
<LocalityName>BURWOOD</LocalityName>
<StateOrTerritory>NSW</StateOrTerritory>
<PostCode>2134</PostCode>
<Address_Unknown_Indicator>false</Address_Unknown_Indicator>
<Address_Not_To_Be_Disclosed_Indicator>false</Address_Not_To_Be_Disclosed_Indicator>
<No_Fixed_Address_Indicator>false</No_Fixed_Address_Indicator>
<Address_Unknown_Indicator>false</Address_Unknown_Indicator>
<Correctional_Facility/>
</ContactAddress>
</Address>
<Address>
<ContactAddress EndDate="9999-12-31+11:00" EndTime="00:00:00.000+11:00" StartDate="2009-01-27+11:00" StartTime="00:00:00.000+11:00">
<Road Name="TEST" Number1="87" TypeCode="DR"/>
<LocalityName>BURWOOD</LocalityName>
<StateOrTerritory>NSW</StateOrTerritory>
<PostCode>2134</PostCode>
<Address_Unknown_Indicator>false</Address_Unknown_Indicator>
<Address_Not_To_Be_Disclosed_Indicator>false</Address_Not_To_Be_Disclosed_Indicator>
<No_Fixed_Address_Indicator>false</No_Fixed_Address_Indicator>
<Address_Unknown_Indicator>false</Address_Unknown_Indicator>
<Correctional_Facility/>
</ContactAddress>
</Address>
<Demographics BirthDate="1965-08-24+10:00" GenderCode="0" SexCode="0"/>
</Person>
</Defendant>
<Identifiers>
<JusticelinkCaseProceedingNumber>200900000013012</JusticelinkCaseProceedingNumber>
</Identifiers>
<ActionIdentifiers LawPartCode="244" OffenceStartDate="2009-01-13+11:00">
<ActionID>
<CANReference HNumber="567576" OffenceReference="2342342" OffenceSequence="1"/>
</ActionID>
</ActionIdentifiers>
<Order JusticelinkOrderNumber="3326885" OrderStatus="RECORDED">
<OrderTypeCodes JusticelinkOrderCategory="CRMCAT0033" JusticelinkOrderType="CRMORD0455"/>
<GenericOrderDetails>
<OrderDuration>
<Years>0</Years>
<Months>0</Months>
<Weeks>0</Weeks>
<Days>0</Days>
<Hours>0</Hours>
</OrderDuration>
</GenericOrderDetails>
</Order>
<Order JusticelinkOrderNumber="3326886" OrderStatus="RECORDED">
<OrderTypeCodes JusticelinkOrderCategory="CRMCAT0014" JusticelinkOrderType="CRMORD0102"/>
<CommunityServiceOrderDetails AlcoholCounsellingIndicator="true" DrugCounsellingIndicator="true" NoOfHours='200' PersonalDevelopmentIndicator="true" SupervisingAgency="Albury Probation & Parole Service">
<MultipleSentenceOrder ConcurrentCumulativeType="Concurrent"/>
<SupervisingAgencyLocation>
<IssuingAgency>Albury Probation & Parole Service</IssuingAgency>
<Code>PROBATION_AND_PAROLE_SERVICE</Code>
<Description>Probation and Parole Service</Description>
<ValidFrom>1930-01-01+10:00</ValidFrom>
<ValidTo>9999-01-01+11:00</ValidTo>
</SupervisingAgencyLocation>
<ReportWithinDetails ReportWithinPeriod="5" ReportWithinUnit="DAYS"/>
</CommunityServiceOrderDetails>
</Order>
</Offence>
 
reply
    Bookmark Topic Watch Topic
  • New Topic