7a80424330131604c71639705e04fdaa5aa444ad
[ccsdk/cds.git] /
1 import { Parser } from './Parser';
2
3 export class JinjaXMLParser implements Parser {
4     getVariables(fileContent: string): string[] {
5         const variables = [];
6         if (fileContent.includes('>[')) {
7             const xmlSplit = fileContent.split('>[');
8             for (const val of xmlSplit) {
9                 const res = val.substring(0, val.indexOf(']</'));
10                 if (res && res.length > 0) {
11                     variables.push(res);
12                 }
13
14             }
15         }
16         return variables;
17     }
18
19 }
20
21 /*
22
23 <?xml version="1.0" encoding="UTF-8"?>
24 <configuration xmlns:junos="http://xml.juniper.net/junos/17.4R1/junos">
25 <system xmlns="http://yang.juniper.net/junos-qfx/conf/system">
26 <host-name operation="delete" />
27 <host-name operation="create">[hostname]</host-name>
28 </system>
29 </configuration>
30
31 */