• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

exporting an xml file from excel

I have an excel file that has an xml map (xsd) and I am exporting the information keyed in excel into an xml format.  One of the fields is company name and the name I am using is 'COMPANY & COMPANY NAME'.  When this xml file is uploaded to the outside source the company name fails to match the company name they have.  I am told this is because of the &.  How do I handle this?  Does the xsd need to be changed?  
0
cogc_it
Asked:
cogc_it
  • 3
  • 3
1 Solution
 
theKashyapCommented:
"&" is not an allowed character in XML value.

If you have & in your source xml, then it must be represented as it's
entity reference & as & is a special character in xml reserved to
indicate the beginning of character/entity references such as '
" etc If you have '&' on its own then you are not dealing with xml,
so you need to look at whats producing this made-up syntax and fix it.


So while exporting the XML convert all "&" to "&amp" or "and".
If this is not possible for you there is some special syntax to specify strings in XML, which I would have to look up. But even that would require a similar change as converting to &amp or and. Let me know.
0
 
cogc_itAuthor Commented:
The name of our company has '&' in it and the company name must be included in the xml file.  How would I turn this into a string to make a valid xml file?
0
 
theKashyapCommented:
How are you doing the export? Do you have some VB macro..?
Can you post one sample excel?
0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 
cogc_itAuthor Commented:
I found that if you used CDATA you can work with the &.  However, the company receiving the xml file is modifing there xml parse to handle the &.  Thanks for your help
0
 
theKashyapCommented:
Great..
CDATA is exactly what I meant by this "for you there is some special syntax to specify strings in XML".
0
 
cogc_itAuthor Commented:
I found the answer myself and also the company receiving the xml file modified their xml parse to handle the situation
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now