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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:11:28+00:00 2026-06-11T04:11:28+00:00

I have a simple HTML fragment similar to this: <a href=123>link</a> I need to

  • 0

I have a simple HTML fragment similar to this:

<a href="123">link</a>

I need to transform it to

<abc:href var="123">link</abc:href>

I do it with XSLT, so I had to add the namespace in xsl:stylesheet

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:abc="http://abc.ru">

It works almost fine, unfortunately the XSLT transform keeps on adding a XMLNS to the output, like here:

<abc:href var="123" xmlns:abc="http://abc.ru">link</abc:href>

I don’t need the xmlns definition, can I remove it?

  • 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-06-11T04:11:29+00:00Added an answer on June 11, 2026 at 4:11 am

    Although it really goes against the grain, and I advise strongly against it, if you need to produce this malformed XML, then you can use an instruction like…

    <xsl:value-of disable-output-escaping="yes" select="
      concat('&lt;abc:href var="',$href,'"&gt;',$link,'&lt;/abc:href&gt;')
     "/>
    

    … where $href and $link are place-markers for the appropriate expression.


    Update

    In response to the OP’s comment, one could use a template like this…

    <xsl:template match="a">
      <xsl:value-of disable-output-escaping="yes" select="
        concat('&lt;abc:href var="',@href,'"&gt;',.,'&lt;/abc:href&gt;')
       "/>
    </xsl:template>
    

    This ugly solution should be used only as a last resort. A much better solution would be to use XSLT to produce your WHOLE document, not just an invalid fragment of it. This way you document would be well formed and you could bring to bear the full power and simplicity of XSLT.

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

Sidebar

Related Questions

I have made a simple fragment of html, which contains this: <a href=#><div>Something here</div></a>
I have simple HTML code: <input type='hidden' name='cat_id' value='123'/> <a href='#' class='edit'>Edit</a> <a href='#'
i have simple html that looks like this : <div class=img> <a target=_blank href=kl_big.htm
I have simple HTML page with svg like this: <div id=plan> <svg xmlns=http://www.w3.org/2000/svg version=1.1>
I have a simple html form. This form has a specific width and margin
I have a simple html multiline tooltip implementation: this.tooltip = function(tag) { xOffset =
I have this simple html structure: <div id=mainbody> <div id=main> ... </div> <div id=left>
I have a simple html table like this: <table> <thead> <tr><th>Column 1</th><th>Column 2</th></tr> </thead>
I have this simple HTML code: <div id=new_gallery> <p id=add_gallery>Add new gallery</p> </div> and
I have this fragment that demonstrates the problem: <html> <head> <title>height query demo</title> <script

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.