Select to view content in your preferred language

Inserting newlines in metadata text

543
2
01-04-2019 01:38 AM
AxelThomas
Regular Contributor

I am editing metadata via a VB.NET Addin. Update information comes from ASCII files and I am and looking for a way to insert new lines.

In this simple example the ASCII text provided might look like: "Administrator: Person A" 

Using the IXmlPropertySet2 interfacemy code looks something like this:

Dim sName As String = "mdContact/rpPosName"
Dim sValue As Object = "Administrator:  \r\n  Person A"            'update string with escape sequence added
XmlPropertySet2.SetPropertyX(sName, sValue, esriXmlPropertyType.esriXPTText,  esriXmlSetPropertyAction.esriXSPAAddOrReplace, False)

Setting the property type to esriXPTText suggests that the value parameter (sValue in this example) should be a string. However any escape characters inserted in the string are not interpreted correctly and instead are shown as normal text in the metadata viewer. Being at a loss what the correct escape character might be I tried quite a variety: <\r\n>    &lt;br&gt;,    &#013;   &#10;  <br>  \r\n

I have seen the somewhat similar thread     https://community.esri.com/thread/213315-new-line-in-metadata-summary-description but this does not fit my problem.
Any ideas how to insert new lines?

2 Replies
DuncanHornby
MVP Notable Contributor

Just an idea, no idea if it will work, have you tried the vb constant vbNewLine?

0 Kudos
AxelThomas
Regular Contributor

Duncan,

thanks for the input but vbNewLine (or vbCrLf for that matter) will not work. I alredy thought to use <br> (the interface is called XmlPropertySet after all) but I am not very versed with xml and did not make it work either. Any other ideas?

0 Kudos