×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Loading an XML file to a Datawindow

Loading an XML file to a Datawindow

Loading an XML file to a Datawindow

(OP)
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?

RE: Loading an XML file to a Datawindow

(OP)
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close