HOWTO: XML based Flex Connectors
Recently came across a client who had an applications which generates logs in XML format. Personally didn't do much Flex development for XML in past as its rare to see any app generate in xml except the scanners. Spent some time to learn myself first again as my first xml was long time ago
Let's come to the topic now:
Few basics on XML:
Basic Concepts of XML to be familiar with before you even think of developing the xml parser because it is important to understand and evaluate the log file first:
1. Root node
2. Intermediary Node
Now I would recommend you to go to this website XML Tutorial and get yourself a fair idea on these terms so you can understand the log file for which you think you have to develop xml parser.
XML Flex Basics:
1. Namespaces: This is usually present in the log file to avoid the name conflict between elements. So if your log file have namespaces, you define them in the parser, if not then you don't define.
2. Hope Node: This property is to define the structure of the file on how to reach to an intermediate node from root node, or to trigger node. It's optional but most of the times it is required.
3. Trigger Node: This the very core of the parser. The location which we define here actually contains security data which you want to collect/capture. you can also capture from other locations as well, don't confuse.
4. Tokens: It has one important aspect which is token.expression - In this property you specify the xpath/xquery to select the node to pick the data.
5. Event Mapping - Same as other flexes
Remaining process you know. Use any xml viewer/editor to analyze the log file properly.
Attaching sample log and parser for your reference. I hope this post will help those who are new to xml flex .
PM me for the file password.