Solved

New to XML: How to create a Text field

Posted on 2006-10-20
7
286 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
Comment Utility
what do you use to export the field?
0
 

Author Comment

by:hologos2357
Comment Utility
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
Comment Utility
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 

Author Comment

by:hologos2357
Comment Utility
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
Comment Utility
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
Comment Utility
Messing with the XSL was the way to go.

Thanks!
0
 
LVL 11

Expert Comment

by:kmartin7
Comment Utility
Cool. Is it working well?
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now