473,372 Members | 1,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

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

i got xml file that have <bac:BACnetDevicesand <bac:BACnetDevicetag 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

but i got "undefined namespace prefix -'bac'" error
Jul 17 '06 #1
5 1993
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="something")?
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Jul 17 '06 #2
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
"Greg Collins [Microsoft MVP]" wrote:
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="something")?
--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Jul 18 '06 #3
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>
"dotnetnoob" wrote:
i got xml file that have <bac:BACnetDevicesand <bac:BACnetDevicetag 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

but i got "undefined namespace prefix -'bac'" error
Jul 18 '06 #4
i got it. by using namespace manager the xpath query work in my VB.net code.

"dotnetnoob" wrote:
i got xml file that have <bac:BACnetDevicesand <bac:BACnetDevicetag 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

but i got "undefined namespace prefix -'bac'" error
Jul 18 '06 #5
Glad you got it working!

--
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Jul 19 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: gfrommer | last post by:
Hello Everyone, I'm writing a server in java, and I want the clients to pass me an XPath query. I want the XPath queries to be in a specific format though, I'm pretty sure it's valid but I want...
2
by: R | last post by:
Hello everybody. I'm new to XML and I've got problem with one XPath query. This is my situation: <group> <test required='1'></test> <test required='1' noregexp='1'></test> </group> inside...
2
by: David Gordon | last post by:
Hi Folks, I wonder if anyone can help me with the following (perhaps trivial) problem: <xml> <node name="a" type="a"/> <node name="b" type=""/> <node name="c"/> <node name="d" type="b"/>...
3
by: IMS.Rushikesh | last post by:
Hi Friends, I need a XPath query, whcih ll return me subset of data.... check below xml stream <label id="MyExpenseDetails_lbl" xlink:role="terseLabel">Short Expense Details</label> <label...
2
by: dc | last post by:
i have a xml file like this: <?xml version="1.0" encoding="utf-8"?> <validate xmlns="http://tempuri.org/fieldValidate.xsd"> <field name="Short Name" type="SN" length="10"> <requiredChar...
0
by: dotnetnoob | last post by:
Dim strFacilitFile As String = Func_Facilit(strJobSite) Dim xTempltDoc As New Xml.XmlDocument Dim xGpDoc As New Xml.XmlDocument Dim y As Integer = 0 'Dim intNxtInstNumb As Integer =...
2
by: Claudio | last post by:
Hi I'm trying to use XPath queries with streaming XML, but I cannot make it working. The solution I'm trying to implement is: create a XmlNode as soon as I have a full XML element and use the...
3
by: Jason Mobarak | last post by:
Hello -- I'm attempting to get a handle on how to do xpath queries with System.Xml -- so far the biggest hurdle has been how to deal with a default namespace. If I use the test xml: <?xml...
2
by: =?Utf-8?B?RGlmZmlkZW50?= | last post by:
Hello All, I am trying to construct an XPath query against an XML document, for a requirement that I have. Below is the XML fragment: <SUBMISSIONS> <SUBMISSION YEAR="2004"> <MONTH...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.