TANDBERG D13639 manual Introduction to XML, Example

Page 4

TANDBERG MPS API

User Guide

1.1 Introduction to XML

XML is a markup language for documents containing structured information.

All information elements in an XML document are marked by a tag and a corresponding end- tag. The end-tag has the same name as the tag, but is prefixed with a slash, “/”. All tags are put within angular brackets (“< >”).

Example 1.1

Below is an example of how configurations of a Serial Port could be represented using XML.

<Configuration> <SerialPort item="1">

<BaudRate item="1">9600</BaudRate> <Parity item="1">None</Parity> <DataBits item="1">8</DataBits> <StopBits item="1">1</StopBits> <Mode item="1">Control</Mode>

</SerialPort>

</Configuration>

From the tree structure of this example we can see that BaudRate, Parity, Databits, StopBits and Mode are properties of the SerialPort. We can distinguish between container-elementsand value-elements. Container-elements contain one or more sub- elements, while value-elements contain a value. This is analogous to files and folders on a computer. Container-elements are folders that can contain sub-folders and files, while value- elements are files containing data.

In the XML structure for the Serial Port we see that the container-element SerialPort contains five sub-elements. All these sub-elements are value-elements, each holding values for the properties: BaudRate, Parity, DataBits, StopBits and Mode.

Example 1.2

In this example we will look at element attributes. Attributes are used to add meta information to an element. Attributes are placed within the start tag of an element and different attributes are separated by space.

An XML structure representing the status of a call in a videoconferencing system is shown below:

<Status>

<Call item="1" status="Disconnected" type="NA" protocol="NA"> <Cause item="1">255</Cause>

</Call>

</Status>

We can see from the status attribute of the Call element that the call is disconnected. The only relevant information regarding this call is the disconnect cause value. Therefore the sub- structure of the call element contains only one value-element.

2

Image 4
Contents Tandberg MPS API User GuideTable of Contents Tandberg API DisclaimerIntroduction to XML ExampleExample Tandberg MPS API Introduction to XML Path Language XPath Status/Call@status=Synced/CallRate Addressing using XPath Tandberg XML EngineStructuring of Information FeedbackTandberg MPS API Documents XML DocumentsStatus Documents r Configuration documents rw Command documents w Command Dial item=1 Number item=1999/Number /Dial Example Introduction to Tandberg XML API Service Txas Bare-bone Https accessGetxml FormputxmlExercises ExerciseTandberg MPS API XML-based Advanced Command Line Interface Root commands Accessing XacliAddressing Supported exposure options Exposure optionsXstatus call Misc Status-type root commands Xstatus / xhistory FormatXstatus ? Xstatus call 1 remotenumberXML Xacli *s IPConfiguration-type root commands xconfiguration/xdirectory Configuration helpXconfiguration ? Xdirectory ?Configuration set write Configuration readXconfiguration // ? Xconfiguration ?? Xconfiguration ip/assignment static Command-type root commands xcommand Command helpXcommand ? Xcommand ??Issuing a command Example 2.12 xcommand Dial ?Xcommand dial number666 restricton callrate128 subaddress10 Xcommand dial nu666 ron c128 s10Xcommand dial 666 ron 10 Xcommand dial 666 10 128 onXcommand dial XML Output xgetxml Xgetxml status/ipSpecial Commands XfeedbackXfeedback ? Xfeedback register status/call/channels/audio/protocolXfeedback register status/call Xcom dial Xfeedback register status/call@status=Disconnected Xcom dialXcom disc Xfeedback register status/call@status=Synced Xcom dialXpreferences Xpreferences ?Xstat call 1 channels 1 audio Xpreferences detaillevel Xstat call 1 channels 1 audioBaudRate item=12400/BaudRate API Configurations Configuration.xml xconfiguration Tandberg MPS API Tandberg MPS API H323Gatekeeper 1..2 Authentication Password S 0 Http Mode On/OffTandberg MPS API LoS Polarity Positive/Negative LoS Retry MCURTP SerialInterfaceCard SessionSIP Mode On/Off SIP Interface Authentication UserName S 0SIP Interface Authentication Password S 0 SIP Interface Transport Default TCP/UDPTandberg MPS API Directory.xml xdirectory API Commands Command.xml xcommand CallMuteOutgoing CallTransfer CallTransferToDirEntry CallMuteVideo ConferenceDisconnect ConferenceModify Parameters Conferencer OK Result parametersConferenceRedefine ConferenceStart ConferenceStop ConferenceShowDuration ConferenceTerminate DefaultValuesSet Dial Parameters Conferencer DialGroupEntry DialInNumberAdd DialInNumberRemoveDescription Textual description of the cause code DialLocalEntry DisconnectCall DisconnectGWCall OK Result parameters Error Result parameters FeedbackDeregister FeedbackRegisterFloorToSite FloorToSiteEnd GroupEntryAdd Parameters Name S 0, 48 The entry’s nameGroupEntryDelete LayoutLock LayoutUnLock LocalEntryAdd LocalEntryDelete Windowr CallIDr 1..176 Call Error Result parametersNetworkId NetworkModule OK Result parameters Command used to add option key ProtectNumberRemove VideoTextSet API Status Status.xml xstatus ExamplesTandberg MPS API Examples Tandberg MPS API Mcuid Ethernet Top level attributes Feedback Top level attributesUser Guide EndNone MediaBoard 1..8 Top level attributesSystemUnit Top level attributes None Summary SerialInterfaceCard ISDNInterfaceCard Top level attributes Status on/off SummaryTandberg MPS API Tandberg MPS API NTP SIP SystemLoad SystemClock SystemActivity Options Option Option 64 / *s/end History.xml xhistory Conference Top level attributesEvent.xml xevent Audio TotalPacketsPacketLoss PacketsDroppedEnd