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 4267042
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T06:50:37+00:00 2026-05-21T06:50:37+00:00

I have a xml something likethis <root> <testxml> <details name=test url=http://www.test.com/test.aspx?val=100&val2=200 /> </testxml> <root>

  • 0

I have a xml something likethis

<root>
<testxml>
<details  name="test" url="http://www.test.com/test.aspx?val=100&val2=200" />
</testxml>
<root>

When i transform this xml using xslt to another xml

<xsl:output method="html" indent="yes" encoding="UTF-8"  />

<xsl:template match="root/testxml/details">
    <convert>
        <xsl:attribute name="url">
            <xsl:value-of select="@url"/>
        </xsl:attribute>
    </convert>

I get the result output as this

<convert url="http://www.test.com/test.aspx?val=100&amp;val2=200">

instead of

<convert url="http://www.test.com/test.aspx?val=100&val2=200">

issue here is: & in url is getting changed to & amp; how can i avoid this ,i want & in url as &.(not & amp;)

i tried <xsl:value-of disable-output-escaping="yes" select="@url" />
also but of not use.

could anyone please help me in this..

  • 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-21T06:50:38+00:00Added an answer on May 21, 2026 at 6:50 am

    I get the result output as this

    instead of

    issue here is: & in url is getting
    changed to & amp;

    There is no issue and the URL is not changed at all:

    To verify this use a transformation like this:

    <xsl:stylesheet version="1.0"
     xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     <xsl:output method="text"/>
     <xsl:strip-space elements="*"/>
    
     <xsl:template match="/*">
         <xsl:value-of select="@url"/>
     </xsl:template>
    </xsl:stylesheet>
    

    when this transformation is applied on the following XML document:

    <convert url="http://www.test.com/test.aspx?val=100&amp;val2=200"/>
    

    The result is:

    http://www.test.com/test.aspx?val=100&val2=200
    

    So, the URL hasn’t been changed in any way and there is still only a single & character in it.

    What you observe is the mandatory escaping of some special characters (typically < and &) in XML, as dictated by the XML Spec.

    The escaping of some special characters never alters the content of the string that is escaped — only how it looks like when it is a part of an XML document.

    how can i avoid this ,i want & in url
    as &.(not & amp;)

    You cannot, and as shown above, there is nothing to avoid.

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

Sidebar

Related Questions

I have XML something like this: <?xml version=1.0?> <a xmlns=http://mynamespace> <b> <c val=test />
I have XML that looks something like this: <Root xmlns=http://widgetspecA.com/ns> ...any... <WidgetBox> <A/> <B/>
I have something like this: <?xml version=1.0 encoding=utf-8?> <Data> <ConfigDatas> <ArrayOfConfigData xmlns:i=http://www.w3.org/2001/XMLSchema-instance xmlns=http://schemas.datacontract.org/2004/07/BTTest.Models> <ConfigData>
Given this XML file: <?xml version=1.0 encoding=UTF-8?> <root> <data> <track clipid=1> <url>http://www.emp3world.com/to_download.php?id=33254</url> <http_method>GET or
I have got an XML document which looks something like this. <Root> <Info>....</Info> <Info>....</Info>
Let's say that I have something like this in my web.xml file. <filter name=foo>
I have an XML document with a default namespace indicated at the root. Something
Let's say I have an XML something like this: <root xmlns=default xmlns:add=additional> <element foo=fromDefault
I have a series of xml files that looks something like this: <ROOT> <F
All, I have an XML document that looks something like this: <root> <profile> <childA>

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.