GetReservationRS has duplicate PRICEQUOTE Summary PQR Information - sabre

Situation: 2 pax have tickets re-issued due to return date change. Means there is 495.00 Additional Collection. In the PriceQuote/Summary area of the response for one pax the PQR data is repeated. For the other pax it is only listed once as you would expect. In the AccountingLines section of the response it is correctly listed once for each pax. The problem starts on line 13 below with two PQR records. Is this a bug?
<Summary>
<NameAssociation firstName="JOHN MR" lastName="SMITH" nameId="1" nameNumber="1.1">
<PriceQuote number="1" pricingType="S" status="A" type="PQ">
<Indicators itineraryChange="true" />
<Passenger passengerTypeCount="2" requestedType="ADT" type="ADT" />
<ItineraryType>I</ItineraryType>
<ValidatingCarrier>VA</ValidatingCarrier>
<Amounts>
<Total currencyCode="AUD" decimalPlace="2">1697.66</Total>
</Amounts>
<LocalCreateDateTime>2019-10-31T14:56:00</LocalCreateDateTime>
</PriceQuote>
<PriceQuote number="2" pricingType="S" reissueType="EXCH AC" status="A" type="PQR">
<Indicators ticketed="true" />
<Passenger passengerTypeCount="1" type="ADT" />
<Amounts>
<ReissueDifference currencyCode="AUD" decimalPlace="2">495.00</ReissueDifference>
</Amounts>
</PriceQuote>
<PriceQuote number="3" pricingType="S" reissueType="EXCH AC" status="A" type="PQR">
<Indicators ticketed="true" />
<Passenger passengerTypeCount="1" type="ADT" />
<Amounts>
<ReissueDifference currencyCode="AUD" decimalPlace="2">495.00</ReissueDifference>
</Amounts>
</PriceQuote>
</NameAssociation>
<NameAssociation firstName="PAUL MR" lastName="SMITH" nameId="2" nameNumber="2.1">
<PriceQuote number="1" pricingType="S" status="A" type="PQ">
<Indicators itineraryChange="true" />
<Passenger passengerTypeCount="2" requestedType="ADT" type="ADT" />
<ItineraryType>I</ItineraryType>
<ValidatingCarrier>VA</ValidatingCarrier>
<Amounts>
<Total currencyCode="AUD" decimalPlace="2">1697.66</Total>
</Amounts>
<LocalCreateDateTime>2019-10-31T14:56:00</LocalCreateDateTime>
</PriceQuote>
<PriceQuote number="4" pricingType="S" reissueType="EXCH AC" status="A" type="PQR">
<Indicators ticketed="true" />
<Passenger passengerTypeCount="1" type="ADT" />
<Amounts>
<ReissueDifference currencyCode="AUD" decimalPlace="2">495.00</ReissueDifference>
</Amounts>
</PriceQuote>
</NameAssociation>
</Summary>

Turned out to be a PNR booking error caused by delayed CC validation

Related

How to create a data frame from multiple xml files containing same structure?

