Skip to main content

Hello everybody, I dont have any experience in handling XML and convertion into new xml schema. We have xml file metadata in arcgis enterprise geodatabase, this metadata is in ESRI metadata standard format. I can open this metadata in FME ,that's fine, but we want to convert this metadata into our own schema. We developed one meta´data schema based on INSPIRE and Datacite. For this conversion i have our schema in xml format, i really dont have any idea now which Transformers should I use now for this conversion and which files I require. I am looking for help in this circumstances.

Thanks

I'd start with the XMLTemplater. There's a good tutorial here that should get you started quickly, but feel free to ask if you have more questions.


I'd start with the XMLTemplater. There's a good tutorial here that should get you started quickly, but feel free to ask if you have more questions.

 

Thanks , I have added my featureclass (gdb) metadata in fme, now it is in esri format (the xml file of the metadata) and I want to convert it into a new schema (for this i have a schema xml file) what should i do,? should i go through the example as it is? Should I paste the whole new xml schema file inside the xml templator?

 


 

Thanks , I have added my featureclass (gdb) metadata in fme, now it is in esri format (the xml file of the metadata) and I want to convert it into a new schema (for this i have a schema xml file) what should i do,? should i go through the example as it is? Should I paste the whole new xml schema file inside the xml templator?

 

I think you should go through the tutorial once or twice just to get an idea of the process. If you have a schema document (.xsd) you can use the XMLSampleGenerator, in a seperate workspace, to generate an xml sample that you can put into the XMLTemplater. There you can add the FME attributes at the correct locations.

 

 

Depending on how the XML is structured you have to work with root and child templates though, it may still be a lengthy process to go through, which is why I would strongly recommend going through that tutorial.

 

 


I'd start with the XMLTemplater. There's a good tutorial here that should get you started quickly, but feel free to ask if you have more questions.

Ok, thanks once again. Can you please tell me how I can use xml_fragment ?? Because the complete xml file of ESRI format is inside that Column. and if I want to map this two schema I need to see all the elements (parent and child ) inside this xml_fragment..


Ok, thanks once again. Can you please tell me how I can use xml_fragment ?? Because the complete xml file of ESRI format is inside that Column. and if I want to map this two schema I need to see all the elements (parent and child ) inside this xml_fragment..

Write that xml_fragment to a new text file (maybe run it through an XMLFormatter set to pretty print first), then open that in a text editor, copy its contents and paste that into the XMLTemplater.

 

 


I'd start with the XMLTemplater. There's a good tutorial here that should get you started quickly, but feel free to ask if you have more questions.

 

I want to map now only xml_fragment elements to the right side XML template. As i cannot see the elements, so I cannot drag and drop individual elements.

 


Write that xml_fragment to a new text file (maybe run it through an XMLFormatter set to pretty print first), then open that in a text editor, copy its contents and paste that into the XMLTemplater.

 

 

 

I want to map now only xml_fragment elements to the right side XML template. As i cannot see the elements, so I cannot drag and drop individual elements.

 


 

I want to map now only xml_fragment elements to the right side XML template. As i cannot see the elements, so I cannot drag and drop individual elements.

 

Just for clarification:

 

What the XMLTemplater does is let you take a sample of what the XML is supposed to look like (either from a sample file or generated from an .xsd using the XMLSampleGenerator) and then put in attribute values.

 

 

So the steps you have to take are:

 

  1. Obtain a sample file or generate one using the XMLSampleGenerator. You would use the XMLSampleGenerator in a separate workspace and write out to an .xml file (using the TextLine writer).
  2. Copy the contents of that sample file in the XMLTemplater. Most likely the file will be structured as a root element which includes the header and footer and one or more child elements, which are repeated for every feature.
  3. In the template look for elements that match your attributes, then put in the attribute references there (doubleclick or drag and drop from the list on the left)
You mention you can't see the elements you're expecting. Can you elaborate on that? What would you expect to see there? Can you show the structure of your data?

 

 


Just for clarification:

 

What the XMLTemplater does is let you take a sample of what the XML is supposed to look like (either from a sample file or generated from an .xsd using the XMLSampleGenerator) and then put in attribute values.

 

 

So the steps you have to take are:

 

  1. Obtain a sample file or generate one using the XMLSampleGenerator. You would use the XMLSampleGenerator in a separate workspace and write out to an .xml file (using the TextLine writer).
  2. Copy the contents of that sample file in the XMLTemplater. Most likely the file will be structured as a root element which includes the header and footer and one or more child elements, which are repeated for every feature.
  3. In the template look for elements that match your attributes, then put in the attribute references there (doubleclick or drag and drop from the list on the left)
You mention you can't see the elements you're expecting. Can you elaborate on that? What would you expect to see there? Can you show the structure of your data?

 

 

I want to see the attributes inside xml_fragment, please see my screenshort. then i will map those elements to the template xml elements.

 

 

 

 


I want to see the attributes inside xml_fragment, please see my screenshort. then i will map those elements to the template xml elements.

 

 

 

 

xml_fragment contains the entire block of xml, if FME is reading your input data correctly it should have also created individual attributes of the contents of xml_fragment. Are there attributes that you know are in xml_fragment that are not in the list?

 

 

If that's the case, the XMLFragmenter or XMLFlattener may be useful (or you may want to check the reader settings)

 

 


Just for clarification:

 

What the XMLTemplater does is let you take a sample of what the XML is supposed to look like (either from a sample file or generated from an .xsd using the XMLSampleGenerator) and then put in attribute values.

 

 

So the steps you have to take are:

 

  1. Obtain a sample file or generate one using the XMLSampleGenerator. You would use the XMLSampleGenerator in a separate workspace and write out to an .xml file (using the TextLine writer).
  2. Copy the contents of that sample file in the XMLTemplater. Most likely the file will be structured as a root element which includes the header and footer and one or more child elements, which are repeated for every feature.
  3. In the template look for elements that match your attributes, then put in the attribute references there (doubleclick or drag and drop from the list on the left)
You mention you can't see the elements you're expecting. Can you elaborate on that? What would you expect to see there? Can you show the structure of your data?

 

 

 

Hello, I have able to map with my schema, but getting another trouble, I have 7 attribute field in my featureclass, and in metadata all the names and datatypes are coming inside one element one after another , see the following xml file example, look into

 

<bnr:dataSchema> and datatype, but i want all the 7 set seperately inside xml file...

 

 

 

<bnr:MD_DataSchema>

 

<bnr:column>

 

<bnr:MD_Column>

 

<bnr:name>

 

<gco:CharacterString>OBJECTID potlabel repetition soil_moist_hPa leafarea_cm2 number_of_leaves plantheight_cm</gco:CharacterString>

 

</bnr:name>

 

<bnr:description>

 

<gco:CharacterString/>

 

</bnr:description>

 

<bnr:dataType>

 

<gco:CharacterString>OID String Integer Integer Double Integer Integer</gco:CharacterString>

 

</bnr:dataType>

 


Looks like you'll need to use an AttributeSplitter to pull that apart and then manually create new attributes (using an AttributeManager for example).


Reply