Solved

New to XML: How to create a Text field

Posted on 2006-10-20
7
290 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

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