Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Modifying Format/Structure of XML File

From: "Joe Fawcett" <joefawcett@---------.------>
To: NULL
Date: 3/2/2006 8:56:00 AM
"Roger" <Roger@d...> wrote in message 
news:CD90D70B-E3F7-4E4C-B3EA-3FA3BB0BF5B4@m......
> "Joe Fawcett" wrote:
>
>> "Roger" <Roger@d...> wrote in message
>> news:70E5DC93-728A-42F0-BD4E-261F0544E1F6@m......
>> >I have data in Access 2003 that I want to import into another 
>> >application.
>> > The application requires a specific format to import XML files.  Below 
>> > are
>> > two samples.  The first shows the XML file that I get when I export 
>> > from
>> > Access.  The second shows the format I need.  What is the correct term 
>> > for
>> > making such a change and what tool should I use?
>> >
>> > Access Format:
>> > <JV_DOC_HDR>
>> >         <DOC_CD><JVA></DOC_CD>
>> >         <DOC_DEPT_CD><005></DOC_DEPT_CD>
>> >         <DOC_ID><OW01453963005></DOC_ID>
>> >         <DOC_VERS_NO><1></DOC_VERS_NO>
>> >      </JV_DOC_HDR>
>> >      <JV_DOC_LNGRP>
>> >         <DOC_CD><JVA></DOC_CD>
>> >         <DOC_DEPT_CD><005></DOC_DEPT_CD>
>> >         <DOC_ID><OW01453963005></DOC_ID>
>> >         <DOC_VERS_NO><1></DOC_VERS_NO>
>> >         <DOC_LNGRP_NO><24138607></DOC_LNGRP_NO>
>> >      </JV_DOC_LNGRP>
>> >      <JV_DOC_ACTG>
>> >         <DOC_CD><JVA></DOC_CD>
>> >         <DOC_DEPT_CD><005></DOC_DEPT_CD>
>> >         <DOC_ID><OW01453963005></DOC_ID>
>> >         <DOC_VERS_NO><1></DOC_VERS_NO>
>> >         <DOC_ACTG_NO><24138608></DOC_ACTG_NO>
>> >         <DOC_ACTG_LN_NO><1></DOC_ACTG_LN_NO>
>> >         <DOC_LNGRP_NO><24138607></DOC_LNGRP_NO>
>> >         <FUND_CD><0123></FUND_CD>
>> >         <DEPT_CD><005></DEPT_CD>
>> >         <ACTG_LN_DSCR><OUTDATED WARRANT WARRANT NUMBER = 01453963 ISSUE
>> > DATE = 06222005></ACTG_LN_DSCR>
>> >      </JV_DOC_ACTG>
>> >      <JV_DOC_ACTG>
>> >         <DOC_CD><JVA></DOC_CD>
>> >         <DOC_DEPT_CD><005></DOC_DEPT_CD>
>> >         <DOC_ID><OW01453963005></DOC_ID>
>> >         <DOC_VERS_NO><1></DOC_VERS_NO>
>> >         <DOC_ACTG_NO><24138609></DOC_ACTG_NO>
>> >         <DOC_ACTG_LN_NO><2></DOC_ACTG_LN_NO>
>> >         <DOC_LNGRP_NO><24138607></DOC_LNGRP_NO>
>> >         <FUND_CD><0123></FUND_CD>
>> >         <DEPT_CD><005></DEPT_CD>
>> >         <ACTG_LN_DSCR><OUTDATED WARRANT WARRANT NUMBER = 01453963 ISSUE
>> > DATE = 06222005></ACTG_LN_DSCR>
>> >      </JV_DOC_ACTG>
>> >
>> > Format Needed:
>> > <AMS_DOCUMENT DOC_CAT="JV" DOC_TYP="JV" DOC_CD="JVA" DOC_DEPT_CD="005"
>> > DOC_UNIT_CD="null" DOC_ID="OW01453963005" DOC_VERS_NO="1"
>> > AUTO_DOC_NUM="false" DOC_IMPORT_MODE="OE">
>> >      <JV_DOC_HDR AMSDataObject="Y">
>> >         <DOC_CD Attribute="Y"><![CDATA[JVA]]></DOC_CD>
>> >         <DOC_DEPT_CD Attribute="Y"><![CDATA[005]]></DOC_DEPT_CD>
>> >         <DOC_ID Attribute="Y"><![CDATA[OW01453963005]]></DOC_ID>
>> >         <DOC_VERS_NO Attribute="Y"><![CDATA[1]]></DOC_VERS_NO>
>> >      </JV_DOC_HDR>
>> >      <JV_DOC_LNGRP AMSDataObject="Y">
>> >         <DOC_CD Attribute="Y"><![CDATA[JVA]]></DOC_CD>
>> >         <DOC_DEPT_CD Attribute="Y"><![CDATA[005]]></DOC_DEPT_CD>
>> >         <DOC_ID Attribute="Y"><![CDATA[OW01453963005]]></DOC_ID>
>> >         <DOC_VERS_NO Attribute="Y"><![CDATA[1]]></DOC_VERS_NO>
>> >         <DOC_LNGRP_NO Attribute="Y"><![CDATA[24138607]]></DOC_LNGRP_NO>
>> >      </JV_DOC_LNGRP>
>> >      <JV_DOC_ACTG AMSDataObject="Y">
>> >         <DOC_CD Attribute="Y"><![CDATA[JVA]]></DOC_CD>
>> >         <DOC_DEPT_CD Attribute="Y"><![CDATA[005]]></DOC_DEPT_CD>
>> >         <DOC_ID Attribute="Y"><![CDATA[OW01453963005]]></DOC_ID>
>> >         <DOC_VERS_NO Attribute="Y"><![CDATA[1]]></DOC_VERS_NO>
>> >         <DOC_ACTG_NO Attribute="Y"><![CDATA[24138608]]></DOC_ACTG_NO>
>> >         <DOC_ACTG_LN_NO Attribute="Y"><![CDATA[1]]></DOC_ACTG_LN_NO>
>> >         <DOC_LNGRP_NO Attribute="Y"><![CDATA[24138607]]></DOC_LNGRP_NO>
>> >         <FUND_CD Attribute="Y"><![CDATA[0123]]></FUND_CD>
>> >         <DEPT_CD Attribute="Y"><![CDATA[005]]></DEPT_CD>
>> >         <ACTG_LN_DSCR Attribute="Y"><![CDATA[OUTDATED WARRANT WARRANT
>> > NUMBER = 01453963 ISSUE DATE = 06222005]]></ACTG_LN_DSCR>
>> >      </JV_DOC_ACTG>
>> >      <JV_DOC_ACTG AMSDataObject="Y">
>> >         <DOC_CD Attribute="Y"><![CDATA[JVA]]></DOC_CD>
>> >         <DOC_DEPT_CD Attribute="Y"><![CDATA[005]]></DOC_DEPT_CD>
>> >         <DOC_ID Attribute="Y"><![CDATA[OW01453963005]]></DOC_ID>
>> >         <DOC_VERS_NO Attribute="Y"><![CDATA[1]]></DOC_VERS_NO>
>> >         <DOC_ACTG_NO Attribute="Y"><![CDATA[24138609]]></DOC_ACTG_NO>
>> >         <DOC_ACTG_LN_NO Attribute="Y"><![CDATA[2]]></DOC_ACTG_LN_NO>
>> >         <DOC_LNGRP_NO Attribute="Y"><![CDATA[24138607]]></DOC_LNGRP_NO>
>> >         <FUND_CD Attribute="Y"><![CDATA[0123]]></FUND_CD>
>> >         <DEPT_CD Attribute="Y"><![CDATA[005]]></DEPT_CD>
>> >         <ACTG_LN_DSCR Attribute="Y"><![CDATA[OUTDATED WARRANT WARRANT
>> > NUMBER = 01453963 ISSUE DATE = 06222005]]></ACTG_LN_DSCR>
>> >      </JV_DOC_ACTG>
>> >      </AMS_DOCUMENT>
>> >
>> I think your best option would be to use an XSL transformation. This a 
>> piece
>> of declarative code which specifies how the input XML should be mapped to
>> the output.
>> It's not going to be easy to learn quickly so if you get stuck let us 
>> know.
>> (The XML in the first example is not well formed, for example
>> <JV_DOC_HDR>
>>         <DOC_CD><JVA></DOC_CD>
>>
>> JVA should probably be <JVA/>
>>
>> so post the actual XML if you need more help.
>>
>> -- 
>>
>> Joe Fawcett (MVP - XML)
>>
>> https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5
>>
>>
> I'm not even sure where to start to create a transformation.  I'm familiar
> with the term and that's about it.  Can you suggest a book or online 
> resource
> to get me started.  Also, I've heard of tools that allow you to manipulate
> various data files (Data Junction for example).
>
>
Anything written by Michael Kay would be good, he has a number of Wrox 
books, There is also a good one by J. Tennison also by Wrox.

I'm really tied up this morning but if I have time this afternoon I'll try 
to write an example transform.

I don't really use visual designers but I'm sure XMLSpy have a GUI designer 
where you can map fields from input to output, I think you can download a 
trial copy.

-- 

Joe Fawcett (MVP - XML)

https://mvp.support.microsoft.com/profile=8AA9D5F5-E1C2-44C7-BCE8-8741D22D17A5 




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent