Nant - cannot successfully get xmlpoke to work with xml containing namespace information

Discussion in 'ASP .Net' started by chriscomer, Nov 23, 2005.

  1. chriscomer

    chriscomer Guest

    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.loggingDistributorSettings'.


    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.loggingDistributorSettings'.

    xmlpoke expression


    <xmlpoke
    file="..\src\LetterProcessingMonitor\loggingDistributorConfiguration.config"

    xpath="/loggingDistributorConfiguration/xmlSerializerSection/enterpriseLibrary.loggingDistributorSettings"
    value="test" />


    XML

    <?xml version="1.0" encoding="utf-8"?>
    <loggingDistributorConfiguration>
    <xmlSerializerSection
    type="Microsoft.Practices.EnterpriseLibrary.Logging.Distributor.Configuration.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/loggingdistributor">
    <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>
     
    chriscomer, Nov 23, 2005
    #1
    1. Advertising

  2. chriscomer

    sopan007

    Joined:
    Jul 18, 2006
    Messages:
    1
    Try this..

    Hi,

    Try this:
    Modify the namespace definition for the enterprise library "xmlns="http://www.microsoft.com/practices/enterpriselibrary/08-31-2004/data", to "xmlns:ent=http://....".

    That's it! No need for adding namespace definitions in the xmlpoke.
     
    sopan007, Jul 18, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HaukiDog

    NANT, web projects and resource files

    HaukiDog, Oct 28, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    2,952
    Michael Hall
    Aug 24, 2004
  2. Ashish

    running Nant from vb code.

    Ashish, Jul 1, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    461
    Bruce Barker
    Jul 1, 2005
  3. Phipps Xue
    Replies:
    0
    Views:
    273
    Phipps Xue
    Jan 9, 2004
  4. Replies:
    0
    Views:
    148
  5. Chris Angelico
    Replies:
    0
    Views:
    74
    Chris Angelico
    May 30, 2014
Loading...

Share This Page