472,126 Members | 1,526 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 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

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

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


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

Microsoft.Practices.EnterpriseLibrary.Logging, Version=,
Culture=neutral, PublicKeyToken=null">

defaultCategory="General" defaultFormatter="Text Formatter"

<sink xsi:type="FlatFileSinkData" name="Flat File Sink"
fileName="LPM_log.txt" header="" footer="" />
<category name="General">
<destination name="Event Log Destination" sink="Event Log
Sink" format="Text Formatter" />
<category name="Category">
<destination name="My First Destination" sink="Flat File
Sink" format="Text Formatter" />
<formatter xsi:type="TextFormatterData" name="Text Formatter">
<template><![CDATA[{timestamp} | {processId} |
{win32ThreadId} | {message} ]]></template>

Nov 27 '05 #1
3 4220
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
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by gimme_this_gimme_that | last post: by
2 posts views Thread by ree32 | last post: by
12 posts views Thread by michael sorens | last post: by
4 posts views Thread by syed.akhlaq | last post: by
2 posts views Thread by arunairs | last post: by
reply views Thread by Curtin1060 | last post: by

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.