SF Project Link
Alternate Syntax QuickstartThis quickstart describes how to create your own alternate syntax that is used to identify tags that will be handled by tag handlers. The XML syntax is the normal syntax that comes to mind when considering what tags look like. However, Tagneto was constructed to allow anything you can define as a regular expression to be considered a tag. The restrictions:
1. SimpleTagMatcherUse org.tagnetic.core.parser.tagmatcher.SimpleTagMatcher to specify an simple alternate syntax that does not allow for tag bodies and end tag syntax. This is the class that is used to define the XML entity tag syntax that is supported by Tagneto.
SimpleTagMatcher allows you to specify a tag prefix, suffix, attribute separator and an name value separator. Here is the configuration that is used to support the XML entity syntax:
<elementsyntax classname="org.tagnetic.core.parser.tagmatcher.SimpleTagMatcher">This will match tags that look like this:
&namespace:tagname-attributeName:attributeValue-attributeName:attributeValue;Notice that the namespace and tagName are treated like a name value pair. SimpleTagMatcher recognizes the first name/value pair as the namespace and tag name, and treats the rest of the name/value pairs as attribute names and values.
2. Implement TagMatcher InterfaceCreate your own class that extends the org.tagnetic.core.parser.tagmatcher.TagMatcher interface. Use that class in the <elementsyntax> configuration element. An example of this is org.tagnetic.core.parser.tagmatcher.XmlTagMatcher, which provides the XML tag syntax matching for Tagneto.You can see both of the tag matcher classes described above in the Tagneto configuration files. These files are in the build package under the config directory, in a file called Syntax.xml.