Solved

New to XML: How to create a Text field

Posted on 2006-10-20
7
292 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 

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

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 …
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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