creating 1000 xml files with different values agn and agn

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Madhu Harchandani
    New Member
    • Mar 2008
    • 1

    creating 1000 xml files with different values agn and agn

    Hello
    i am working in a project in which i am using xnat technology in that data is entered through xml files only i need to enter 1000 records .so it is very cumbersome to create 1000 xml files So i need a simple way so that i can create and insert 1000 records in xnat database

    this is the xml file which i want to generate again and again with some different values Plz could someone helps me get over this problem



    <?xml version="1.0" encoding="UTF-8"?>
    <!--Sample XML file generated by XMLSPY v2004 rel. 3 U (http://www.xmlspy.com)-->
    <Subject xmlns="http://nrg.wustl.edu/xnat" xmlns:xnat="htt p://nrg.wustl.edu/xnat" xmlns:prov="htt p://www.nbirn.net/prov" xmlns:xdat="htt p://nrg.wustl.edu/xdat" xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocat ion="http://nrg.wustl.edu/xnat ../src/schemas/xnat/xnat.xsd" ID="XNAT004">

    <investigator >
    <title>Dr</title>
    <firstname>Rich ard</firstname>
    <lastname>Josep h</lastname>
    <institution>WU STL</institution>
    <department>DEN TAL</department>
    <email>w.s@emai l.com</email>
    <phone>314-452-8977</phone>
    </investigator>
    <demographics xsi:type="xnat: demographicData ">
    <dob>1976-07-03</dob>
    <gender>femal e</gender>
    <handedness>lef t</handedness>
    </demographics>
    <experiments>
    <experiment xsi:type="xnat: mrSessionData" ID="XNAT005_MR1 " session_type="B est Ever">
    <date>1999-08-13</date>
    <time>14:20:0 0-05:00</time>
    <note>String</note>
    <investigator ID="1">
    <xnat:title>D r</xnat:title>
    <xnat:firstname >Richard</xnat:firstname>
    <xnat:lastname> Joseph</xnat:lastname>
    <xnat:instituti on>WUSTL</xnat:institutio n>
    <xnat:departmen t>DENTAL</xnat:department >
    <xnat:email>w.s @email.com</xnat:email>
    <xnat:phone>3 14-452-8977</xnat:phone>
    </investigator>
    <validation status="COMPLET E">
    <method>Scrip t</method>
    <date>1999-08-13</date>
    <notes>None</notes>
    </validation>
    <subject_ID>XNA T004</subject_ID>
    <scanner>Scanne r 1</scanner>
    <marker>Marke r 1</marker>
    <stabilization> Stabilization 1</stabilization>
    <operator>Opera tor 1</operator>
    <prearchivePath >pre_archive</prearchivePath>
    <scans>
    <xnat:scan ID="XNAT005_MR1 _SCAN1" type="MPRAGE">
    <xnat:note>3</xnat:note>
    <xnat:quality>u sable</xnat:quality>
    <xnat:parameter s>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.25"/>
    <xnat:orientati on>Sag</xnat:orientatio n>
    <xnat:fov x="256" y="256"/>
    <xnat:matrix x="224" y="256"/>
    <xnat:partition s>0</xnat:partitions >
    <xnat:tr>9.7</xnat:tr>
    <xnat:te>4.0</xnat:te>
    <xnat:ti>20.0 </xnat:ti>
    <xnat:flip>10 </xnat:flip>
    <xnat:sequence> mpr_ns_t1_4b195 .wkc</xnat:sequence>
    <xnat:origin>CA P/CAP_MPRAGEx2.pr g</xnat:origin>
    <xnat:scanTime> 16:04:09</xnat:scanTime>
    </xnat:parameters >
    <xnat:file cachePath="cach e_archive_path" content="MPRAGE _RAW" format="IMA" URI="XNAT003_MR 1_SCAN1/RAW/114-5-440.ima" xsi:type="xnat: imageResource">

    <xnat:dimension s volumes="1" x="256" y="256" z="128"/>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.25"/>
    <xnat:orientati on>Sag</xnat:orientatio n>
    </xnat:file>
    <xnat:validatio n>
    <xnat:method>ar c_validate</xnat:method>
    <xnat:date>20 05-12-02</xnat:date>
    </xnat:validation >
    </xnat:scan>
    <xnat:scan ID="XNAT005_MR1 _SCAN2" type="MPRAGE">
    <xnat:note>4</xnat:note>
    <xnat:quality>u sable</xnat:quality>
    <xnat:parameter s>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.25"/>
    <xnat:orientati on>Sag</xnat:orientatio n>
    <xnat:fov x="256" y="256"/>
    <xnat:matrix x="224" y="256"/>
    <xnat:partition s>0</xnat:partitions >
    <xnat:tr>9.7</xnat:tr>
    <xnat:te>4.0</xnat:te>
    <xnat:ti>20.0 </xnat:ti>
    <xnat:flip>10 </xnat:flip>
    <xnat:sequence> mpr_ns_t1_4b195 .wkc</xnat:sequence>
    <xnat:origin>CA P/CAP_MPRAGEx2.pr g</xnat:origin>
    <xnat:scanTime> 16:10:47</xnat:scanTime>
    </xnat:parameters >
    <xnat:file cachePath="cach e_archive_path" content="MPRAGE _RAW" format="IMA" URI="XNAT003_MR 1_SCAN1/RAW/114-6-568.ima" xsi:type="xnat: imageResource">

    <xnat:dimension s volumes="1" x="256" y="256" z="128"/>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.25"/>
    <xnat:orientati on>Sag</xnat:orientatio n>
    </xnat:file>
    <xnat:validatio n>
    <xnat:method>ar c_validate</xnat:method>
    <xnat:date>20 05-12-02</xnat:date>
    </xnat:validation >
    </xnat:scan>
    </scans>
    <reconstruction s>
    <reconstructedI mage ID="XNAT005_MR1 _RECON1" baseScanType="M PRAGE" type="MPRAGE">
    <inScans>
    <scanID>XNAT005 _MR1_SCAN1</scanID>
    </inScans>
    <in>
    <xnat:file cachePath="cach e_archive_path" content="MPRAGE _RAW" format="IMA" URI="XNAT005_MR 1_SCAN1/RAW/114-5-440.ima" xsi:type="xnat: imageResource">

    <xnat:dimension s volumes="1" x="256" y="256" z="128"/>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.25"/>
    <xnat:orientati on>Sag</xnat:orientatio n>
    </xnat:file>
    </in>
    <out>
    <xnat:file content="GFC" format="ANALYZE " URI="XNAT003_MR 1_SCAN1/PROCESSED/MPRAGE/T88_111/XNAT003_MR1_SCA N1_mpr_n4_111_t 88_gfc.img" xsi:type="xnat: imageResource">

    <xnat:dimension s volumes="1" x="176" y="208" z="176"/>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.0"/>
    <xnat:orientati on>Tra</xnat:orientatio n>
    </xnat:file>
    <xnat:file content="T88" format="IFH" URI="XNAT003_MR 1_SCAN1/PROCESSED/MPRAGE/T88_111/XNAT003_MR1_SCA N1_mpr_n4_111_t 88.4dfp.img" xsi:type="xnat: imageResource">

    <xnat:dimension s volumes="1" x="176" y="208" z="176"/>
    <xnat:voxelRe s units="mm" x="1.0" y="1.0" z="1.0"/>
    <xnat:orientati on>Tra</xnat:orientatio n>
    </xnat:file>
    </out>
    </reconstructedIm age>
    </reconstructions >
    </experiment>
    </experiments>
    </Subject>
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    #2
    I'm not sure what database type you're using, but you may want to try using BULK LOAD.

    How are you currently loading your xml into your database?

    Comment

    Working...