XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Rob JohnsonSubject: XQuery Syntax
Author: Rob Johnson
Date: 25 Apr 2005 11:14 AM
First off, I'm not a programmer. I'm a Network Mgmt System administrator. I'm administering the CiscoWorks application that tracks and reports on inventory, user tracking information and a few other things. There is a Data Extraction Engine that is capable of extracting this data and writing to a file in XML format. I would like to be able to query this file to find what switch port a particular MAC or IP address is connected to. However, I don't know what the syntax would be. Can someone help with this elementry question? I'm pasting the beggining of the file.

johnsonr@nmsccm01 > more *
<?xml version="1.0" encoding="UTF-8"?>
<UTDetails>
<CMServer>nmsccm01</CMServer>

<CreatedAt>Mon Mar 28 14:42:40 EST 2005</CreatedAt>

<SchemaVersion>1.0</SchemaVersion>

<Heading>UT HOST DATA</Heading>

<Query>all</Query>

<Layout>all</Layout>

<UTData>
<Index>12120705</Index>
<UserName/>
<MACAddress>00-01-e6-b0-21-90</MACAddress>
<HostName>sb-medrec11711-lj8150.harb.ca.kp.org</HostName>
<IPAddress>10.206.33.241</IPAddress>
<Subnet>10.206.32.0</Subnet>
<DeviceName>lcahrbc129.ca.kp.org</DeviceName>
<Device>10.206.1.129</Device>
<Port>Fa0/24</Port>
<PortName>DEPT:MEDREC RM:11711 LOC:MH1G019E RFC#143519</PortName>
<PortState>static</PortState>
<VTPDomain>harb</VTPDomain>
<VLAN>10.206.32.0/24</VLAN>
<VLANType>ethernet</VLANType>
<Ring/>
<Bridge/>
<trBRFVLAN/>
<LastSeen>2005/03/28 05:26:18</LastSeen>
<Notes/>
<PortDuplex>half-duplex</PortDuplex>
<PortSpeed>10M</PortSpeed>
<VLANId>8</VLANId>
</UTData>

Posttop
Ivan PedruzziSubject: XQuery Syntax
Author: Ivan Pedruzzi
Date: 25 Apr 2005 10:14 PM
Hi Rob

You can use the following XPath2 expression to do the lookup by partial IP

/UTDetails/UTData[fn:contains(IPAddress,'.33.241')]/Port/text()

Hope this helps
Ivan

 
Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.