473,387 Members | 1,700 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,387 software developers and data experts.

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
gingDistributorConfiguration/xmlSerializerSection/enterpriseLibrary.logging**DistributorSettings'.

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
'/loggingDistributorConfiguration/xmlSerializerSection/enterpriseLibrary.lo**ggingDistributorSettings'.

xmlpoke expression
<xmlpoke
file="..\src\LetterProcessingMonitor\loggingDistri butorConfiguration.config**"

xpath="/loggingDistributorConfiguration/xmlSerializerSection/enterpriseLibr**ary.loggingDistributorSettings"

value="test" />
XML
<?xml version="1.0" encoding="utf-8"?>
<loggingDistributorConfiguration>
<xmlSerializerSection
type="Microsoft.Practices.EnterpriseLibrary.Loggin g.Distributor.Configurati**on.DistributorSettings,

Microsoft.Practices.EnterpriseLibrary.Logging, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null">
<enterpriseLibrary.loggingDistributorSettings
xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

defaultCategory="General" defaultFormatter="Text Formatter"
xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/loggi...">

<sinks>
<sink xsi:type="FlatFileSinkData" name="Flat File Sink"
fileName="LPM_log.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="TextFormatterData" name="Text Formatter">
<template><![CDATA[{timestamp} | {processId} |
{win32ThreadId} | {message} ]]></template>
</formatter>
</formatters>
</enterpriseLibrary.loggingDistributorSettings>
</xmlSerializerSection>
</loggingDistributorConfiguration>

Nov 27 '05 #1
3 4267
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="FlatFileSinkData" name="Flat File Sink"
fileName="LPM_log.txt" header="" footer="" />

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 28 '05 #3
<enterpriseLibrary.loggingDistributorSettings 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
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...
2
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 -...
6
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
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...
12
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...
4
by: syed.akhlaq | last post by:
Hi, Does anyone know how can I validate XPath expressions using xsd schema? Thanks
1
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
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...
0
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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:
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...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.