TANDBERG D13639 manual Introduction to XML Path Language XPath

Page 7

TANDBERG MPS API

User Guide

1.2Introduction to XML Path Language (XPath)

XPath is a comprehensive language to address data in XML documents.

It is though very simple to understand the basics. If you are able to specify the path to a file on your computer, you are able to specify the path to an element in a XML structure.

Example 1.5

Let us go back to the serial port configurations of Example 1.1.

<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>

To specify the path to the SerialPort element we simply start at the root level and separate the levels in the tree structure by a slash (“/”):

Configuration/SerialPort

The path to the BaudRate element is:

Configuration/SerialPort/BaudRate

Example 1.6

To address a specific item of an element, the item number is added within brackets (“[]”) after the element name.

The path to the BaudRate element of SerialPort item 2 in Example 1.4 is: Configuration/SerialPort[2]/BaudRate

If the item number is omitted for an element, all items of this element will be addressed. The following expression addresses the BaudRate element of both serial ports: Configuration/SerialPort/BaudRate

Example 1.7

When using XPath it is possible to omit specifying intermediate levels in the address expression. By using the powerful “double slash” you can address elements without having to specify the complete path.

The expression below addresses the BaudRate element of both serial ports of Example 1.4:

Configuration//BaudRate

5

Image 7
Contents User Guide Tandberg MPS APITable of Contents Disclaimer Tandberg APIExample Introduction to XMLExample Tandberg MPS API Introduction to XML Path Language XPath Status/Call@status=Synced/CallRate Feedback Addressing using XPathTandberg XML Engine Structuring of InformationTandberg MPS API Documents XML DocumentsStatus Documents r Configuration documents rw Command documents w Command Dial item=1 Number item=1999/Number /Dial Example Formputxml Introduction to Tandberg XML API Service TxasBare-bone Https access GetxmlExercise ExercisesTandberg MPS API XML-based Advanced Command Line Interface Root commands Accessing XacliAddressing Supported exposure options Exposure optionsXstatus call Misc Xstatus call 1 remotenumber Status-type root commands Xstatus / xhistoryFormat Xstatus ?Xacli *s IP XMLXdirectory ? Configuration-type root commands xconfiguration/xdirectoryConfiguration help Xconfiguration ?Configuration set write Configuration readXconfiguration // ? Xconfiguration ?? Xconfiguration ip/assignment static Xcommand ?? Command-type root commands xcommandCommand help Xcommand ?Xcommand dial nu666 ron c128 s10 Issuing a commandExample 2.12 xcommand Dial ? Xcommand dial number666 restricton callrate128 subaddress10Xcommand dial 666 ron 10 Xcommand dial 666 10 128 onXcommand dial Xgetxml status/ip XML Output xgetxmlXfeedback register status/call/channels/audio/protocol Special CommandsXfeedback Xfeedback ?Xfeedback register status/call@status=Disconnected Xcom dial Xfeedback register status/call Xcom dialXfeedback register status/call@status=Synced Xcom dial Xcom discXpreferences ? XpreferencesXpreferences detaillevel Xstat call 1 channels 1 audio Xstat call 1 channels 1 audioBaudRate item=12400/BaudRate API Configurations Configuration.xml xconfiguration Tandberg MPS API Tandberg MPS API Http Mode On/Off H323Gatekeeper 1..2 Authentication Password S 0Tandberg MPS API MCU LoS Polarity Positive/Negative LoS RetrySerialInterfaceCard Session RTPSIP Interface Transport Default TCP/UDP SIP Mode On/OffSIP Interface Authentication UserName S 0 SIP Interface Authentication Password S 0Tandberg MPS API Directory.xml xdirectory API Commands Command.xml xcommand CallMuteOutgoing CallTransfer CallTransferToDirEntry Parameters Conferencer OK Result parameters CallMuteVideo ConferenceDisconnect ConferenceModifyConferenceRedefine ConferenceStart ConferenceStop ConferenceShowDuration ConferenceTerminate DefaultValuesSet Dial Parameters Conferencer DialGroupEntry DialInNumberAdd DialInNumberRemoveDescription Textual description of the cause code DialLocalEntry DisconnectCall DisconnectGWCall FeedbackDeregister FeedbackRegister OK Result parameters Error Result parametersParameters Name S 0, 48 The entry’s name FloorToSite FloorToSiteEnd GroupEntryAddGroupEntryDelete 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 Examples Status.xml xstatusTandberg MPS API Examples Tandberg MPS API Mcuid Feedback Top level attributes Ethernet Top level attributesMediaBoard 1..8 Top level attributes User GuideEnd NoneSystemUnit Top level attributes None Summary Top level attributes Status on/off Summary SerialInterfaceCard ISDNInterfaceCardTandberg MPS API Tandberg MPS API NTP SIP SystemLoad SystemClock SystemActivity Options Option Option 64 / *s/end Conference Top level attributes History.xml xhistoryEvent.xml xevent PacketsDropped AudioTotalPackets PacketLossEnd