all groups > dotnet xml > july 2006 >
You're in the

dotnet xml

group:

how do you evalute a xpath query with xml tag like this <bac:BACne


how do you evalute a xpath query with xml tag like this <bac:BACne dotnetnoob
7/17/2006 9:58:03 AM
dotnet xml: i got xml file that have <bac:BACnetDevices> and <bac:BACnetDevice> tag how
do you make a xpath query with that type of tags

this is the query that i come up with
/Site/Networks/Network/bac:BACnetDevices/bac:BACnetDevice/@InstanceNumber

Re: how do you evalute a xpath query with xml tag like this <bac:BACne Greg Collins [Microsoft MVP]
7/17/2006 4:33:05 PM
What are you using to try to access the node in this XPath? Is this XSL =
or .NET? Is the bac namespace actually defined (i.e. =
xmlns:bac=3D"something")?


--=20
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )

Re: how do you evalute a xpath query with xml tag like this <bac:B dotnetnoob
7/17/2006 9:13:01 PM
hello, i'm using .Net XmlDocument withh xpath query to access the xml file,
yes the bac is point to http://www.teletrol.com/BACnet but the file is not
there. there is a xsd in the local hard disk.

is this the namespace binding?

thank you


[quoted text, click to view]
RE: how do you evalute a xpath query with xml tag like this <bac:BACne dotnetnoob
7/18/2006 8:50:02 AM
i use XMLSPY to evaluate the xpath query before i use it in my code. i use
VB.net w/Visual Studio.net 2005. if i add a nameperfix in the InstanceNumber
node bac:InstanceNumber then this query will work

/Site/Networks/Network/bac:BACnetDevices/bac:BACnetDevice/@bac:InstanceNumber

how do i get the value of InstanceNumber without adding "bac:" to the
InstanceNumber node on the xml file.

here is the xml file that i'm working with

<Site InstanceNumber="7415">
<ActionGroups/>
<Bookmarks AllowCreate="1" AllowDelete="1">
<Bookmark Name="HomePage" Path="800.7415_316.11_311.1094"/>
</Bookmarks>
<EquipmentCatalogs AllowCreate="0" AllowDelete="1" AllowRename="0">
<EquipmentCatalog InstanceNumber="133">
<GeneralProperties Attr="1" InstanceNumber="133" IsConfigured="0"
ObjectName="H280_Strake_Jesuit" ObjectType="317" SchemaVer="1.4"
TraceOptions="0">
<Description/>
</GeneralProperties>
</EquipmentCatalog>
</EquipmentCatalogs>
<GeneralProperties Attr="1" InstanceNumber="7415" IsConfigured="0"
ObjectName="H280_Strake_Jesuit" ObjectType="800" SchemaVer="1.4"
TraceOptions="0">
<Description><![CDATA[eBuilding Main Site]]></Description>
</GeneralProperties>
<Networks>
<Network InstanceNumber="101">
<bac:BACnetDevices xmlns:bac="http://www.teletrol.com/BACnet">
<bac:BACnetDevice APDUTimeout="" ApplicationSoftwareVersion=""
FirmwareRevision="" InstanceNumber="3744" MaxAPDULengthAccepted=""
ModelName="" NumberOfAPDURetries="" ProtocolConformanceClass=""
ProtocolObjectTypesSupported="" ProtocolServicesSupported=""
ProtocolVersion="" SegmentationSupported="" VendorIdentifier="" VendorName="">
<GeneralProperties Attr="1" InstanceNumber="3744" IsConfigured="0"
ObjectName="Building_1" ObjectType="8" SchemaVer="1.4" TraceOptions="0">
<Description/>
</GeneralProperties>
</bac:BACnetDevice>
</bac:BACnetDevices>
<GeneralProperties Attr="0" InstanceNumber="101" IsConfigured="0"
ObjectName="Network" ObjectType="801" SchemaVer="1.4" TraceOptions="">
<Description/>
</GeneralProperties>
<NetworkControllers>
<NetworkController InstanceNumber="115" InternalType="10">
<GeneralProperties Attr="1" InstanceNumber="115" IsConfigured="1"
ObjectName="H280_Strake_Jesuit_Plant" ObjectType="8" SchemaVer="1.4"
TraceOptions="0">
<Description><![CDATA[Teletrol Systems, Inc. eBuilding Network
Controller model 110]]></Description>
</GeneralProperties>
</NetworkController>
<NetworkController InstanceNumber="116" InternalType="10">
<GeneralProperties Attr="1" InstanceNumber="116" IsConfigured="1"
ObjectName="H280_Strake_Jesuit_Ahu" ObjectType="8" SchemaVer="1.4"
TraceOptions="0">
<Description><![CDATA[Teletrol Systems, Inc. eBuilding Network
Controller model 110]]></Description>
</GeneralProperties>
</NetworkController>
<NetworkController InstanceNumber="1264" InternalType="10">
<GeneralProperties Attr="1" InstanceNumber="1264" IsConfigured="0"
ObjectName="H280_Strake_Jesuit_FH" ObjectType="8" SchemaVer="1.4"
TraceOptions="0">
<Description><![CDATA[Teletrol Systems, Inc. eBuilding Network
Controller model 120. (Field House controller)
]]></Description>
</GeneralProperties>
</NetworkController>
<NetworkController InstanceNumber="3764" InternalType="10">
<GeneralProperties Attr="1" InstanceNumber="3764" IsConfigured="0"
ObjectName="eNC_Model_130" ObjectType="8" SchemaVer="1.4" TraceOptions="0">
<Description><![CDATA[Teletrol Systems, Inc. eBuilding Network
Controller model 130]]></Description>
</GeneralProperties>
</NetworkController>
</NetworkControllers>
<NetworkProperties NetworkNumber="1" ProtocolName="">
<Description/>
<PropertiesEx/>
</NetworkProperties>
</Network>
</Networks>
<Queries/>
<SharedObjects/>
<SiteProperties IpAddress="" NextInstanceNumber="3771" SiteServerVersion=""/>
<Facility FacilityIndexURL="" IndexPageURL="" InstanceNumber="11"
minimizedMenu="0" showAlarmIcon="1" showMenu="1" showSaveIcon="1">
<GeneralProperties Attr="1" InstanceNumber="11" IsConfigured="0"
ObjectName="Facility" ObjectType="316" SchemaVer="1.4" TraceOptions="">
<Description><![CDATA[Set of Facility Pages]]></Description>
</GeneralProperties>
</Facility>
<Globals InstanceNumber="3">
<GeneralProperties Attr="1" InstanceNumber="3" IsConfigured="0"
ObjectName="Globals" ObjectType="201" SchemaVer="1.4" TraceOptions="0">
<Description><![CDATA[Location for all Global System
Objects]]></Description>
</GeneralProperties>
</Globals>
</Site>


[quoted text, click to view]
RE: how do you evalute a xpath query with xml tag like this <bac:BACne dotnetnoob
7/18/2006 2:31:01 PM
i got it. by using namespace manager the xpath query work in my VB.net code.

[quoted text, click to view]
Re: how do you evalute a xpath query with xml tag like this <bac:BACne Greg Collins [Microsoft MVP]
7/19/2006 11:49:26 AM
Glad you got it working!

--=20
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )

AddThis Social Bookmark Button