- 91> {Root,Body}= xmerl_scan:file("interface.xml").
- {{xmlElement,'nf:rpc-reply','nf:rpc-reply',
- {"nf","rpc-reply"},
- {xmlNamespace,[],
- [{"nf",'urn:ietf:params:xml:ns:netconf:base:1.0'},
- {"nxos",'http://www.cisco.com/nxos:1.0'},
- {"mod",'http://www.cisco.com/nxos:1.0:if_manager'}]},
- [],1,
- [{xmlAttribute,'xmlns:nf',[],
- {"xmlns","nf"},
- [],
- [{'nf:rpc-reply',1}],
- 1,[],"urn:ietf:params:xml:ns:netconf:base:1.0",false},
- {xmlAttribute,'xmlns:nxos',[],
- {"xmlns","nxos"},
- [],
- [{'nf:rpc-reply',1}],
- 2,[],"http://www.cisco.com/nxos:1.0",false},
- {xmlAttribute,'xmlns:mod',[],
- {"xmlns","mod"},
- [],
- [{'nf:rpc-reply',1}],
- 3,[],"http://www.cisco.com/nxos:1.0:if_manager",false},
- {xmlAttribute,'message-id',[],[],[],
- [{'nf:rpc-reply',1}],
- 4,[],"110",false}],
- [{xmlText,[{'nf:rpc-reply',1}],1,[],"\n ",text},
- {xmlElement,'nf:data','nf:data',
- {"nf","data"},
- {xmlNamespace,[],
- [{"nf",'urn:ietf:params:xml:ns:netconf:base:1.0'},
- {"nxos",'http://www.cisco.com/nxos:1.0'},
- {"mod",'http://www.cisco.com/nxos:1.0:if_manager'}]},
- [{'nf:rpc-reply',1}],
- 2,[],
- [{xmlText,
- [{'nf:data',2},{'nf:rpc-reply',1}],
- 1,[],"\n ",text},
- {xmlElement,'mod:show','mod:show',
- {"mod",[...]},
- {xmlNamespace,...},
- [...],...},
- {xmlText,
- [{'nf:data',2},{'nf:rpc-reply',...}],
- 3,[],
- [...],...}],
- [],".",undeclared},
- {xmlText,[{'nf:rpc-reply',1}],3,[],"\n ",text}],
- [],".",undeclared},
- "]]>]]> "}
- 92> Root.
- {xmlElement,'nf:rpc-reply','nf:rpc-reply',
- {"nf","rpc-reply"},
- {xmlNamespace,[],
- [{"nf",'urn:ietf:params:xml:ns:netconf:base:1.0'},
- {"nxos",'http://www.cisco.com/nxos:1.0'},
- {"mod",'http://www.cisco.com/nxos:1.0:if_manager'}]},
- [],1,
- [{xmlAttribute,'xmlns:nf',[],
- {"xmlns","nf"},
- [],
- [{'nf:rpc-reply',1}],
- 1,[],"urn:ietf:params:xml:ns:netconf:base:1.0",false},
- {xmlAttribute,'xmlns:nxos',[],
- {"xmlns","nxos"},
- [],
- [{'nf:rpc-reply',1}],
- 2,[],"http://www.cisco.com/nxos:1.0",false},
- {xmlAttribute,'xmlns:mod',[],
- {"xmlns","mod"},
- [],
- [{'nf:rpc-reply',1}],
- 3,[],"http://www.cisco.com/nxos:1.0:if_manager",false},
- {xmlAttribute,'message-id',[],[],[],
- [{'nf:rpc-reply',1}],
- 4,[],"110",false}],
- [{xmlText,[{'nf:rpc-reply',1}],1,[],"\n ",text},
- {xmlElement,'nf:data','nf:data',
- {"nf","data"},
- {xmlNamespace,[],
- [{"nf",'urn:ietf:params:xml:ns:netconf:base:1.0'},
- {"nxos",'http://www.cisco.com/nxos:1.0'},
- {"mod",'http://www.cisco.com/nxos:1.0:if_manager'}]},
- [{'nf:rpc-reply',1}],
- 2,[],
- [{xmlText,
- [{'nf:data',2},{'nf:rpc-reply',1}],
- 1,[],"\n ",text},
- {xmlElement,'mod:show','mod:show',
- {"mod","show"},
- {xmlNamespace,[],...},
- [{...}|...],
- 2,...},
- {xmlText,
- [{'nf:data',2},{'nf:rpc-reply',1}],
- 3,[],"\n ",text}],
- [],".",undeclared},
- {xmlText,[{'nf:rpc-reply',1}],3,[],"\n ",text}],
- [],".",undeclared}
- 93> xmerl_xpath:string("count(//mod:interface)",Root).
- {xmlObj,number,3}
- 94>
复制代码 |