Hi, According to Google, Placemaker ExtendedData format is below:
<ExtendedData>
<Data name="string">
<displayName>...</displayName> <!-- string -->
<value>...</value> <!-- string -->
</Data>
</ExtendedData>
When I use the tool, I get the following format:
<ExtendedData>
<SchemaData schemaUrl="#temp">
<SimpleData name="snippet"></SimpleData>
<SimpleData name="siteCount">1</SimpleData>
</SchemaData>
</ExtendedData>
how do I achieve correct format which is inline with google. I am using Aspose.GIS module
@ssinhaacma
To achieve the correct ExtendedData format that aligns with Google’s specifications, you need to ensure that your XML structure matches the expected format. The format you provided from Google is:
<ExtendedData>
<Data name="string">
<displayName>...</displayName> <!-- string -->
<value>...</value> <!-- string -->
</Data>
</ExtendedData>
However, the output you are currently getting is:
<ExtendedData>
<SchemaData schemaUrl="#temp">
<SimpleData name="snippet"></SimpleData>
<SimpleData name="siteCount">1</SimpleData>
</SchemaData>
</ExtendedData>
To modify your code to produce the desired format, you will need to change how you are constructing the XML. Here’s a simple example of how you might structure your code to generate the correct XML:
using System.Xml;
XmlDocument doc = new XmlDocument();
XmlElement extendedData = doc.CreateElement("ExtendedData");
XmlElement data = doc.CreateElement("Data");
data.SetAttribute("name", "string");
XmlElement displayName = doc.CreateElement("displayName");
displayName.InnerText = "Your Display Name"; // Set your display name here
data.AppendChild(displayName);
XmlElement value = doc.CreateElement("value");
value.InnerText = "Your Value"; // Set your value here
data.AppendChild(value);
extendedData.AppendChild(data);
doc.AppendChild(extendedData);
// Save or output the XML as needed
doc.Save("output.xml");
Make sure to replace "Your Display Name"
and "Your Value"
with the actual data you want to include. This should help you generate the XML in the format that Google expects. If you have any further questions or need additional assistance, feel free to ask!
I dont want to use XmDocument, I am using Aspose.Gis module
Hi, @ ssinhaacma
Welcome to our forum!
I need to explore your request. Could you please provide more details to reproduce issue?