[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.3

Assigning Dynamic Properties to an XML Bulk Post

Asked by benhurley in XML Databases, Extensible Markup Language (XML), MS SQL Server, MySQL Server, SQL Reporting

Tags: XML, BULK POST, MSSQL, VB Script

I need to find out how i can assign dynamic properties, namely a unique CompanyID to an XML bulk post data sheet, so that end users can upload an XML data sheet and bulk post it to my application, with the correct variables filerting the data into their unique CompanyID.

The application is a job posting site, which allows companies to post jobs online. The XML bulk load feature is necessary as many agencies now use this feature and its becoming common place. I have already developed the BULK POST code, which functions fine, i can bulk post data to MSSQL as the site admin, no problem, providing i manually enter the CompanyID into the schema. This is not sufficient however, as i need my clients to be able to bulk post their own data, and have the company ID assigned during the transformation.

The code consists of 3 parts as shown below;

The part im assuming i need to assign the dynamic properties to is code sample 3, the transformation schema. Im not an expert in XML and have no idea how to insert dynamic values without messing up the code. On the application side, CompanyID (which is the value i need to make dynamic) is called as varCompanyID during the session.

Any advice would be greatly appreciated as to how i should go about setting this up.

Thanks in advance experts!
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
1. Bulk Post ASP VB Script
 
'<% 
 
Set objBL = CreateObject("SQLXMLBulkLoad.SQLXMLBulkLoad")
objBL.ConnectionString = "provider=SQLOLEDB.1;data source=COMPUTER1\SQLEXPRESS;database=database1;uidXXXXX=;pwd=XXXXX"
objBL.KeepIdentity = False
objBL.ForceTableLock = True
objBL.Transaction = True
objBL.ErrorLogFile = "C:\Inetpub\wwwroot\website\log.log"
objBL.Execute "C:\Inetpub\wwwroot\website\xml_upload\transform.xml", "C:\Inetpub\wwwroot\website\XML\company_account\job_import.xml"
Set objBL = Nothing
 
%>'
 
2. XML Data Sheet Example
 
<ROOT>
  <JobAd>
        
	<CompanyID>1</CompanyID>
	<CompanyName>TestCompany.com</CompanyName>
	<PositionTitle>Bulk Import Test Job</PositionTitle>
	<JobDescription>Currently, Test Company are seeking for qualified candidates to join their United Kingdom team as Chief Financial Officer. This opportunity is a Permanent, Contract position to be based at London, United Kingdom.</JobDescription>
	<Responsibilities>Test job only</Responsibilities>
	<CandRequirement>The ideal candidate should fulfill the following requirements: At least 5 years of working experience in a related field Possess a Diploma and above from a recognized institution Fluency in English will be essential</CandRequirement>
	<Industry>IT</Industry>
	<Country>United Kingdom</Country>
	<JobAdStatus>Active</JobAdStatus>
	<PostingDate>9/11/2008 2:48:26 AM</PostingDate>
	<ApplicationDeadline>5/3/2009 12:00:00 AM</ApplicationDeadline>
	<CreatedDate>9/11/2008 2:48:26 AM</CreatedDate>
	<CompanyIntro>1111</CompanyIntro>
        <OpenApplication>1</OpenApplication>
	<OpenApplicationEmailAdd>support@xpandedmedia.com</OpenApplicationEmailAdd>
	<EmploymentType>Permanent</EmploymentType>
	<JobLocation>London</JobLocation>
	<MaxYrsExp>12</MaxYrsExp>
	<MinYrsExp>2</MinYrsExp>
	<MinEducation>Degree</MinEducation>
	<FieldofStudy>Computer Science</FieldofStudy>
	<Language1>English</Language1>
	<Language2>French</Language2>
  </JobAd>
</ROOT>
 
3. Finally the transformation code, which we shall call transform.xml
 
<?xml version="1.0" ?>
<Schema xmlns="urn:schemas-microsoft-com:xml-data" 
        xmlns:dt="urn:schemas-microsoft-com:xml:datatypes"  
        xmlns:sql="urn:schemas-microsoft-com:xml-sql" > 
 
   <ElementType name="JobAdID" dt:type="int" />
   <ElementType name="CompanyID" dt:type="int" />
   <ElementType name="CompanyName" dt:type="string" />
   <ElementType name="PositionTitle" dt:type="string" />
   <ElementType name="JobDescription" dt:type="string" />
   <ElementType name="Responsibilities" dt:type="string" />
   <ElementType name="CandRequirement" dt:type="string" />
   <ElementType name="Industry" dt:type="string" />
   <ElementType name="Country" dt:type="string" />
   <ElementType name="JobAdStatus" dt:type="string" />
   <ElementType name="PostingDate" dt:type="string" />
   <ElementType name="ApplicationDeadline" dt:type="string" />
   <ElementType name="CreatedDate" dt:type="string" />
   <ElementType name="CompanyIntro" dt:type="string" />
   <ElementType name="OpenApplication" dt:type="string" />
   <ElementType name="OpenApplicationEmailAdd" dt:type="string" />
   <ElementType name="EmploymentType" dt:type="string" />
   <ElementType name="JobLocation" dt:type="string" />
   <ElementType name="MaxYrsExp" dt:type="string" />
   <ElementType name="MinYrsExp" dt:type="string" />
   <ElementType name="MinEducation" dt:type="string" />
   <ElementType name="FieldofStudy" dt:type="string" />
   <ElementType name="Language1" dt:type="string" />
   <ElementType name="Language2" dt:type="string" />
 
   <ElementType name="ROOT" sql:is-constant="1">
      <element type="JobAd" />
   </ElementType>
 
          <ElementType name="JobAd"  sql:relation="tblmJobAds">
          <element type="JobAdID"  sql:field="JobAdID" />
          <element type="CompanyID" sql:field="CompanyID" />
          <element type="CompanyName"        sql:field="CompanyName" />
	  <element type="PositionTitle"        sql:field="PositionTitle" />
	  <element type="JobDescription"        sql:field="JobDescription" />
	  <element type="Responsibilities"        sql:field="Responsibilities" />
	  <element type="CandRequirement"        sql:field="CandRequirement" />
	  <element type="Industry"        sql:field="Industry" />
	  <element type="Country"        sql:field="Country" />
	  <element type="JobAdStatus"        sql:field="JobAdStatus" />
	  <element type="PostingDate"        sql:field="PostingDate" />
	  <element type="ApplicationDeadline"        sql:field="ApplicationDeadline" />
          <element type="CreatedDate"        sql:field="CreatedDate" />
	  <element type="OpenApplication"        sql:field="OpenApplication" />
	  <element type="EmploymentType"        sql:field="EmploymentType" />
	  <element type="JobLocation"        sql:field="JobLocation" />
	  <element type="MaxYrsExp"        sql:field="MaxYrsExp" />
	  <element type="MinYrsExp"        sql:field="MinYrsExp" />
	  <element type="MinEducation"        sql:field="MinEducation" />
	  <element type="FieldofStudy"        sql:field="FieldofStudy" />
	  <element type="Language1"        sql:field="Language1" />
	  <element type="Language2"        sql:field="Language2" />
   </ElementType>
 
</Schema>
[+][-]02/04/09 10:04 AM, ID: 23551140Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zones: XML Databases, Extensible Markup Language (XML), MS SQL Server, MySQL Server, SQL Reporting
Tags: XML, BULK POST, MSSQL, VB Script
Sign Up Now!
Solution Provided By: Zberteoc
Participating Experts: 1
Solution Grade: B
 
[+][-]02/02/09 05:13 PM, ID: 23533294Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02/02/09 05:14 PM, ID: 23533296Administrative Comment

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]02/03/09 09:36 AM, ID: 23539700Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/03/09 12:50 PM, ID: 23542098Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/03/09 03:52 PM, ID: 23543684Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/03/09 03:52 PM, ID: 23543687Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02/03/09 05:38 PM, ID: 23544275Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02/04/09 10:02 AM, ID: 23551120Expert Comment

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92 - Hierarchy / EE_QW_3_20080625