views:

76

answers:

1

I have an XML Schema Definition file .XSD who's elements are in Spanish. I have an XML data file that is also in Spanish that matches the schema definition. I created a dataset from the xsd using xsd.exe and I'm loading the XML into the dataset.

I want to translate the element names to English. I can think of two options off the top of my head. Either scrape the XSD & XML files and translate the elements prior to generating the dataset with esd.exe, or iterate the dataset after I have loaded it with the xml, and translate my objects.

I do have a written document that provides the English names for every element name in Spanish. The problem is there are hundreds of elements and I was trying to avoid coding that manually. Getting precise translations is not that important, it just needs to be readable by an English speaking person.

Here is an example of what an element may look like "Apellidos":

<xs:element name="Apellidos" type="xs:string"/>

that I will translate to "SirName":

<xs:element name="SirName" type="xs:string"/>

I'm looking for ideas and or opinions on a quick way to do this. It's a one time deal so I'm not working about it scaling or being functional for things other than this single xml file.

I'll be taking this dataset and writing out a flat file for English speaking users to read.

A: 

Alright, I didn't find the answer that I was looking for. What I ended up doing was sending the XSD off to a person who could translate the elements to English for me. Then I created a dictionary class that represented the Spanish/English combos. I read the XML into the dataset and as I looped through each datacolumn to write my header row, I did a lookup on the column name to the translation dictionary to pull back the English phrase. It was painful but works like a champ.

Coov