Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7600137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T22:50:24+00:00 2026-05-30T22:50:24+00:00

I use Castle Windsor IoC. I would like configure object in IoC from XML

  • 0

I use Castle Windsor IoC. I would like configure object in IoC from XML file. Class is only POCO with some properties.

My problem is that value of property is string which contain special characters.

For example here is XML which I use for configure object in IoC.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <components>
    <component id="pokecUrls" 
               type="Pk.Common.Entities.Communication.PkcUrls, Pk.Common" 
               lifestyle="singleton">
      <parameters>

        <LogOn>https://pk.zet.com/overenie?isWap=0&uri=http%3A%2F%2Fpk.zet.com%2F</LogOn>

      </parameters>
    </component>
  </components>
</configuration>

Here is C# code:

_container.Install(Configuration.FromXmlFile("PkcCoreSettings\\PkUrls.xml"));
var urls = _container.Resolve<Pkrls>();
Assert.IsNotNull(urls);

This code crash because element LogOn contains string with specials characters.

I get this error:

{"Error processing node resource FileResource: [PkUrls.xml] [filepath]"}

InnerException:

{"An error occurred while parsing EntityName. Line 11, position 61."}

StackTrace:

  at Castle.Windsor.Configuration.Interpreters.XmlProcessor.XmlProcessor.Process(IResource resource) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Windsor\Windsor\Configuration\Interpreters\XmlProcessor\XmlProcessor.cs:line 115
   at Castle.Windsor.Configuration.Interpreters.XmlInterpreter.ProcessResource(IResource source, IConfigurationStore store, IKernel kernel) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Windsor\Windsor\Configuration\Interpreters\XmlInterpreter.cs:line 83
   at Castle.Windsor.Installer.ConfigurationInstaller.Castle.MicroKernel.Registration.IWindsorInstaller.Install(IWindsorContainer container, IConfigurationStore store) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Windsor\Windsor\Installer\ConfigurationInstaller.cs:line 74
   at Castle.Windsor.WindsorContainer.Install(IWindsorInstaller[] installers, DefaultComponentInstaller scope) in c:\BuildAgent\work\9834359f44c23fee\src\Castle.Windsor\Windsor\WindsorContainer.cs:line 319

It exist way how can I have special characters in value of XML element and use this XML file for confirure Windows IoC?

I am not sure if it is possible

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T22:50:26+00:00Added an answer on May 30, 2026 at 10:50 pm

    You need to escape the & as &amp;, because & is special character in XML:

    <LogOn>https://pk.zet.com/overenie?isWap=0&amp;uri=http%3A%2F%2Fpk.zet.com%2F</LogOn>
    

    Alternatively, you could write it as CDATA:

    <LogOn><![CDATA[https://pk.zet.com/overenie?isWap=0&uri=http%3A%2F%2Fpk.zet.com%2F]]></LogOn>
    

    There are no other characters in that URL that are special in XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to use Castle Windsor 2.0 as the inversion of control container
I am trying to use Castle Windsor with MS Test. The test class only
I would like to use Castle Windsor for dependency injection for my solution consisting
I am using a custom ControllerFactory (to use Castle Windsor's IOC to create controllers),
I am attempting to use Castle Windsor in my automated tests like so: On
I'm using Castle Windsor with a configuration from my App.config file. In the code
In my case I am using Castle Windsor as my IoC container. I would
I am using Castle Windsor for IoC and I want to use Binsor to
I use S#arp Architecture which uses Windsor Castle for IoC. I got a new
I need to modify an existing web app to use Castle.Windsor as IOC container.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.