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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:01:41+00:00 2026-05-22T23:01:41+00:00

I am having problem transforming xml to xml using xsl. I found out where

  • 0

I am having problem transforming xml to xml using xsl. I found out where the problem comes from but still don’t know how to fix it.

<?xml version="1.0" encoding="UTF-8"?>
<tells uri="" xmlns="http://dl.kr.org/dig/2003/02/lang">
  <impliesc>
    <catom name="name1"/>
    <catom name="name2"/>
  </impliesc>
  <impliesc>
    <catom name="name3"/>
    <catom name="name4"/>
  </impliesc>
</tells>   

I think the problems comes from this line

<tells uri="" xmlns="http://dl.kr.org/dig/2003/02/lang">

If I remove the “uri=”” xmlns=”http://dl.kr.org/dig/2003/02/lang”&#8221; and leave only the

"<tells>" 

everything works perfectly. But is there a way to transform it without removing it?

<?xml version="1.0" encoding="utf-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

<xsl:template match="/">

    <xsl:element name="tells">

        <xsl:for-each select="./tells/impliesc">

            <xsl:element name="impliesc">

                <xsl:for-each select="./tells/impliesc/catom">

                    <xsl:element name="catom">

                        <xsl:attribute name="name">
                            <xsl:value-of select="./tells/impliesc/individual/@name"/>
                        </xsl:attribute>

                     </xsl:element>

                </xsl:for-each>

            </xsl:element>

        </xsl:for-each>

    </xsl:element>

</xsl:template>

</xsl:stylesheet>
  • 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-22T23:01:42+00:00Added an answer on May 22, 2026 at 11:01 pm

    You are correct: the reason your transformation isn’t working is that you have a namespace declaration on the tells element.

    To make this particular problem go away, you need to make your XSLT aware of the namespace, and tell it that the tells element that it’s trying to transform belongs to that namespace. The most common way to do this is to declare a namespace prefix in the xsl:stylesheet element, and then use that prefix in the XPath, e.g.:

    <xsl:stylesheet xmlns:n="http://dl.kr.org/dig/2003/02/lang" ... >
       ...
       <xsl:template match="/">
          <output>
             <xsl:apply-templates select="//n:tells"/>
          </output>
       </xsl:template>
    
       <xsl:template match="n:tells">
          ...
       </xsl:template>
    
    <xsl:stylesheet>
    

    The xmlns:n attribute at the top of the stylesheet tells the XSLT processor that the ‘http://dl.kr.org/dig/2003/02/lang’ namespace exists, and that the n: prefix is an abbreviation for it. In the select and match attributes, the n: prefix tells the XSLT processor that when it’s looking for elements named tells, it should look for elements with that name that are in the http://dl.kr.org/dig/2003/02/lang namespace.

    XML namespaces are an essential part of XML technologies, and people often overlook them when they’re learning XML – they’re complicated and not very intuitive, and you can ignore them for quite a while when you’re coming up to speed on XML. But there comes a point where you can no longer afford the simplifying assumption that namespaces don’t exist, and you’re at that point.

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

Sidebar

Related Questions

I am having trouble transforming particular characters from an XML feed into XHTML. I
m having problem in operating on richtextbox from another class m using backgroundworker class
I am having problem using mvc:resources in spring 3.1 configuration. Initially i was working
I am having problem in using this font in my Application. I have imported
Having problem to open form in new window, script is pulled from external service.
hi I'm having problem with my database. I'm using access as my database and
I am having problem understanding Priority Inversion Snippet from the article: Consider there is
I'm having a problem figuring out how to represent a many-to-many relationship model in
I'm having troubles with transforming .docx to html... I'm using PHPDOCX FREE to handle
I´m having problem using validation on DropDownListFor ... My Model : public class User

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.