473,734 Members | 2,647 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

NAnt issue - unsuccessful in using xpath expression with xmlpoke

I have successfully setup numerous xmlpoke statements within an Nant
script but this specific situation I cannot figure out. I am including

a section of the xml code I am trying to access and update using an
xmlpoke statement. No matter what I try I continue to get "
[xmlpoke] No matching nodes were found with XPath
expression '/log
gingDistributor Configuration/xmlSerializerSe ction/enterpriseLibra ry.logging**Dis tributorSetting s'.

Below is the error message, xml file I am trying to modify and the
corresponding xmlpoke expression which fails.
Error Message
[xmlpoke] No matching nodes were found with XPath expression
'/loggingDistribu torConfiguratio n/xmlSerializerSe ction/enterpriseLibra ry.lo**ggingDis tributorSetting s'.

xmlpoke expression
<xmlpoke
file="..\src\Le tterProcessingM onitor\loggingD istributorConfi guration.config **"

xpath="/loggingDistribu torConfiguratio n/xmlSerializerSe ction/enterpriseLibr* *ary.loggingDis tributorSetting s"

value="test" />
XML
<?xml version="1.0" encoding="utf-8"?>
<loggingDistrib utorConfigurati on>
<xmlSerializerS ection
type="Microsoft .Practices.Ente rpriseLibrary.L ogging.Distribu tor.Configurati **on.Distributo rSettings,

Microsoft.Pract ices.Enterprise Library.Logging , Version=1.0.0.0 ,
Culture=neutral , PublicKeyToken= null">
<enterpriseLibr ary.loggingDist ributorSettings
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"xmlns :xsi="http://www.w3.org/2001/XMLSchema-instance"

defaultCategory ="General" defaultFormatte r="Text Formatter"
xmlns="http://www.microsoft.c om/practices/enterpriselibra ry/08-31-2004/loggi...">

<sinks>
<sink xsi:type="FlatF ileSinkData" name="Flat File Sink"
fileName="LPM_l og.txt" header="" footer="" />
</sinks>
<categories>
<category name="General">
<destinations >
<destination name="Event Log Destination" sink="Event Log
Sink" format="Text Formatter" />
</destinations>
</category>
<category name="Category" >
<destinations >
<destination name="My First Destination" sink="Flat File
Sink" format="Text Formatter" />
</destinations>
</category>
</categories>
<formatters>
<formatter xsi:type="TextF ormatterData" name="Text Formatter">
<template><![CDATA[{timestamp} | {processId} |
{win32ThreadId} | {message} ]]></template>
</formatter>
</formatters>
</enterpriseLibra ry.loggingDistr ibutorSettings>
</xmlSerializerSe ction>
</loggingDistribu torConfiguratio n>

Nov 27 '05 #1
3 4296
There is a default namespace, that's why the xpath returns nothing.

Nov 28 '05 #2
Tasos thank you for your reply.

Actually I may have not been clear enough in my original posting. What
I ultimately want to alter is the filename attribute under the sink
element as posted below. Is this something you could help me with?

<sink xsi:type="FlatF ileSinkData" name="Flat File Sink"
fileName="LPM_l og.txt" header="" footer="" />

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 28 '05 #3
<enterpriseLibr ary.loggingDist ributorSettings defines a default xmlns
thats why the xpath query does not return a node.

What you should do is to create an xpath query based on the local name
of the node you are searching (as I dunno any way you could specify a
default namespace).

I had the same issue (code wise) with the configuration files of the MS
App Blocks and I used string replace :) .

Nov 28 '05 #4

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

Similar topics

3
1744
by: gimme_this_gimme_that | last post by:
I once downloaded a shareware program that allowed you to open an xml file, click on a text or an attribute, an then see the xpath expression that would fetch that data. The program didn't require that you enter the xpath expression. It may have been something that worked from opening a page in IE. That would be OK. It could have been
2
2881
by: ree32 | last post by:
When I import an xml document in Visual studio and Genereate as schema from it, and create a dataset from it, it adds this line into to the root element of my xml file - "xmlns="http://tempuri.org/nameOfRoot.xsd" I have no idea what its pointing to & what is tempuri.org? So when this tag is in my xml tag my xpath query never works. But when I delete it work fine.
6
15509
by: Chua Wen Ching | last post by:
Hi there, I had this xml file with me (not yet consider implementing xml namespaces yet). <?xml version='1.0'?> <Object> <Windows> <EID>1</EID> <EDesc>Error 1</EDesc> </Windows>
0
1186
by: chriscomer | last post by:
I have successfully setup numerous xmlpoke statements within an Nant script but this specific situation I cannot figure out. I am including a section of the xml code I am trying to access and update using an xmlpoke statement. No matter what I try I continue to get " No matching nodes were found with XPath expression '/log gingDistributorConfiguration/xmlSerializerSection/enterpriseLibrary.loggingDistributorSettings'. Below is the...
12
18806
by: michael sorens | last post by:
So I have compiled a .dll file from a Visual Studio 2005 project containing a few dozen c# files. Now I want to automate this build using ant (have not yet looked at nant, but the rest of my complex build is done with plain ant). Could someone point me to any tutorial or other guide for doing this? I would even settle for just how to do it from a command-line.
4
9130
by: syed.akhlaq | last post by:
Hi, Does anyone know how can I validate XPath expressions using xsd schema? Thanks
1
2073
by: Crash | last post by:
Hi all, Is there a newsgroup for NANT? Or is there some place I can post NANT questions? In case this newsgroup is Ok for NANT questions, here is my issue: Windows XP VS 2003
2
4722
by: arunairs | last post by:
Hi, Is there a way of validating and XPath? In this case , I am accepting an XPath from the user and I need to validate the XPath syntax. Is there a regular expression available that anyone can direct me to, to validate a XPath? thanks, Arun
0
2049
by: Curtin1060 | last post by:
Hi, I have a simple exe.config issue where I'd like to swap out the config file with NAnt/XMLPOKE. I just can't figure out the correct xpath to get to the "file=" attribute. I want to swap in "US, UK, ..." depending on the target regions. Thanks, Craig
0
8946
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8776
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9182
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8186
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4809
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3261
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.