I have more than 1000 XML files that probably have the same structure. I want to create a database using data in all the files.
I have never known how an XML file looked before yesterday. With the help of Google, I tried using the r-packages to load a single XML file in RStudio. But when I'm trying to convert that into a data frame, an error is occurring.
This is how file looks like: File A
<?xml-stylesheet type='text/xsl' href='anzctrTransform.xsl'?>
<ANZCTR_Trial requestNumber="42">
<stage>Registered</stage>
<submitdate>19/07/2005</submitdate>
<approvaldate>19/07/2005</approvaldate>
<dateLastUpdated>14/12/2010</dateLastUpdated>
<actrnumber>ACTRN12605000026628</actrnumber>
<trial_identification>
<studytitle>Phase II study of fixed dose rate Gemcitabine-Oxaliplatin Integrated with concomitant 5FU and 3-D Conformal Radiotherapy for the treatment of localised pancreatic cancer: GOFURTGO</studytitle>
<scientifictitle>Phase II study of fixed dose rate Gemcitabine-Oxaliplatin Integrated with concomitant 5FU and 3-D Conformal Radiotherapy for the treatment of localised pancreatic cancer: GOFURTGO</scientifictitle>
<utrn />
<trialacronym>GOFURTGO</trialacronym>
<secondaryid>GOFURTGO</secondaryid>
</trial_identification>
<conditions>
<healthcondition>Locally advanced or locally recurrent inoperable pancreatic cancer not previously treated with chemotherapy or radiotherapy.</healthcondition>
<conditioncode>
<conditioncode1>Cancer</conditioncode1>
<conditioncode2>Pancreatic</conditioncode2>
</conditioncode>
</conditions>
<interventions>
<interventions>All patients enrolled in the study will receive the same treatment consisting of all of the following:
a) 1 cycle of chemotherapy: the cycle is 28 days (gemcitabine on days 1 and 15 and oxaliplatin on days 2 and 16, followed by:
b)radiotherpay plus continuous 5FU infusion: 5FU is given continuously (7 days a week for 6 weeks), radiotherpay is given 5 days a week (Mon-Fri) for 6 weeks followed by:
c) 3 cycles of chemotherapy: each cycle is 28 days (gemcitabine on days 1 and 15 and oxaliplatin on days 2 and 16</interventions>
<comparator>This is a single group trial</comparator>
<control>Uncontrolled</control>
<interventioncode>Treatment: Other</interventioncode>
</interventions>
<outcomes>
<primaryOutcome>
<outcome>The primary objective is to determine the proportions of patients starting and finishing greater than or equal to 80% of the planned dose on time for each component of the treatment.</outcome>
<timepoint>The outcome will be measured once all patients have enrolled and have completeed the study treatment.</timepoint>
</primaryOutcome>
<secondaryOutcome>
<outcome>Adverse events</outcome>
<timepoint>Assessed at the end of ecah treatment cycle, and at end of treatment.</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>Objective tumour response rates</outcome>
<timepoint>Before and after radiotherapy, at the end of treatment, and then as clinically indicated.</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>Time to progression</outcome>
<timepoint>Before and after radiotherapy, at the end of treatment, and then as clinically indicated.</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>CA 19-9 response rates</outcome>
<timepoint>Before and after radiotherapy, at the end of treatment, and then 2 monthly during follow up.</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>Health-related quality of life.</outcome>
<timepoint>Before and after radiotherapy, at the end of treatment, and then 2 monthly until progression/disease recurrence.</timepoint>
</secondaryOutcome>
</outcomes>
<eligibility>
<inclusivecriteria>Patient must have histologically/cytologically proven adenocarcinoma of the pancreas located in the head or the body of the pancreas (primary) or in the pancreatic bed (locally recurrent).Locoregional disease must be confirmed by dual phase CT (arterial and portal phases) without distant metastases (confirmed by CT of the chest, abdomen and pelvis).Patients must be assessed by a surgeon and considered inoperable.Performance status must be ECOG grade 0, 1 or 2.</inclusivecriteria>
<inclusiveminage>0</inclusiveminage>
<inclusiveminagetype>Not stated</inclusiveminagetype>
<inclusivemaxage>0</inclusivemaxage>
<inclusivemaxagetype>Not stated</inclusivemaxagetype>
<inclusivegender>Both males and females</inclusivegender>
<healthyvolunteer>No</healthyvolunteer>
<exclusivecriteria>1.Histological types other than pancreatic ductal adenocarcinoma
2. Metastatic disease.
3. Tumours of the tail of pancreas
4. Major co-morbid illnesses that, in the opinion of the investigator, would jeopardise the likely completion of the treatment program
5. Patients with peripheral sensory neuropathy with functional impairment.
6. Derangement of LFTs consistent with hepatic cellular dysfunction (ALT and/or AST >3 times upper limit of normal), or a bilirubin >3 times upper limit of normal. Patients with LFTs consistent with hepatic obstruction that is relieved (eg. by stenting, bypass) are eligible, provided the bilirubin has fallen to <3 times upper limit of normal.
7. Patients with significant loss of bodyweight, who, at the investigator’s discretion, is deemed not suitable for this study (eg.>15% weight loss since surgery or diagnosis)
8. Treatment with a drug within the last 30 days that has not received regulatory approval at the time of study entry.
9. Treatment with any previous cytotoxic chemotherapy for this malignancy. Previous hormonal manipulation (including HRT) is allowed.
10. Previous abdominal radiotherapy
11. A previous history of malignancy other than non-melanomatous skin cancers, in –situ carcinoma, or patients who are disease–free from non-pancreatic tumours treated definitively more than 5 years ago.
12. Pregnant or lactating women, or women of childbearing potential not using adequate contraception.</exclusivecriteria>
</eligibility>
<trial_design>
<studytype>Interventional</studytype>
<purpose>Treatment</purpose>
<allocation>Non-randomised trial</allocation>
<concealment>Paper enrolment through the AGITG Coordinating Centre, NHMRC Clinical Trials Centre</concealment>
<sequence>n/a</sequence>
<masking>Open (masking not used)</masking>
<assignment>Single group</assignment>
<designfeatures />
<endpoint>Safety</endpoint>
<statisticalmethods />
<masking1 />
<masking2 />
<masking3 />
<masking4 />
<patientregistry />
<followup />
<followuptype />
<purposeobs />
<duration />
<selection />
<timing />
</trial_design>
<recruitment>
<phase>Phase 2</phase>
<anticipatedstartdate>13/04/2005</anticipatedstartdate>
<actualstartdate />
<anticipatedenddate />
<actualenddate />
<samplesize>45</samplesize>
<actualsamplesize />
<currentsamplesize />
<recruitmentstatus>Completed</recruitmentstatus>
<anticipatedlastvisitdate />
<actuallastvisitdate />
<dataanalysis />
<withdrawnreason />
<withdrawnreasonother />
<recruitmentcountry>Australia</recruitmentcountry>
<recruitmentstate />
</recruitment>
<sponsorship>
<primarysponsortype>Other Collaborative groups</primarysponsortype>
<primarysponsorname>AGITG</primarysponsorname>
<primarysponsoraddress>92-94 Parramatta Rd, Camperdown NSW 2050</primarysponsoraddress>
<primarysponsorcountry>Australia</primarysponsorcountry>
<fundingsource>
<fundingtype>Commercial sector/Industry</fundingtype>
<fundingname>Sanofi-Aventis</fundingname>
<fundingaddress>Sanofi-Aventis Group
Talavera Corporate Centre
Building D
12-24 Talavera Road
Macquarie Park NSW 2113</fundingaddress>
<fundingcountry>Australia</fundingcountry>
</fundingsource>
<fundingsource>
<fundingtype>Other Collaborative groups</fundingtype>
<fundingname>AGITG</fundingname>
<fundingaddress>NHMRC Clinical Trials Centre
University of Sydney
Locked Bag 77
CAMPERDOWN NSW 1450</fundingaddress>
<fundingcountry>Australia</fundingcountry>
</fundingsource>
<fundingsource>
<fundingtype>University</fundingtype>
<fundingname>CTC</fundingname>
<fundingaddress>NHMRC Clinical Trials Centre
University of Sydney
Locked Bag 77
CAMPERDOWN NSW 1450</fundingaddress>
<fundingcountry>Australia</fundingcountry>
</fundingsource>
<secondarysponsor>
<sponsortype>Other Collaborative groups</sponsortype>
<sponsorname>AGITG</sponsorname>
<sponsoraddress>NHMRC Clinical Trials Centre
University of Sydney
Locked Bag 77
CAMPERDOWN NSW 1450</sponsoraddress>
<sponsorcountry>Australia</sponsorcountry>
</secondarysponsor>
</sponsorship>
<ethicsAndSummary>
<summary />
<trialwebsite />
<publication />
<ethicsreview>Approved</ethicsreview>
<publicnotes />
<ethicscommitee>
<ethicname>University of Sydney</ethicname>
<ethicaddress>Human Research Ethics Committee
Main Quad
University of Sydney NSW 2006</ethicaddress>
<ethicapprovaldate />
<hrec>11-2004/5/7779</hrec>
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Prince of Wales Hospital</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Border Medical Oncology</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>St. George Hospital</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Newcastle Mater</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Alfred Hospital</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Nepean Hospital</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
<ethicscommitee>
<ethicname>Royal Adelaide Hospital</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
</ethicsAndSummary>
<attachment />
<contacts>
<contact>
<title />
<name>Dr David Goldstein</name>
<address>Department of Medical Oncology
Prince of Wales Hospital
High Street
Randwick NSW 2031</address>
<phone>+61 2 93822577</phone>
<fax>+61 2 93822578</fax>
<email>D.Goldstein#unsw.edu.au</email>
<country>Australia</country>
<type>Scientific Queries</type>
</contact>
<contact>
<title />
<name>Dr David Goldstein</name>
<address>Department of Medical Oncology
Prince of Wales Hospital
High Street
Randwick NSW 2031</address>
<phone>+61 2 93822577</phone>
<fax>+61 2 93822578</fax>
<email>D.Goldstein#unsw.edu.au</email>
<country>Australia</country>
<type>Public Queries</type>
</contact>
<contact>
<title />
<name />
<address />
<phone />
<fax />
<email />
<country />
<type>Principal Investigator</type>
</contact>
</contacts>
</ANZCTR_Trial>
File B.
<?xml-stylesheet type='text/xsl' href='anzctrTransform.xsl'?>
<ANZCTR_Trial requestNumber="6">
<stage>Registered</stage>
<submitdate>08/07/2005</submitdate>
<approvaldate>08/07/2005</approvaldate>
<dateLastUpdated>24/06/2010</dateLastUpdated>
<actrnumber>ACTRN12605000003673</actrnumber>
<trial_identification>
<studytitle>Bisphosphonate and Anastrozole trial - Bone Maintenance Algorithm Assessment</studytitle>
<scientifictitle>Maintaining skeletal health in postmenopausal women with surgically resected Stage I-IIIa hormone-receptor positive breast cancer who are receiving anastrozole, through the use of alendronate as determined by the Osteoporosis Australia Bone Maintenance Algorithm</scientifictitle>
<utrn />
<trialacronym>BATMAN</trialacronym>
<secondaryid>Andrew Love Cancer Centre: ALCC 04.02</secondaryid>
</trial_identification>
<conditions>
<healthcondition>Breast Cancer</healthcondition>
<conditioncode>
<conditioncode1>Cancer</conditioncode1>
<conditioncode2>Breast</conditioncode2>
</conditioncode>
</conditions>
<interventions>
<interventions>This trial aims to assess the utility, through DEXA scans and biochemical markers of bone turnover, of a strategy of monitoring and intervention with oral alendronate in postmenopausal women with hormone-receptor positive breast cancer receiving five years of adjuvant anastrozole. It specifically addressed the issues of osteopaenic and osteoporotic women in this setting and will test three years versus five years of alendronate use.</interventions>
<comparator>Five years of treatment with 70mg oral alendronate once weekly</comparator>
<control>Active</control>
<interventioncode>Treatment: Drugs</interventioncode>
</interventions>
<outcomes>
<primaryOutcome>
<outcome>Changes in lumbar vertebra and femoral neck BMD T-score after 5 years of anastrozole treatment</outcome>
<timepoint>After 5 years of anastrozole treatment</timepoint>
</primaryOutcome>
<secondaryOutcome>
<outcome>Percent change in the lumbar vertebrae</outcome>
<timepoint>Annually for 5 years</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>Biochemical markers</outcome>
<timepoint>6 months after commencing alendronate</timepoint>
</secondaryOutcome>
<secondaryOutcome>
<outcome>Evaluate the Osteoporosis Australia strategy for bone protection for this patient group.</outcome>
<timepoint>At 5 years</timepoint>
</secondaryOutcome>
</outcomes>
<eligibility>
<inclusivecriteria>Postmenopausal women- Adequately diagnosed and treated Stage I-IIIa early breast cancer- Oestrogen receptor and/or progesterone receptor positive breast cancer- Anastrozole is clinically indicated to be the best adjuvant strategy</inclusivecriteria>
<inclusiveminage>18</inclusiveminage>
<inclusiveminagetype>Years</inclusiveminagetype>
<inclusivemaxage>0</inclusivemaxage>
<inclusivemaxagetype>Not stated</inclusivemaxagetype>
<inclusivegender>Females</inclusivegender>
<healthyvolunteer>No</healthyvolunteer>
<exclusivecriteria>Clinical or radiological evidence of distant spread- prior treatment with bisphosphonates within the past 12 months</exclusivecriteria>
</eligibility>
<trial_design>
<studytype>Interventional</studytype>
<purpose>Prevention</purpose>
<allocation>Randomised controlled trial</allocation>
<concealment>central randomisation via fax and phone</concealment>
<sequence>Computer generated stratified blocks</sequence>
<masking>Open (masking not used)</masking>
<assignment>Parallel</assignment>
<designfeatures />
<endpoint>Efficacy</endpoint>
<statisticalmethods />
<masking1 />
<masking2 />
<masking3 />
<masking4 />
<patientregistry />
<followup />
<followuptype />
<purposeobs />
<duration />
<selection />
<timing />
</trial_design>
<recruitment>
<phase>Phase 3</phase>
<anticipatedstartdate>05/07/2005</anticipatedstartdate>
<actualstartdate />
<anticipatedenddate />
<actualenddate />
<samplesize>300</samplesize>
<actualsamplesize />
<currentsamplesize />
<recruitmentstatus>Active, not recruiting</recruitmentstatus>
<anticipatedlastvisitdate />
<actuallastvisitdate />
<dataanalysis />
<withdrawnreason />
<withdrawnreasonother />
<recruitmentcountry>Australia</recruitmentcountry>
<recruitmentstate />
</recruitment>
<sponsorship>
<primarysponsortype>Hospital</primarysponsortype>
<primarysponsorname>Barwon Health</primarysponsorname>
<primarysponsoraddress>272-322 Ryrie Street, Geelong, Victoria 3220</primarysponsoraddress>
<primarysponsorcountry>Australia</primarysponsorcountry>
<fundingsource>
<fundingtype>Commercial sector/Industry</fundingtype>
<fundingname>Astra Zeneca</fundingname>
<fundingaddress>P.O Box 131, North Ryde PBC NSW 1670</fundingaddress>
<fundingcountry>Australia</fundingcountry>
</fundingsource>
<secondarysponsor>
<sponsortype>None</sponsortype>
<sponsorname>Nil</sponsorname>
<sponsoraddress>Nil</sponsoraddress>
<sponsorcountry />
</secondarysponsor>
</sponsorship>
<ethicsAndSummary>
<summary />
<trialwebsite />
<publication />
<ethicsreview>Approved</ethicsreview>
<publicnotes />
<ethicscommitee>
<ethicname>Barwon Health</ethicname>
<ethicaddress />
<ethicapprovaldate />
<hrec />
<ethicsubmitdate />
<ethiccountry>Australia</ethiccountry>
</ethicscommitee>
</ethicsAndSummary>
<attachment />
<contacts>
<contact>
<title />
<name>Associate Professor Richard Bell</name>
<address>Andrew Love Cancer Centre
The Geelong Hospital
70 Swanston Street
Geelong VIC 3220</address>
<phone>+61 3 52267855</phone>
<fax>+61 3 52465168</fax>
<email>richardb#barwonhealth.org.au</email>
<country>Australia</country>
<type>Scientific Queries</type>
</contact>
<contact>
<title />
<name>Ms Elaine Yeow</name>
<address>Andrew Love Cancer Centre
The Geelong Hospital
70 Swanston Street
Geelong VIC 3220</address>
<phone>+61 3 52267858</phone>
<fax>+61 3 52465168</fax>
<email>elainey#barwonhealth.org.au</email>
<country>Australia</country>
<type>Public Queries</type>
</contact>
<contact>
<title />
<name />
<address />
<phone />
<fax />
<email />
<country />
<type>Principal Investigator</type>
</contact>
</contacts>
</ANZCTR_Trial>
Following is my code.
library(XML)
library(xml2)
x = read_xml("ACTRN12605000026628.xml")
print(x)
Trial 1.
x_df = as.data.frame(x)
Error in as.data.frame.default(x) :
cannot coerce class ‘c("xml_document", "xml_node")’ to a data.frame
Trial 2.
xmlToList(x)
Error in UseMethod("xmlSApply") :
no applicable method for 'xmlSApply' applied to an object of class "c('xml_document', 'xml_node')"
Trial 3.
xmlToDataFrame(x)
Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘xmlToDataFrame’ for signature ‘"xml_document", "missing", "missing", "missing", "missing"’
I need help regarding why is that error occurring and how can multiple files' data be converted to a data frame or table in r.
You cannot directly convert XML file to a dataframe. You'll need to fetch the tags and data inside those tags and then create the dataframe.
Here's the code that will do the trick:
library(XML)
library(xml2)
df <- read_xml("1.xml")
records <- xml_find_all(df, "//ANZCTR_Trial")
records
nodenames <- xml_name(xml_children(records))
nodevalues <- trimws(xml_text(xml_children(records)))
df <- as.data.frame(t(nodevalues))
colnames(df) <- nodenames
write.csv(x = df, file = 'trialData.csv')
records contains all the tags and data inside the parent ta. In your case, it is ANZCTR_Trial in both of the files that you shared in the question.
nodenames is names of tags i.e. parent tags. Whereas, nodevalues contain data.
To fetch data from grandchildren tags that are tags inside tags (For e.g phone, fax inside contacts) you'll need to further update the code as follows:
records <- xml_find_all(df, "//contacts") ### You just keep changing it according to your need
records
Everything remains same.

Getting ratings from aria-label with beautiful soup

I have a soup object like:
r = requests.get('https://www.yelp.com/biz/panera-bread-markham')
soup = BeautifulSoup(r.text, 'html.parser')
and I'm trying to find the ratings from the following code,
rating_list = soup.find_all('span', {"class":"lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"})
rating_list
the output is a list like this,
[<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="3 star rating" class="lemon--div__373c0__1mboc i-stars__373c0__Y2F3O i-stars--large-3__373c0__2oM4P border-color--default__373c0__2oFDT overflow--hidden__373c0__8Jq2I" role="img"><img alt="" class="lemon--img__373c0__3GQUb offscreen__373c0__1KofL" height="560" src="https://s3-media0.fl.yelpcdn.com/assets/public/stars.yelp_design_web.yji-9bec2045845c24d3bff3ddb582884eda.png" width="132"/></div></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="4 star rating" class="lemon--div__373c0__1mboc i-stars__373c0__Y2F3O i-stars--regular-4__373c0__3acau border-color--default__373c0__2oFDT overflow--hidden__373c0__8Jq2I" role="img"><img alt="" class="lemon--img__373c0__3GQUb offscreen__373c0__1KofL" height="560" src="https://s3-media0.fl.yelpcdn.com/assets/public/stars.yelp_design_web.yji-9bec2045845c24d3bff3ddb582884eda.png" width="132"/></div></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="5 star rating" class="lemon--div__373c0__1mboc i-stars__373c0__Y2F3O i-stars--regular-5__373c0__ySHIl border-color--default__373c0__2oFDT overflow--hidden__373c0__8Jq2I" role="img"><img alt="" class="lemon--img__373c0__3GQUb offscreen__373c0__1KofL" height="560" src="https://s3-media0.fl.yelpcdn.com/assets/public/stars.yelp_design_web.yji-9bec2045845c24d3bff3ddb582884eda.png" width="132"/></div></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="3 star rating" class="lemon--div__373c0__1mboc i-stars__373c0__Y2F3O i-stars--regular-3__373c0__1DXMK border-color--default__373c0__2oFDT overflow--hidden__373c0__8Jq2I" role="img"><img alt="" class="lemon--img__373c0__3GQUb offscreen__373c0__1KofL" height="560" src="https://s3-media0.fl.yelpcdn.com/assets/public/stars.yelp_design_web.yji-9bec2045845c24d3bff3ddb582884eda.png" width="132"/></div></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><p class="lemon--p__373c0__3Qnnj text__373c0__2pB8f text-color--mid__373c0__3G312 text-align--left__373c0__2pnx_ text-size--small__373c0__3SGMi"><span aria-hidden="true" class="lemon--span__373c0__3997G icon__373c0__ehCWV icon--18-check-in" style="width:18px;height:18px;fill:#0077bc"><svg class="icon_svg" height="18" viewbox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M18 9l-2.136-1.84.932-2.66-2.772-.525-.524-2.77-2.66.93L8.997 0 7.163 2.136 4.5 1.206l-.525 2.77-2.77.524.932 2.66L0 9l2.137 1.84-.932 2.66 2.77.525.526 2.77 2.664-.932L8.998 18l1.84-2.137 2.662.932.524-2.77 2.772-.524-.932-2.66L18 9zm-9.85 3.23L5.324 9.4l1.13-1.13 1.698 1.696 3.396-3.395 1.13 1.134-4.525 4.525z"></path></svg></span> <!-- -->1 check-in</p></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="1 star rating" class="lemon--div__373c0__1mboc i-stars__373c0__Y2F3O i-stars--regular-1__373c0__14nrQ border-color--default__373c0__2oFDT overflow--hidden__373c0__8Jq2I" role="img"><img alt="" class="lemon--img__373c0__3GQUb offscreen__373c0__1KofL" height="560" src="https://s3-media0.fl.yelpcdn.com/assets/public/stars.yelp_design_web.yji-9bec2045845c24d3bff3ddb582884eda.png" width="132"/></div></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><p class="lemon--p__373c0__3Qnnj text__373c0__2pB8f text-color--mid__373c0__3G312 text-align--left__373c0__2pnx_ text-size--small__373c0__3SGMi"><span aria-hidden="true" class="lemon--span__373c0__3997G icon__373c0__ehCWV icon--18-check-in" style="width:18px;height:18px;fill:#0077bc"><svg class="icon_svg" height="18" viewbox="0 0 18 18" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M18 9l-2.136-1.84.932-2.66-2.772-.525-.524-2.77-2.66.93L8.997 0 7.163 2.136 4.5 1.206l-.525 2.77-2.77.524.932 2.66L0 9l2.137 1.84-.932 2.66 2.77.525.526 2.77 2.664-.932L8.998 18l1.84-2.137 2.662.932.524-2.77 2.772-.524-.932-2.66L18 9zm-9.85 3.23L5.324 9.4l1.13-1.13 1.698 1.696 3.396-3.395 1.13 1.134-4.525 4.525z"></path></svg></span> <!-- -->1 check-in</p></span>,
<span class="lemon--span__373c0__3997G display--inline__373c0__1DbOG border-color--default__373c0__2oFDT"><div aria-label="1 star .....
.
.
.
Any suggestion on getting the ratings from <div aria-label="3 star rating" ?
There's a lot ways actually, by loading the JSON from script tag, or find the assigned div. but i think the following way is clear enough :)
import requests
from bs4 import BeautifulSoup
def main(url):
r = requests.get(url)
soup = BeautifulSoup(r.content, 'html.parser')
target = soup.findAll("meta", itemprop="author")
for tar in target:
print(tar['content'], tar.findNext("meta")['content'])
main("https://www.yelp.com/biz/panera-bread-markham")
Output:
Shia L. 4.0
Ryan L. 5.0
Chi K. 3.0
Joan T. 1.0
Nicky D S. 4.0
Matthew K. 3.0
Michelle W. 1.0
Jennifer C. 4.0
Niral P. 3.0
Shajitha R. 1.0
Veronica C. 3.0
Tanveer K. 1.0
Joey J. 2.0
Broadwaygirl M. 1.0
Sheena Y. 3.0
Wendy B. 4.0
Jacqueline L. 2.0
Mi S. 3.0
Sharon M. 2.0
Eduni C. 1.0

unable to parse xml file in R

here is the file that need to parse and eventually convert in dataframe-
<?xml version="1.0" encoding="UTF-8"?>
-<message hash="fb73481d3f3d2b9a70733d69268de71c84f151f8" type="xml" sessionid="https" connector_id="4510010" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<comment/>
-<drive utc_timestamp="2015-09-03T00:09:01.362058" report_name="HTTP Logging to RSP" device_type="ACS 800" sw_appl="ASARF012" sw_type="AS7R7322" serial_number="-">
-<signals timezone="UTC +00:00">
<signal unit="rpm" scale="1" timestamp="2015-09-03T00:07:28.006" name="02_02_01_speed_ref_2" value="0"/>
<signal unit="%" scale="1" timestamp="2015-09-03T00:07:28.511" name="02_01_05_torque" value="0"/>
<signal unit="C" scale="1" timestamp="2015-09-03T00:07:45.352" name="02_01_32_pp_3_temp" value="0"/>
<signal unit="C" scale="1" timestamp="2015-09-03T00:07:46.203" name="02_01_33_pp_4_temp" value="0"/>
<signal unit="C" scale="1" timestamp="2015-09-03T00:07:48.155" name="02_01_35_motor_1_temp" value="0"/>
<signal unit="C" scale="1" timestamp="2015-09-03T00:07:48.911" name="02_01_36_motor_2_temp" value="0"/>
<signal unit="C" scale="1" timestamp="2015-09-03T00:07:52.723" name="02_01_37_motor_temp_est" value="29.999969"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:07:53.638" name="02_03_18_alarm_word_5" value="0"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:07:54.747" name="02_03_19_int_init_fault" value="0"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:07:56.884" name="02_03_11_follower_mcw" value="0"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:07:58.405" name="02_03_13_aux_status_word_3" value="1030"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:07:59.806" name="02_03_14_aux_status_word_4" value="0"/>
<signal unit="" scale="1" timestamp="2015-09-03T00:08:00.485" name="02_03_16_alarm_word_4" value="0"/>
</signals>
</drive>
</message>
I have tried multiple options (XML package is used) but I am not able to convert it into a dataframe/structured form.
## method 1
result <- xmlParse(file = "test.xml")
print(result)
# method 2
xmldataframe <- xmlToDataFrame("test.xml")
print(xmldataframe)
# method 3
xmldoc <- xmlParse(file = test.xml)
rootNode <- xmlRoot(xmldoc)
xmlSApply(rootNode,function(x) xmlSApply(x, xmlValue))
cd.catalog <- data.frame(t(data),row.names=NULL)
none of results/xmldataframe/cd.catalog has dataframe/list in structured form that i can use for further analysis.
Hope you are looking for something like this:
library(xml2)
library(dplyr)
xml_doc <- read_xml("test.xml")
df <- xml_doc %>%
xml_find_all("//signal") %>%
xml_attrs() %>%
unlist() %>%
matrix(ncol=5, byrow=T) %>%
as.data.frame(stringsAsFactors=FALSE)
colnames(df) <- c('unit','scale','timestamp','name','value')
df

Is Guarantee Type attribute required for OTA_HotelResRQ

I have a hotel returning no Guarantee Types such as G, GDPST, etc... This is the first I've seen of this and due to the way the code was written it defaults to the first in an array if the property does not return one. In this case "G". When I perform an OTA_HotelResRQ I get the following error:
INVLD PROP REQUIRES A DEPOSIT FOR THIS DATE
In this scenario should I omit the Type attribute (as specified here http://webservices.sabre.com/drc/servicedoc/OTA_HotelResLLSRQ_v2.2.0_Design.xml) from the Guarantee node?
Here is the HotelPropertyDescriptionLLSRQ response:
<?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header><eb:MessageHeader xmlns:eb="http://www.ebxml.org/namespaces/messageHeader" eb:version="1.0" soap-env:mustUnderstand="1"><eb:From><eb:PartyId eb:type="URI">Sabre</eb:PartyId></eb:From><eb:To><eb:PartyId eb:type="URI">REMOVED</eb:PartyId></eb:To><eb:CPAId>REMOVED</eb:CPAId><eb:ConversationId>MyConversationID</eb:ConversationId><eb:Service>HotelPropertyDescriptionLLSRQ</eb:Service><eb:Action>HotelPropertyDescriptionLLSRS</eb:Action><eb:MessageData><eb:MessageId>471353037366360202</eb:MessageId><eb:Timestamp>2016-09-14T01:02:16</eb:Timestamp><eb:RefToMessageId>1422291197</eb:RefToMessageId></eb:MessageData></eb:MessageHeader><wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext"><wsse:BinarySecurityToken valueType="String" EncodingType="wsse:Base64Binary">Shared/IDL:IceSess\/SessMgr:1\.0.IDL/Common/!ICESMS\/RESC!ICESMSLB\/RES.LB!-3361979970612623474!1331042!0</wsse:BinarySecurityToken></wsse:Security></soap-env:Header><soap-env:Body><HotelPropertyDescriptionRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2011/XMLSchema" xmlns:xsi="http://www.w3.org/2011/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.0.1">
<stl:ApplicationResults status="Complete">
<stl:Success timeStamp="2016-09-13T20:02:16-05:00"/>
</stl:ApplicationResults>
<RoomStay>
<BasicPropertyInfo ChainCode="UZ" GeoConfidenceLevel="1" HotelCityCode="TSM" HotelCode="0012498" HotelName="HOTEL LA FONDA DE TAOS" Latitude="36.406883" Longitude="-105.57462" NumFloors="3" RPH="001">
<Address>
<AddressLine>108 SOUTH PLAZA</AddressLine>
<AddressLine>TAOS NM 87571</AddressLine>
<CountryCode>US</CountryCode>
</Address>
<Award Provider="NTM3 CROWN"/>
<ContactNumbers>
<ContactNumber Fax="1-57-57588508" Phone="1-57-57582211"/>
</ContactNumbers>
<DirectConnect Ind="true">
<AdditionalData Ind="false"/>
<CurrencyConverted Ind="true"/>
<DC_AvailParticipant Ind="true"/>
<DC_SellParticipant Ind="true"/>
<RequestFail Ind="false"/>
<UnAvail Ind="false"/>
</DirectConnect>
<IndexData>
<Index CountryState="NM" DistanceDirection="0NW" LocationCode="A" Point="TAOS SKI VALLEY" TransportationCode="O"/>
<Index DistanceDirection="16W" LocationCode="C" Point="AXX" TransportationCode="O"/>
<Index DistanceDirection="66NE" LocationCode="R" Point="LAM" TransportationCode="O"/>
<Index DistanceDirection="73W" LocationCode="R" Point="RTN" TransportationCode="O"/>
<Index DistanceDirection="7SE" LocationCode="A" Point="TSM" TransportationCode="O"/>
<Index DistanceDirection="72NE" LocationCode="R" Point="SAF" TransportationCode="O"/>
</IndexData>
<PropertyOptionInfo>
<ADA_Accessible Ind="false"/>
<AdultsOnly Ind="false"/>
<AirportShuttle Ind="false"/>
<BeachFront Ind="false"/>
<Breakfast Ind="false"/>
<BusinessCenter Ind="true"/>
<BusinessReady Ind="false"/>
<CarRentalCounter>Y</CarRentalCounter>
<Conventions Ind="false"/>
<Dataport Ind="false"/>
<Dining Ind="true"/>
<DryClean Ind="false"/>
<EcoCertified Ind="false"/>
<ExecutiveFloors Ind="false"/>
<FamilyPlan Ind="true"/>
<FitnessCenter Ind="false"/>
<FreeLocalCalls Ind="false"/>
<FreeParking Ind="true"/>
<FreeShuttle Ind="false"/>
<FreeWifiInMeetingRooms Ind="false"/>
<FreeWifiInPublicSpaces Ind="false"/>
<FreeWifiInRooms Ind="false"/>
<FullServiceSpa Ind="false"/>
<GameFacilities Ind="true"/>
<Golf Ind="false"/>
<GovtSafetyFire Ind="false"/>
<HighSpeedInternet Ind="true"/>
<HypoallergenicRooms Ind="false"/>
<IndoorPool Ind="true"/>
<IndPetRestriction Ind="false"/>
<InRoomCoffeeTea Ind="false"/>
<InRoomMiniBar Ind="false"/>
<InRoomRefrigerator Ind="false"/>
<InRoomSafe Ind="false"/>
<InteriorDoorways Ind="false"/>
<Jacuzzi Ind="false"/>
<KidsFacilities Ind="false"/>
<KitchenFacilities Ind="false"/>
<MealService Ind="false"/>
<MeetingFacilities Ind="true"/>
<NoAdultTV Ind="false"/>
<NonSmoking Ind="true"/>
<OutdoorPool Ind="false"/>
<Parking>Y-COMPLIMENTARY</Parking>
<Pets Ind="false"/>
<Pool Ind="true"/>
<PublicTransportationAdjacent Ind="false"/>
<Recreation Ind="false"/>
<RestrictedRoomAccess Ind="false"/>
<RoomService Ind="false"/>
<RoomService24Hours Ind="false"/>
<RoomsWithBalcony Ind="false"/>
<SkiInOutProperty Ind="false"/>
<SmokeFree Ind="false"/>
<SmokingRoomsAvail Ind="false"/>
<Tennis Ind="false"/>
<WaterPurificationSystem Ind="false"/>
<Wheelchair Ind="false"/>
</PropertyOptionInfo>
<PropertyTypeInfo>
<AllInclusive Ind="false"/>
<Apartments Ind="false"/>
<BedBreakfast Ind="false"/>
<Castle Ind="false"/>
<Conventions Ind="false"/>
<Economy Ind="false"/>
<ExtendedStay Ind="false"/>
<Farm Ind="false"/>
<First Ind="false"/>
<Luxury Ind="false"/>
<Moderate Ind="true"/>
<Motel Ind="false"/>
<Resort Ind="true"/>
<Suites Ind="false"/>
</PropertyTypeInfo>
<SpecialOffers Ind="false"/>
<Taxes>
<Text>8.18 PCT</Text>
<Text>5.00 PCT</Text>
</Taxes>
<VendorMessages>
<Attractions>
<Text>PRIMARY CITY -</Text>
<Text>SAF - TAOS</Text>
<Text>65 MI S</Text>
<Text>RIO GRANDE GORGE 12 MI</Text>
<Text>TAOS PUEBLO 3 MI</Text>
<Text>TAOS SKI VALLEY 18 MI</Text>
</Attractions>
<Awards>
<Text>3 STARS</Text>
</Awards>
<Cancellation>
<Text>-27FEB11 - END -</Text>
<Text>CANCEL BY 7 DAYS PRIOR TO 0000 HOURS ON DAY OF ARRIVAL,</Text>
<Text>LOCAL HOTEL TIME TO AVOID A CANCELLATION PENALTY</Text>
<Text>CANCELLATION POLICY TEXT -</Text>
<Text>CANCEL BY 10 00 7 DAYS BEFORE ARRIVAL TO AVOID PENALTY</Text>
<Text>OF 1 NIGHT.</Text>
</Cancellation>
<Deposit>
<Text>-27FEB11 - END MON-SUN</Text>
<Text>1 NIGHT DEPOSIT REQUIRED FOR ALL RESERVATIONS</Text>
<Text>DEPOSIT OF FIRST NIGHT STAY</Text>
<Text>ACCEPTED FORMS OF DEPOSIT-</Text>
<Text>CREDIT CARD</Text>
</Deposit>
<Description>
<Text>- HOTEL</Text>
<Text>RESORT</Text>
<Text>YEAR BUILT - 1890 YEAR REMODELED - 2003</Text>
<Text>ADDITIONAL PROPERTY DESCRIPTION -</Text>
<Text>HISTORICAL BOUTIQUE HOTEL LOCATED ON THE FAMOUS TAOS</Text>
<Text>PLAZA. AUTHENTIC SOUTHWESTERN AMBIENCE WITH MODERN</Text>
<Text>AMENITIES.</Text>
</Description>
<Dining>
<Text>ADDITIONAL MEAL PLAN DESCRIPTION -</Text>
<Text>WALKING TO BENT STREET CAFE/GRAHAMS GRILL/DOC</Text>
<Text>MARTINS/ALLEY CANTINA/ESKES BREWPUB/MICHAELS KITCHEN</Text>
<Text>RESTAURANT</Text>
<Text>RESTAURANT DESCRIPTION -</Text>
<Text>WALKING TO BENT STREET CAFE/GRAHAMS GRILL/DOC</Text>
<Text>MARTINS/ALLEY CANTINA/ESKES BREWPUB/MICHAELS KITCHEN</Text>
</Dining>
<Directions>
<Text>DIRECTION TO THE PROPERTY FROM AIRPORT SAF -</Text>
<Text>65 MI NORTH</Text>
</Directions>
<Facilities>
<Text>ON-SITE FACILITIES -</Text>
<Text>GENERAL FACILITIES -</Text>
<Text>BANQUET FACILITY CASINO</Text>
<Text>COFFEE SHOP ELEVATORS</Text>
<Text>INDOOR POOL MEETING ROOM</Text>
<Text>NON-SMOKING ROOMS RESTAURANT</Text>
<Text>SOLARIUM SPA</Text>
<Text>HIGH SPEED WIRELESS</Text>
<Text>FREE HIGH SPEED INTERNET CONNECTION</Text>
<Text>CHARGEABLE FACILITIES -</Text>
<Text>BUSINESS CENTER</Text>
<Text>PARKING FACILITIES -</Text>
<Text>FREE PARKING</Text>
<Text>PUBLIC AREA FACILITIES -</Text>
<Text>HIGH SPEED INTERNET ACCESS</Text>
<Text>ADDITIONAL ONSITE FACILITIES -</Text>
<Text>120 AC 120 DC 24-HOUR FRONT DESK 24-HOUR SECURITY 3</Text>
<Text>BEDROOM SUITE ACCESSIBLE PARKING ACCOMMODATIONS WITH</Text>
<Text>BALCONY ADJOINING ROOMS ADJOINING ROOMS ADJOINING</Text>
<Text>ROOMS OR SUITES AIR CONDITIONED GUEST ROOMS AIR</Text>
<Text>CONDITIONING AIRPORT - ALBUQUERQUE SUNPORT 140 MILES</Text>
<Text>AIRPORT SHUTTLE - 50.0 ALARM CLOCK ALL NEWS CHANNEL</Text>
<Text>ALL PETS - PETS NOT ALLOWED ALL PUBLIC AREAS</Text>
<Text>NON-SMOKING ALL ROOMS NON-SMOKING AMERICANS WITH</Text>
<Text>DISABILITIES ACT ADA COMPLIANCE ANIMAL WATCHING</Text>
<Text>ANTIQUE SHOPPING ARCHEOLOGICAL ARCHERY AUDIO VISUAL</Text>
<Text>EQUIPMENT AV EQUIP AVAILABLE SUITES AWAY FROM THE</Text>
<Text>ELEVATOR BACK OF BUILDING BACKGROUND MUSIC BAGGAGE</Text>
<Text>HOLD BALCONY/LANAI/TERRACE BASKETBALL COURT BATHROOM</Text>
<Text>AMENITIES BATHROOM VANITY IN GUEST ROOMS FOR DISABLED</Text>
<Text>PERSON HEIGHT BATHTUB BATHTUB/SHOWER COMBINATION BED</Text>
<Text>TYPES OF WHEELCHAIR ACCESSIBLE ROOMS BEDROOM</Text>
<Text>WHEELCHAIR ACCESS BICYCLE BICYCLE RENTALS BIKE TRAIL</Text>
<Text>BILINGUAL STAFF BIRD WATCHING BLACKBOARD BLACKBOARD</Text>
<Text>WITH ERASER CHALK BOARDING PASS PRINT-OUT AVAILABLE</Text>
<Text>BOATING BOOKSTORE BOTTLED WATER BOUTIQUE BRIDGE</Text>
<Text>BUS BUS PARKING BUSINESS LOCATION CABLE TELEVISION</Text>
<Text>CALLING CARD CALLS CALLING CARD CALLS CAMPING</Text>
<Text>CANOEING CAR CARDIOVASCULAR EXERCISE CATERED</Text>
<Text>BREAKFAST CATERED DINNER CATERED LUNCH CATERING</Text>
<Text>CATHEDRAL CEILING FAN CEMETERY CERTIFIED WEDDING</Text>
<Text>PLANNER CHAIR PROVIDED WITH DESK CHARM HOTEL</Text>
<Text>CHILDREN NOT ALLOWED</Text>
</Facilities>
<Guarantee>
<Text>-27FEB11 - END MON-SUN</Text>
<Text>SEE DEPOSIT POLICY</Text>
<Text>ACCEPTED FORMS OF GUARANTEE-</Text>
<Text>CREDIT CARD</Text>
<Text>ACCEPTED FORMS OF PAYMENT-</Text>
<Text>CREDIT CARD</Text>
</Guarantee>
<Location>
<Text>PRIMARY PROPERTY LOCATION - CITY</Text>
<Text>SAF AIRPORT 65 MI N</Text>
<Text>RESORT</Text>
</Location>
<MiscServices>
<Text>EMAIL - INFO LAFONDATAOS.COM</Text>
<Text>TAXES AND SURCHARGES -</Text>
<Text>TAX- 8.18 PCT</Text>
<Text>LODGING TAX- 5.00 PCT</Text>
<Text>ADDITIONAL CURRENCY AND TAX INFORMATION -</Text>
<Text>8.1875 PCT VAT AND 5 PCT LODGERS TAX EXCLUDED</Text>
<Text>-27FEB11 - END MON-SUN</Text>
<Text>MIN STAY - 1</Text>
</MiscServices>
<Policies>
<Text>EXTRA CHILD - 0.00 USD ROLLAWAY FOR CHILD - 0.00 USD</Text>
<Text>CHILDREN STAY FREE -</Text>
<Text>CHILDREN WELCOME - NO CHILDREN ALLOWED UNDER AGE 8</Text>
<Text>NO PETS ALLOWED -</Text>
<Text>ALL PETS - PETS NOT ALLOWED</Text>
<Text>PROPERTY OFFERS COMMISSION - RATE OF COMMISSION</Text>
<Text>10 PCT</Text>
<Text>ADDITIONAL COMMISSION PROGRAMS INFORMATION -</Text>
<Text>10 PCT</Text>
</Policies>
<Recreation>
<Text>ON-SITE RECREATION -</Text>
<Text>BICYCLING WATER SPORTS</Text>
</Recreation>
<Rooms>
<Text>ROOM AMENITIES FOR ALL ROOMS -</Text>
<Text>ROOM AMENITIES -</Text>
<Text>AIR CONDITIONING / AM/FM ALARM CLOCK / BATH TUB /</Text>
<Text>BATHROOM AMENITIES / CABLE/SATELLITE TV / DIRECT DIAL</Text>
<Text>TELEPHONE / FREE LOCAL TELEPHONE CALLS / HAIRDRYER /</Text>
<Text>IRON/IRONING BOARD / NO SMOKING ROOM / PRIVATE BATH OR</Text>
<Text>SHOWER / RADIO / SHOWER / SMOKE DETECTOR / TELEPHONE/SAFE/</Text>
<Text>TELEVISION</Text>
<Text>TECHNOLOGY -</Text>
<Text>DATAPORT / HIGH SPEED INTERNET ACCESS / VOICE MAIL</Text>
<Text>S1K-</Text>
<Text>MAX OCCUPANCY - 4</Text>
<Text>MAX NBR OF ROLLAWAYS - 0</Text>
<Text>ROOM DESCRIPTION -</Text>
<Text>NEWLY AND RICHLY REMODELED/ DELUXE TWO ROOM SUITE WITH</Text>
<Text>1 KING BED. NEWLY AND RICHLY REMODELED/ DELUXE TWO ROOM</Text>
<Text>SUITE WITH 1 KING BED/ SOME WITH SLEEPER SOFA/ MOST</Text>
<Text>WITH GAS FIREPLACE/ REFRIGERATOR/ WET BAR/ LUXURIOUS</Text>
<Text>LINENS AND HEADBOARD/ A/C CEILING FAN/ ARMOIRE WITH</Text>
<Text>COLOR CABLE TV/ DSL CONNECTIVITY/ TELEPHONE WITH VOICE</Text>
<Text>MAIL/ ALARM CLOCK/ RADIO/ SMOKE DETECTOR/ HAND-TILED</Text>
<Text>BATHROOM WITH TUB AND SHOWER/ BATHROOM AMENITIES/</Text>
<Text>IRON/BOARD/ AND HAIRDRYER. 120AC/ 120DC. DAILY MAID</Text>
<Text>SERVICE/ FREE PARKING AND ADMITTANCE TO DH LAWRENCE</Text>
<Text>FORBIDDEN ART COLLECTION. ALL ROOMS ARE NON-SMOKING.</Text>
<Text>PHR -</Text>
<Text>MAX OCCUPANCY - 4</Text>
<Text>MAX NBR OF ROLLAWAYS - 0</Text>
<Text>ROOM DESCRIPTION -</Text>
<Text>UNIQUE/ LUXURIOUS 1200 SQ. FT. PLAZA PENTHOUSE/ ONE</Text>
<Text>BEDROOM WITH KING BED/ QUEEN SLEEPER SOFA. UNIQUE/</Text>
<Text>LUXURIOUS 1200 SQ. FT. PLAZA PENTHOUSE/ ONE BEDROOM</Text>
<Text>WITH KING BED/ QUEEN SLEEPER SOFA/ HAND-TILED FULL</Text>
<Text>BATH/ LAUNDRY/ FULLY EQUIPPED KITCHEN/ DINING ROOM/</Text>
<Text>SUNKEN LIVING ROOM WITH GAS KIVA FIREPLACE/ OUTDOOR</Text>
<Text>DECKL/ COLOR CABLE TV/ DESK TOP COMPUTER/ DSL</Text>
<Text>CONNECTIVITY/ CEILING FANS/ TELEPHONE WITH VOICE MAIL/</Text>
<Text>ALARM CLOCK/ RADIO/ BATH AMENITIES/ HAIR DRYER/ IRON</Text>
<Text>AND IRONING BOARD/ DAILY MAID SERVICE/ FREE PARKING AND</Text>
<Text>ADMITTANCE TO DH LAWRENCE FORBIDDEN ART COLLECTION.</Text>
<Text>TWO/ THREE/ AND FOUR BEDROOM CAPABILITY. CALL FOR</Text>
<Text>PRICES AND AVAILABILITY. THIS HOTEL IS A NON-SMOKING</Text>
<Text>PROPERTY AND CANNOT ACCOMMODATE PETS. THIS SUITE IS</Text>
<Text>NON-SMOKING.</Text>
<Text>A1Q -</Text>
<Text>MAX OCCUPANCY -</Text>
</Rooms>
<Safety>
<Text>PROPERTY SAFETY AND SECURITY -</Text>
<Text>SECURITY AVAILABLE 24 HOURS</Text>
<Text>24-HOUR SECURITY</Text>
</Safety>
<Services>
<Text>ON-SITE GENERAL SERVICES -</Text>
<Text>BAGGAGE HOLD BICYCLE RENTAL</Text>
<Text>FRONT DESK 24 HRS MULTILINGUAL STAFF</Text>
<Text>SAFE DEPOSIT BOX WAKE-UP CALLS</Text>
<Text>ON-SITE CHARGEABLE SERVICES -</Text>
<Text>CAR RENTAL</Text>
<Text>BUSINESS SERVICES -</Text>
<Text>BUSINESS CENTER</Text>
</Services>
<Transportation>
<Text>TRANSPORTATION FROM PRIMARY AIRPORT TO PROPERTY -</Text>
<Text>RENTAL CAR</Text>
<Text>TRANSPORTATION FROM CITY CENTER TO PROPERTY -</Text>
<Text>RENTAL CAR</Text>
</Transportation>
</VendorMessages>
</BasicPropertyInfo>
<Guarantee>
<DepositsAccepted>
<PaymentCard Code="AX" Type="AMERICAN EXPRESS"/>
<PaymentCard Code="CA" Type="MASTERCARD"/>
<PaymentCard Code="DS" Type="DISCOVER CARD"/>
<PaymentCard Code="VI" Type="VISA"/>
</DepositsAccepted>
<GuaranteesAccepted>
<PaymentCard Code="AX" Type="AMERICAN EXPRESS"/>
<PaymentCard Code="CA" Type="MASTERCARD"/>
<PaymentCard Code="DS" Type="DISCOVER CARD"/>
<PaymentCard Code="VI" Type="VISA"/>
</GuaranteesAccepted>
</Guarantee>
<RoomRates>
<RoomRate DirectConnect="false" GuaranteeSurchargeRequired="D" GuaranteedRateProgram="false" HRD_RequiredForSell="false" IATA_CharacteristicIdentification="N1QRAC" IATA_ProductIdentification="PUBLISHED RATE" LowInventoryThreshold="false" RPH="001" RateChangeInd="false" RateConversionInd="false" SpecialOffer="false">
<AdditionalInfo>
<CancelPolicy Numeric="03" Option="D"/>
<Commission NonCommission="false">10.00 PERCENT COMMISSION</Commission>
<Text>STANDARD QUEEN</Text>
</AdditionalInfo>
<Rates>
<Rate Amount="159.00" ChangeIndicator="false" CurrencyCode="USD" HRD_RequiredForSell="false" PackageIndicator="false" RateConversionInd="false" ReturnOfRateInd="false" RoomOnRequest="false">
<AdditionalGuestAmounts>
<AdditionalGuestAmount MaxExtraPersonsAllowed="0" NumAdults="0" NumCribs="0">
<Charges AdultRollAway="10.00" Crib="0.00" ExtraPerson="10.00"/>
</AdditionalGuestAmount>
</AdditionalGuestAmounts>
<HotelTotalPricing Amount="359.94">
<Disclaimer>INCLUDES TAXES AND SURCHARGES</Disclaimer>
<TotalTaxes Amount="41.94"/>
</HotelTotalPricing>
</Rate>
</Rates>
</RoomRate>
<RoomRate DirectConnect="false" GuaranteeSurchargeRequired="D" GuaranteedRateProgram="false" HRD_RequiredForSell="false" IATA_CharacteristicIdentification="N1KRAC" IATA_ProductIdentification="PUBLISHED RATE" LowInventoryThreshold="false" RPH="002" RateChangeInd="false" RateConversionInd="false" SpecialOffer="false">
<AdditionalInfo>
<CancelPolicy Numeric="03" Option="D"/>
<Commission NonCommission="false">10.00 PERCENT COMMISSION</Commission>
<Text>STANDARD KING</Text>
</AdditionalInfo>
<Rates>
<Rate Amount="169.00" ChangeIndicator="false" CurrencyCode="USD" HRD_RequiredForSell="false" PackageIndicator="false" RateConversionInd="false" ReturnOfRateInd="false" RoomOnRequest="false">
<AdditionalGuestAmounts>
<AdditionalGuestAmount MaxExtraPersonsAllowed="0" NumAdults="0" NumCribs="0">
<Charges AdultRollAway="10.00" Crib="0.00" ExtraPerson="10.00"/>
</AdditionalGuestAmount>
</AdditionalGuestAmounts>
<HotelTotalPricing Amount="382.58">
<Disclaimer>INCLUDES TAXES AND SURCHARGES</Disclaimer>
<TotalTaxes Amount="44.58"/>
</HotelTotalPricing>
</Rate>
</Rates>
</RoomRate>
<RoomRate DirectConnect="false" GuaranteeSurchargeRequired="D" GuaranteedRateProgram="false" HRD_RequiredForSell="false" IATA_CharacteristicIdentification="S1KRAC" IATA_ProductIdentification="PUBLISHED RATE" LowInventoryThreshold="false" RPH="003" RateChangeInd="false" RateConversionInd="false" SpecialOffer="false">
<AdditionalInfo>
<CancelPolicy Numeric="03" Option="D"/>
<Commission NonCommission="false">10.00 PERCENT COMMISSION</Commission>
<Text>KING SUITE</Text>
</AdditionalInfo>
<Rates>
<Rate Amount="199.00" ChangeIndicator="false" CurrencyCode="USD" HRD_RequiredForSell="false" PackageIndicator="false" RateConversionInd="false" ReturnOfRateInd="false" RoomOnRequest="false">
<AdditionalGuestAmounts>
<AdditionalGuestAmount MaxExtraPersonsAllowed="0" NumAdults="0" NumCribs="0">
<Charges AdultRollAway="10.00" Crib="0.00" ExtraPerson="10.00"/>
</AdditionalGuestAmount>
</AdditionalGuestAmounts>
<HotelTotalPricing Amount="450.48">
<Disclaimer>INCLUDES TAXES AND SURCHARGES</Disclaimer>
<TotalTaxes Amount="52.48"/>
</HotelTotalPricing>
</Rate>
</Rates>
</RoomRate>
<RoomRate DirectConnect="false" GuaranteeSurchargeRequired="D" GuaranteedRateProgram="false" HRD_RequiredForSell="false" IATA_CharacteristicIdentification="APTRAC" IATA_ProductIdentification="PUBLISHED RATE" LowInventoryThreshold="false" RPH="004" RateChangeInd="false" RateConversionInd="false" SpecialOffer="false">
<AdditionalInfo>
<CancelPolicy Numeric="03" Option="D"/>
<Commission NonCommission="false">10.00 PERCENT COMMISSION</Commission>
<Text>PLAZA PENTHOUSE</Text>
</AdditionalInfo>
<Rates>
<Rate Amount="499.00" ChangeIndicator="false" CurrencyCode="USD" HRD_RequiredForSell="false" PackageIndicator="false" RateConversionInd="false" ReturnOfRateInd="false" RoomOnRequest="false">
<AdditionalGuestAmounts>
<AdditionalGuestAmount MaxExtraPersonsAllowed="0" NumAdults="0" NumCribs="0">
<Charges AdultRollAway="10.00" Crib="0.00" ExtraPerson="10.00"/>
</AdditionalGuestAmount>
</AdditionalGuestAmounts>
<HotelTotalPricing Amount="1129.62">
<Disclaimer>INCLUDES TAXES AND SURCHARGES</Disclaimer>
<TotalTaxes Amount="131.62"/>
</HotelTotalPricing>
</Rate>
</Rates>
</RoomRate>
</RoomRates>
<TimeSpan Duration="0005" End="2016-10-16" Start="2016-10-14"/>
</RoomStay>
</HotelPropertyDescriptionRS></soap-env:Body></soap-env:Envelope>
REQUEST:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Header>
<MessageHeader xmlns="http://www.ebxml.org/namespaces/messageHeader">
<From>
<PartyId type="urn:x12.org:IO5:01"><!-- APP SOURCE REMOVED BY OP --></PartyId>
</From>
<To>
<PartyId type="urn:x12.org:IO5:01">Sabre</PartyId>
</To>
<CPAId><!-- IPCC REMOVED BY OP --></CPAId>
<ConversationId>MyConversationID</ConversationId>
<Service type="sabreXML">HotelPropertyDescriptionLLSRQ</Service>
<Action>HotelPropertyDescriptionLLSRQ</Action>
<MessageData>
<MessageId>1422291197</MessageId>
<Timestamp>2015-01-26T09:53:17-07:00</Timestamp>
<TimeToLive>2015-01-26T10:53:17-07:00</TimeToLive>
</MessageData>
</MessageHeader>
<wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/12/secext" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/12/utility">
<!-- TOKEN REMOVED BY OP -->
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<HotelPropertyDescriptionRQ xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" Version="2.0.1">
<AvailRequestSegment>
<GuestCounts Count="2" />
<HotelSearchCriteria>
<Criterion>
<HotelRef HotelCode="0012498" />
</Criterion>
</HotelSearchCriteria>
<TimeSpan Start="10-14" End="10-16" />
</AvailRequestSegment>
</HotelPropertyDescriptionRQ>
</soapenv:Body>
</soapenv:Envelope>
Edit: added request, per user request. Items I removed for security have been indicated with comments.
It is strange indeed not having that returned as usual.
The answer to your question is: No. Actually that room rate requires a deposit not a guarantee, and it is safe to say that most hotels require one of the 2, so not sending that is probably not a good idea.
In this case, you can use GDPST as deposit, since it says that it accepts credit cards, although that is in free text.
Now, as you can see in the first rate returned, inside the RoomRate element, you have: GuaranteeSurchargeRequired="D". The values for that attribute are D for Deposit and G for guarantee. I'm not sure if there's something for when there is no guarantee needed, haven't seen any, but it is likely a different element or the element is not returned.
In order to know the values for guarantee you can use in the OTA_HotelRes, I recommend you to check the following format finder link:
https://formatfinder.sabre.com/Content/Hotels/FourEasyStepstoSellaHotel/0HSellHotel.aspx?ItemID=597F73406BFE49EFB5DF100C096ABFB0

Flex AdvancedDataGrid listItems strange behaviour

I have the following XML, that is the dataprovider (as a Hierarchicaldata) of an Advanced DataGrid:
public var reqData:XML = <root>
<Requirement ID="REQ-GEN-0.1" title="exigence gen 1" description="blabla 01" testable="true"/>
<RequirementSet ID="GUI REQ">
<Requirement ID="REQ-GUI-1.1" title="exigence ihm 1" description="blabla 11" testable="true"/>
<Requirement ID="REQ-GUI-1.2" title="exigence ihm 2" description="blabla 12" testable="false"/>
</RequirementSet>
<RequirementSet ID="PERF REQ">
<Requirement ID="REQ-PERF-2.1" title="exigence perf 1" description="blabla 21" testable="true"/>
<Requirement ID="REQ-PERF-2.2" title="exigence perf 2" description="blabla 22" testable="false"/>
<Requirement ID="REQ-PERF-2.3" title="exigence perf 3" description="blabla 23" testable="true"/>
<Requirement ID="REQ-PERF-2.4" title="exigence perf 4" description="blabla 24" testable="false"/>
<Requirement ID="REQ-PERF-2.5" title="exigence perf 5" description="blabla 25" testable="false"/>
<Requirement ID="REQ-PERF-2.6" title="exigence perf 6" description="blabla 26" testable="false"/>
</RequirementSet>
<RequirementSet ID="BUS REQ">
<RequirementSet ID="BUS 1 REQ">
<Requirement ID="REQ-BUS-3.1.1" title="exigence bus 1" description="blabla 311" testable="false"/>
<Requirement ID="REQ-BUS-3.1.2" title="exigence bus 2" description="blabla 312" testable="true"/>
</RequirementSet>
<RequirementSet ID="BUS 2 REQ">
<Requirement ID="REQ-BUS-3.2.1" title="exigence bus3" description="blabla 321" testable="true"/>
</RequirementSet>
<RequirementSet ID="BUS 3 REQ"/>
<RequirementSet ID="BUS 4 REQ">
<Requirement ID="REQ-BUS-3.4.1" title="exigence bus4" description="blabla 341" testable="false"/>
</RequirementSet>
<RequirementSet ID="BUS 5 REQ"/>
<RequirementSet ID="BUS 6 REQ"/>
</RequirementSet>
</root>;
And here is the AdvancedDataGrid part:
<mx:AdvancedDataGrid id="reqADGtest" displayItemsExpanded="true"
width="95%" height="75%" horizontalCenter="0"
contentBackgroundAlpha="0.0" chromeColor="0xdbeaff"
openDuration="500" dragEnabled="true" dropEnabled="true"
dragMoveEnabled="true" editable="true"
variableRowHeight="true" horizontalScrollPolicy="auto">
<mx:columns>
<mx:AdvancedDataGridColumn dataField="#ID" headerText="ID"/>
<mx:AdvancedDataGridColumn dataField="#title" headerText="Titre"/>
<mx:AdvancedDataGridColumn dataField="#testable" headerText="Testable"/>
<mx:AdvancedDataGridColumn dataField="#description" headerText="Description"
editorUsesEnterKey="true"
wordWrap="true"/>
</mx:columns>
</mx:AdvancedDataGrid>
The problem is that when I look at the listItems' length of the AdvancedDataGrid, it is 19 at the creation, and then 16 that is totally wrong (22 items). I want to access to some items and I can't which is really annoying. Is it a bug or something?
NOTE:
To access items by rowIndex and columnIndex I'm doing the following:
var advancedDataGridListData:AdvancedDataGridListData =
IDropInListItemRenderer(listItems[event.rowIndex][event.columnIndex]).listData
as AdvancedDataGridListData;
IHierarchicalCollectionView(dataProvider).getChildren(
advancedDataGridListData.item)
EDITED 23/02/2012
I tested your solution with event.item but unfortunatly this item was always null and I didn't understand why. So I looked deeper into the source code of AdvancedDataGridBaseEx and I found that this is a part of the Adobe source code):
// send event to create the new one
var advancedDataGridEvent:AdvancedDataGridEvent =
new AdvancedDataGridEvent(AdvancedDataGridEvent.ITEM_EDIT_BEGINNING, false, true);
// ITEM_EDIT events are cancelable
advancedDataGridEvent.columnIndex = columnIndex;
advancedDataGridEvent.dataField = _columns[columnIndex].dataField;
advancedDataGridEvent.rowIndex = rowIndex;
dispatchEvent(advancedDataGridEvent);
You can see that the event.item is never filled!!!! Thanks Adobe... I will try your other solution then I give you feedback.
LAST EDIT
I solved my problem by using in my custom datagrid:
var xmlNode:XML = this.selectedItem as XML;
How about this
dataProvider.getChildren(event.item)
based on reading here:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/AdvancedDataGridBaseEx.html#event:itemEditBeginning
Alternatively maybe this method would help (though it's protected so you may need to do a "monkey patch" to change the access control modifier from protected to public:
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/AdvancedDataGridBaseEx.html#absoluteToVisibleIndices()
I think on the event.rowIndex and event.columnIndex it's essentially giving you absolute values but the listItems has it based on what's currently visible rather than the absolute positions. Not a direct answer I know but it's very late here.

Resources