Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loading an XML file to a Datawindow

Status
Not open for further replies.

Dom71555

IS-IT--Management
Feb 6, 2005
47
US
Does anyone have step by step directions, or point me to a place that does, on how to create the datawindow object that will be loaded with an XML file?
 
So I figured out how to import an XML file. If I import without a template, I will get an error if an xml element is not present in the file.
This can be due to a null value in the element. However, if I use a template, it will import all elements whether they have nulls or not.
I created a template and assigned it to the datawindow object. The command button script sets the datawindow trans object to SQLCA and the following:
dw_1.Modify("DataWindow.Import.XML.UseTemplate = 't_performance_report' ")
dw_1.ImportFile(XML!,"Perf Report 16.18.xml")

When the report is run, nothing is retrieved and the trace file looks like this.


/*---------------------------------------------------*/
/* 11/26/2018 11:51 */
/*---------------------------------------------------*/
CREATING SAX PARSER.
USING XML IMPORT TEMPLATE: t_performance_report

XML NAMES MAPPING TO DATAWINDOW IMPORT COLUMNS:
ATTRIBUTE: /d_xml_performance_report/d_xml_performance_report_row NAME: '__pbband'
>>> RESERVED TEMPLATE NAME - ITEM WILL BE IGNORED
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/assessmentdescription
DATAWINDOW COLUMN: 1, NAME: 'assessmentdescription'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/updatedassessmentschoolyear
DATAWINDOW COLUMN: 2, NAME: 'updatedassessmentschoolyear'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/locationdescription
DATAWINDOW COLUMN: 3, NAME: 'locationdescription'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/learningstandard
DATAWINDOW COLUMN: 4, NAME: 'learningstandard'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/questionnumber
DATAWINDOW COLUMN: 5, NAME: 'questionnumber'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/subskill
DATAWINDOW COLUMN: 6, NAME: 'subskill'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/questiontype
DATAWINDOW COLUMN: 7, NAME: 'questiontype'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/correctresponse
DATAWINDOW COLUMN: 8, NAME: 'correctresponse'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/adistractor
DATAWINDOW COLUMN: 9, NAME: 'adistractor'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/bdistractor
DATAWINDOW COLUMN: 10, NAME: 'bdistractor'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/cdistractor
DATAWINDOW COLUMN: 11, NAME: 'cdistractor'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/ddistractor
DATAWINDOW COLUMN: 12, NAME: 'ddistractor'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/roompercentfullcredit
DATAWINDOW COLUMN: 13, NAME: 'roompercentfullcredit'
ELEMENT: /d_xml_performance_report/d_xml_performance_report_row/districtpercentfullcredit
DATAWINDOW COLUMN: 14, NAME: 'districtpercentfullcredit'

I appreciate any help with this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top