Posted 20 years ago
by bnott
Hello,
I am extending the XML language you provide. Right now what I am trying to do is make certain tags, based on the tag name, be in a particular state. Is this the best way to do it?[ 10-25-2004: Message edited by: bnott ]
I am extending the XML language you provide. Right now what I am trying to do is make certain tags, based on the tag name, be in a particular state. Is this the best way to do it?
<State Key="MyStartTagState" Token="MyStartTagDefaultToken" Style="MyTagNameStyle">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="MyStartTagStartToken" Style="MyTagDelimiterStyle" PatternValue="<"
LookAhead="my:tag1|my:tag2|my:tag3" />
<RegexPatternGroup Type="EndScope" Token="MyStartTagEndToken" Style="MyTagDelimiterStyle" PatternValue="/? >" />
</Scope>
</Scopes>
<!-- Patterns Groups -->
<PatternGroups>
<RegexPatternGroup Token="MyStartTagNameToken" Style="MyTagNameStyle" LookAhead="{NonWordMacro}" PatternValue="{TagNameMacro}+" />
</PatternGroups>
<!-- Child States -->
<ChildStates>
<ChildState Key="MyStartTagAttributeState" />
</ChildStates>
</State>
<State Key="MyEndTagState" Token="MyEndTagDefaultToken" Style="MyTagNameStyle">
<!-- Scopes -->
<Scopes>
<Scope>
<ExplicitPatternGroup Type="StartScope" Token="MyEndTagStartToken" Style="MyTagDelimiterStyle" PatternValue="</"
LookAhead="my:tag1|my:tag2|my:tag3" " />
<ExplicitPatternGroup Type="EndScope" Token="MyEndTagEndToken" Style="MyTagDelimiterStyle" PatternValue=">" />
</Scope>
</Scopes>
<!-- Patterns Groups -->
<PatternGroups>
<RegexPatternGroup Token="MyEndTagDefaultToken" PatternValue="[^>]+" />
</PatternGroups>
</State>