Solved

New to XML: How to create a Text field

Posted on 2006-10-20
7
291 Views
Last Modified: 2012-05-05
Hi.  This question is worth so much because it is urgent, and I don't suspect it is difficult.  I am using FedEx shipmanager's export feature to export tracking data into a csv.  An xml file is used to do the export.  Although the inlcuded wizard makes it easy to map certain fedex db fields to certain new fields for export, there is no way to insert a field which must be the same each time.  That is, one field, called "Gateway" needs to say "FedEx" every time a new record is written to the csv.  I don't know how to do that with XML.  I have included the field in the header, so each time i try to export, null gets exported to that column, but that's as far as I've gotten.  Please help!

Here is the current doc:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<profile intergrationtype="1" hostlanguage="0" hosttype="0" completed="True" profileversion="0224.01">
  <name>my_export</name>
  <date>10/20/2006 2:24:29 PM</date>
  <datasource>
    <name>C:\Documents and Settings\FedEx\tracking-export.csv</name>
    <provider>#Internal#</provider>
    <datasourceinformation type="2">C:\Documents and Settings\FedEx\tracking-export.csv</datasourceinformation>
    <table delimiter="," header="1">
    <field name="TrackingNumber" type="0" ordinal="0" screenviewtype="0"/>
    <field name="Gateway" type="0" ordinal="1" screenviewtype="0"/>
    <field name="ShippingMethodID" type="0" ordinal="2" screenviewtype="0"/>
    <field name="OrderID" type="0" ordinal="3" screenviewtype="0"/>
    </table>
    <command activate="4" type="1" screenviewtype="0">
    <table name="tracking-export.csv" alias="tracking-export.csv" delimiter="," header="1" tabletype="0">
    <field name="OrderID" alias="OrderID" type="0" ordinal="3" screenviewtype="0">
    <id>25</id>
    <fename>Customer Reference</fename>
    <key>25Package</key>
    <fetype>0</fetype>
    <fesize>39</fesize>
    <category>Package</category>
    <fegroup>Miscellaneous</fegroup>
    <shipmentlevel>.Reference</shipmentlevel>
    <packagelevel>.Reference</packagelevel>
    <mpscollection>True</mpscollection>
    </field>
    <field name="ShippingMethodID" alias="ShippingMethodID" type="0" ordinal="2" screenviewtype="0">
    <id>1274</id>
    <fename>Service Type</fename>
    <key>1274Package</key>
    <fetype>1</fetype>
    <fesize>2</fesize>
    <category>Package</category>
    <fegroup>Miscellaneous</fegroup>
    <conversiongroup>servicetypes</conversiongroup>
    <shipmentlevel>.ServiceType</shipmentlevel>
    <packagelevel>.ServiceType</packagelevel>
    <conversion>
    <select value="154">1 - Priority Overnight</select>
    <select value="153">5 - Standard Overnight</select>
    <select value="152">3 - 2 Day</select>
    <select value="153">6 - First Overnight</select>
    <select value="151">20 - Express Saver</select>
    <select value="500">92 - Ground</select>
    <select value="500">90 - Ground Home Delivery</select>
    </conversion>
    </field>
    <field name="TrackingNumber" alias="TrackingNumber" type="0" ordinal="0" screenviewtype="0">
    <id>29</id>
    <fename>Tracking Number</fename>
    <key>29TrackingNumber</key>
    <fetype>0</fetype>
    <fesize>15</fesize>
    <category>Tracking Number</category>
    <fegroup>Tracking Number</fegroup>
    <shipmentlevel>.TrackingNumber</shipmentlevel>
    <packagelevel>.TrackNo</packagelevel>
    </field>
    </table>
    <field screenviewtype="0">
    <id>29</id>
    <fename>Tracking Number</fename>
    <key>29TrackingNumber</key>
    <fetype>0</fetype>
    <fesize>15</fesize>
    <category>Tracking Number</category>
    <fegroup>Tracking Number</fegroup>
    <occurrence>1</occurrence>
    <shipmentlevel>.TrackingNumber</shipmentlevel>
    <packagelevel>.TrackNo</packagelevel>
    </field>
    <field screenviewtype="0">
    <id>25</id>
    <fename>Customer Reference</fename>
    <key>25Package</key>
    <fetype>0</fetype>
    <fesize>39</fesize>
    <category>Package</category>
    <fegroup>Miscellaneous</fegroup>
    <occurrence>1</occurrence>
    <shipmentlevel>.Reference</shipmentlevel>
    <packagelevel>.Reference</packagelevel>
    <mpscollection>True</mpscollection>
    </field>
    <field screenviewtype="0">
    <id>1274</id>
    <fename>Service Type</fename>
    <key>1274Package</key>
    <fetype>1</fetype>
    <fesize>2</fesize>
    <category>Package</category>
    <fegroup>Miscellaneous</fegroup>
    <conversiongroup>servicetypes</conversiongroup>
    <occurrence>1</occurrence>
    <shipmentlevel>.ServiceType</shipmentlevel>
    <packagelevel>.ServiceType</packagelevel>
    </field>
    </command>
  </datasource>
</profile>
0
Comment
Question by:hologos2357
  • 3
  • 3
7 Comments
 
LVL 35

Expert Comment

by:YZlat
ID: 17776459
what do you use to export the field?
0
 

Author Comment

by:hologos2357
ID: 17776764
I don't know.  Would it be an xml file too?  If not, I'm not sure I can access where the transform happens, but export occurs every time I click the ship button in my FedEx software.

Thanks
0
 
LVL 11

Expert Comment

by:kmartin7
ID: 17777073
It is hard to provide a solution without knowing the following:

* An XSLT that the software uses to create the XML
* If there isn't an XSLT, then you will have to post-process each file with a separate XSLT. Is this an option?

If the latter is an option, I can probably whip up an example XSLT for you.

Kurt
0
Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

 

Author Comment

by:hologos2357
ID: 17778904
I searched the fedex dir.  There are no xslt docs, but there are a few .xsl.  I was thinking there had to be a way to insert a text value regardless of the transform.  Is that wrong?  I don't think I can process it after it has been tranformed, or if there is a way I have no idea how.  If I am totally wrong about this, let me know.

Thanks!
0
 
LVL 11

Accepted Solution

by:
kmartin7 earned 500 total points
ID: 17779164
Is there a way to insert the text value regardless of the transform? I really have no idea not being familiar with the application. But a simple modification to one (or more) of the XSL files may easily correct your problem.

There are ways to post-process your XML, but it requires some manual intervention for each file OR you can automate with a simple application. Again, not knowing anything about your environment and how the current process works, it is difficult for me to provide a good answer.

Can you view the XSL documents? If so, are they copyrighted or protected by some other means? Maybe we can help you if you can post some snippets of the XSL code that you think might relate to your specific problem.

Thanks,

Kurt
0
 

Author Comment

by:hologos2357
ID: 17859313
Messing with the XSL was the way to go.

Thanks!
0
 
LVL 11

Expert Comment

by:kmartin7
ID: 17859397
Cool. Is it working well?
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question