View Single Post
  #3 (permalink)  
Old August 3rd, 2009, 11:36 PM
archleader archleader is offline
Registered User
 
Join Date: Aug 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi ,
I will describe it to you properly.
I have Three XML files:
Simple.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ip-tests SYSTEM "IPTestingTestImport.dtd">
<ip-tests locale-id="1033">
   <test>
      <test-setup>
         <test-title>Sample</test-title>
         <cost/>
         <serial-number>Infosys</serial-number>
         <version>1.0</version>
         <description>Sample</description>
         <instructions>Instructions will go here</instructions>
         <test-confidentiality>Confidentiality agreement </test-confidentiality>
         <item-delivery-order-type type="3"/>
         <is-navigation-allowed type="Y"/>
         <section-header-display-option type="1"/>
         <beta-item-feedback enable="N"/>
         <authoring-public-or-restricted type="restricted"/>
         <is-proctor-required value="Y"/>
         <test-start-time year="2008" month="01" day="01" hour="00" minute="00" second="00"/>
         <test-end-time year="2008" month="12" day="31" hour="23" minute="59" second="59"/>
         <is-public value="Y"/>
         <max-attempts-qty attempts="3" timeframe="per-year"/>
         <time-limit hour="01" minute="00" show-timer="Y"/>
         <score-not-map type="2"/>
         <passing-score-percent value="0"/>
         <immed-feedback-type id="1"/>
         <final-feedback-type id="1"/>
         <section-score-package type="8"/>
         <is-candidate-emailed value="Y"/>
         <screen-size type="3"/>
      </test-setup>
      <section>
         <section-name>Sample</section-name>
         <is-required-section-pass value="N"/>
         <cut-score-percent>0</cut-score-percent>
         <optional-items-delivered>3</optional-items-delivered>

         <item type="2">
            <short-description>2978722793224950</short-description>
            <item-serial-number>2978722793224950</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Which are the cities in which Infosys works
</stem>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;MonteCarlo</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Fremont</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Hawaii</distractor-text>
            </distractor>
         </item>

         <item type="2">
            <short-description>0909444436900545</short-description>
            <item-serial-number>0909444436900545</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Corporate office of Infosys is located in ___________ DC?
</stem>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Mysore</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Bangalore</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Pune</distractor-text>
            </distractor>
         </item>

         <item type="2">
            <short-description>8659275491970383</short-description>
            <item-serial-number>8659275491970383</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
What are the domains in which Infosys works?
</stem>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Disease diagonsis</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Banking</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;Genomics</distractor-text>
            </distractor>
         </item>

      </section>
   </test>
</ip-tests>
medium.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ip-tests SYSTEM "IPTestingTestImport.dtd">
<ip-tests locale-id="1033">
   <test>
      <test-setup>
         <test-title>Sample</test-title>
         <cost/>
         <serial-number>Infosys</serial-number>
         <version>1.0</version>
         <description>Sample</description>
         <instructions>Instructions will go here</instructions>
         <test-confidentiality>Confidentiality agreement </test-confidentiality>
         <item-delivery-order-type type="3"/>
         <is-navigation-allowed type="Y"/>
         <section-header-display-option type="1"/>
         <beta-item-feedback enable="N"/>
         <authoring-public-or-restricted type="restricted"/>
         <is-proctor-required value="Y"/>
         <test-start-time year="2008" month="01" day="01" hour="00" minute="00" second="00"/>
         <test-end-time year="2008" month="12" day="31" hour="23" minute="59" second="59"/>
         <is-public value="Y"/>
         <max-attempts-qty attempts="3" timeframe="per-year"/>
         <time-limit hour="01" minute="00" show-timer="Y"/>
         <score-not-map type="2"/>
         <passing-score-percent value="0"/>
         <immed-feedback-type id="1"/>
         <final-feedback-type id="1"/>
         <section-score-package type="8"/>
         <is-candidate-emailed value="Y"/>
         <screen-size type="3"/>
      </test-setup>
      <section>
         <section-name>Sample</section-name>
         <is-required-section-pass value="N"/>
         <cut-score-percent>0</cut-score-percent>
         <optional-items-delivered>2</optional-items-delivered>

         <item type="2">
            <short-description>4538299758315200</short-description>
            <item-serial-number>4538299758315200</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Infosys is stands at CMM level?
</stem>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;10</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;5</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;4</distractor-text>
            </distractor>
         </item>

         <item type="2">
            <short-description>6321098294899716</short-description>
            <item-serial-number>6321098294899716</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Infosys was started in 1981 in pune
</stem>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;TRUE</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;FALSE</distractor-text>
            </distractor>
         </item>

      </section>
   </test>
</ip-tests>
Complex.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ip-tests SYSTEM "IPTestingTestImport.dtd">
<ip-tests locale-id="1033">
   <test>
      <test-setup>
         <test-title>Sample</test-title>
         <cost/>
         <serial-number>Infosys</serial-number>
         <version>1.0</version>
         <description>Sample</description>
         <instructions>Instructions will go here</instructions>
         <test-confidentiality>Confidentiality agreement </test-confidentiality>
         <item-delivery-order-type type="3"/>
         <is-navigation-allowed type="Y"/>
         <section-header-display-option type="1"/>
         <beta-item-feedback enable="N"/>
         <authoring-public-or-restricted type="restricted"/>
         <is-proctor-required value="Y"/>
         <test-start-time year="2008" month="01" day="01" hour="00" minute="00" second="00"/>
         <test-end-time year="2008" month="12" day="31" hour="23" minute="59" second="59"/>
         <is-public value="Y"/>
         <max-attempts-qty attempts="3" timeframe="per-year"/>
         <time-limit hour="01" minute="00" show-timer="Y"/>
         <score-not-map type="2"/>
         <passing-score-percent value="0"/>
         <immed-feedback-type id="1"/>
         <final-feedback-type id="1"/>
         <section-score-package type="8"/>
         <is-candidate-emailed value="Y"/>
         <screen-size type="3"/>
      </test-setup>
      <section>
         <section-name>Sample</section-name>
         <is-required-section-pass value="N"/>
         <cut-score-percent>0</cut-score-percent>
         <optional-items-delivered>2</optional-items-delivered>

         <item type="2">
            <short-description>3982789083708366</short-description>
            <item-serial-number>3982789083708366</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Infosys is stands at CMM level?
</stem>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;10</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;5</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;4</distractor-text>
            </distractor>
         </item>

         <item type="2">
            <short-description>6773019533893213</short-description>
            <item-serial-number>6773019533893213</item-serial-number>
            <item-status value="normal"/>
            <is-mandatory value="N"/>
            <label-type value="2"/>
            <points-possible value="1"/>
            <display-properties type="2"/>
            <display-position value="2"/>
            <raw-html value="0"/>
            <stem>&lt;font face="Arial" size="3"&gt;
Infosys was started in 1981 in pune
</stem>
            <distractor>
               <points-possible value="1"/>
               <is-correct value="Y"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;TRUE</distractor-text>
            </distractor>
            <distractor>
               <points-possible value="0"/>
               <is-correct value="N"/>
               <distractor-text>&lt;font face="Arial" size="3"&gt;FALSE</distractor-text>
            </distractor>
         </item>

      </section>
   </test>
</ip-tests>
I have to take out data of only <sequense></sequense> tag with tag from medium.xml and complex.xml and add it to within Simple.xml as a single consolidate file,while keeping rest of the data of Simple.xml file as it is.

Regards,
Reply With Quote