Posted 15 years ago
by Joachim Schwieren

Hi,
I have declared an HTML language and want to use a separate PHP language as child language that is applied when <? ... ?> appears in the HTML code.
I have embedded the child language as follows:This works nice but when I have a PHP code snippet that uses the EndScope inside, the language is changed back to HTML. Here is an example:
When the parser comes to encoding=\"utf-8\"?> it assumes that the child language ends here but this is not the case since the ?> is inside a string scope of the PHP language.
How can I get this working?
Thanks and best regards,
Joe
I have declared an HTML language and want to use a separate PHP language as child language that is applied when <? ... ?> appears in the HTML code.
I have embedded the child language as follows:
<State Key="ProcessingInstructionState" Filename="PHP.xml" ChildLanguageBackColor="WhiteSmoke">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" TokenKey="ProcessingInstructionStartToken" Style="ProcessingInstructionDelimiterStyle" PatternValue="<?" />
<ExplicitPatternGroup Type="EndScope" TokenKey="ProcessingInstructionEndToken" Style="ProcessingInstructionDelimiterStyle" PatternValue="?>" />
</Scope>
</Scopes>
</State>
<div>
<?
echo("Everything is ok here");
define("xml_field","<?xml version=\"1.0\" encoding=\"utf-8\"?><modules>");
echo("The line above causes the problem");
?>
</div>
How can I get this working?
Thanks and best regards,
Joe