<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SimpleTextParser next method throws AccessViolationException in ArcGIS 10.2.2 in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623949#M16788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much Ahmed, that works great!&amp;nbsp; I've tested in 10.4, will confirm once I've run it in 10.2.2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't have thought of initialising the text symbol property, is there something in the documentation that would hint at that or is that standard practice I'm not aware of?&amp;nbsp; I'd have expected the parser class to initialise it's own properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can now parse the string but textparserClass doesn't seem to give any indication once it's parsed the last tag? &lt;/P&gt;&lt;P&gt;The Next method doesn't return an enumeration I can loop through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jun 2016 14:14:12 GMT</pubDate>
    <dc:creator>deleted-user-AYsXjhkrwuAA</dc:creator>
    <dc:date>2016-06-21T14:14:12Z</dc:date>
    <item>
      <title>SimpleTextParser next method throws AccessViolationException in ArcGIS 10.2.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623947#M16786</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm trying to use the &lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/componenthelp/index.html#//001w000003t0000000" rel="nofollow noopener noreferrer" target="_blank"&gt;SimpleTextParser class&lt;/A&gt; to parse text from the map layout that contains text formatting tags.&amp;nbsp; e.g. a string of &amp;lt;ITA&amp;gt;Data Sources&amp;lt;/ITA&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;SimpleTextParser formattingTextParser = new SimpleTextParser();
Boolean bHasTags = false;
formattingTextParser.Text = pTextElement.Text;
formattingTextParser.HasTags(ref bHasTags);
if (bHasTags)
&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; At this point the textsymbol property is null on the text parser.&amp;nbsp; Parse text formatting. 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.Next();
&amp;nbsp;&amp;nbsp;&amp;nbsp; string formattedText&amp;nbsp; = formattingTextParser.TextSymbol.Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can successfully identify that the text contains tags, but when I try to parse these using the next method a System.AccessViolationException is thrown. Where am I going wrong? &lt;BR /&gt;&lt;BR /&gt;The only other reference I can see&amp;nbsp; in the forums is &lt;A _jive_internal="true" href="https://community.esri.com/thread/38230?q=simpletextparser" target="_blank"&gt;another unhandled exception with this class&lt;/A&gt;. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:35:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623947#M16786</guid>
      <dc:creator>deleted-user-AYsXjhkrwuAA</dc:creator>
      <dc:date>2021-12-12T02:35:01Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleTextParser next method throws AccessViolationException in ArcGIS 10.2.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623949#M16788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks very much Ahmed, that works great!&amp;nbsp; I've tested in 10.4, will confirm once I've run it in 10.2.2. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wouldn't have thought of initialising the text symbol property, is there something in the documentation that would hint at that or is that standard practice I'm not aware of?&amp;nbsp; I'd have expected the parser class to initialise it's own properties.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can now parse the string but textparserClass doesn't seem to give any indication once it's parsed the last tag? &lt;/P&gt;&lt;P&gt;The Next method doesn't return an enumeration I can loop through.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jun 2016 14:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623949#M16788</guid>
      <dc:creator>deleted-user-AYsXjhkrwuAA</dc:creator>
      <dc:date>2016-06-21T14:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleTextParser next method throws AccessViolationException in ArcGIS 10.2.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623950#M16789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just discover this through troubleshooting, it shouldn't be the default behavior.&lt;/P&gt;&lt;P&gt;and i didn't find any indication when the last tag is parsed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also get your parser when you cast your text symbol to &lt;A href="http://help.arcgis.com/en/sdk/10.0/ArcObjects_NET/ComponentHelp/index.html#/ITextParserSupport_Interface/001w0000038v000000/"&gt;ITextParserSupport &lt;/A&gt;interface.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jun 2016 06:53:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623950#M16789</guid>
      <dc:creator>AhmedEl-Sisi</dc:creator>
      <dc:date>2016-06-23T06:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: SimpleTextParser next method throws AccessViolationException in ArcGIS 10.2.2</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623948#M16787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andrew,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just try to initialize your Text Symbol before calling Next Method like the following:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ITextParser formattingTextParser = new SimpleTextParserClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Boolean bHasTags = false;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Initialize your Text Symbol
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.TextSymbol = new TextSymbolClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.Text = "&amp;lt;CLR red=\"255\" green=\"255\" blue=\"255\"&amp;gt;My text&amp;lt;/CLR&amp;gt;";
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.Reset();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.HasTags(ref bHasTags);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (bHasTags)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; At this point the textsymbol property is null on the text parser.&amp;nbsp; Parse text formatting.&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formattingTextParser.Next();
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string formattedText = formattingTextParser.TextSymbol.Text;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;P dir="ltr"&gt;&lt;/P&gt;&lt;P dir="ltr"&gt;Cheers,&lt;/P&gt;&lt;P dir="ltr"&gt;Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 02:35:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/simpletextparser-next-method-throws/m-p/623948#M16787</guid>
      <dc:creator>AhmedEl-Sisi</dc:creator>
      <dc:date>2021-12-12T02:35:05Z</dc:date>
    </item>
  </channel>
</rss>

