I am working on a application that is reading in information from a excel file and updating a XML file with the data.
The XML file is in a specific fomat, that I want to keep after I modify it with the data from the Excel spreadsheet.
I am able to read in and modify that particular parameters of interest, however the new XML generated is of a generic XML file format that is unusable for another application.
I want to modify the XML file, but keep its original XML format.
I don't see any difference between those two formats. Could you explain in a bit more detail what you think your problem is?
Joined: May 01, 2009
The original XML file begins with :
<?xml version="1.0" standalone="no"?>
<!DOCTYPE entity PUBLIC "-//UC Berkeley//DTD MoML 1//EN"
With the Property tags defined as <property name=>
For example :
<property name="_createdBy" class="ptolemy.kernel.attributes.VersionAttribute" value="8.0.1">
While the new XML file begins with :
<?xml version="1.0" encoding="UTF-8" standalone="no"?><entity class="ptolemy.actor.TypedCompositeActor" name="vehiclemodel_2">
Its property tags are defined as :
<property class="ptolemy.kernel.attributes.VersionAttribute" name="_createdBy" value="8.0.1">
I am using a program name Ptolemy simulation engine to process information, that will use this XML file.
However, when the XML file is modified this makes the XML file unable to be used by the Ptolemy software.
Well, the output document declares its encoding and the input document doesn't, but that's not a significant difference according to XML. And the attributes in the output document are in a different order to the attributes in the input document, but again that's not a significant difference either.
So you're going to have to find out from this Ptolemy product exactly what its problem is.
Joined: May 01, 2009
I would like to know when I modify a attribute in a XML, is it possible to keep the original format of the XML file.
Yes, it is. And as I explained, you are in fact doing that.
Remember that XML specifies the meaning of a document, and that many different documents may have the same meaning. For example section 3.1 of the XML Recommendation says
Note that the order of attribute specifications in a start-tag or empty-element tag is not significant.
In other words, two documents which differ only in the order of attributes in an element mean the same thing and must be treated as if they were equivalent. Software which requires a particular order of attributes is in violation of the XML Recommendation.
So I say again, if you're dealing with XML you don't have a problem. Some other software may have a problem, but then it's not XML-compliant.