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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:21:32+00:00 2026-06-04T23:21:32+00:00

I am working on call-template, where the source looks like this. Source: <Content> <first>

  • 0

I am working on call-template, where the source looks like this.

Source:

    <Content>
         <first>
                <text>
                Text
            </text>
            <link xmlns="Some namespace">
                <AA>abcd</AA>
                <BB>hi all</BB>
            </link>
         </first>

         <second>
         <link xmlns="Some other namespace">
                <AA>abcd1</AA>
                <BB>hi all21</BB>
            </link>
         </second>

          <three>
         <link xmlns="other namespace">
                <AA>abcd2</AA>
                <BB>hi all33</BB>
            </link>
         </three>
    </Content>

XSLT written:

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

      <xsl:template match="Content">
       <xsl:call-template name="process">
         <xsl:with-param name="item" select="first/n1:link" />
    </xsl:call-template>
         <xsl:call-template name="process">
         <xsl:with-param name="item" select="second/n2:link" />
    </xsl:call-template>
         <xsl:call-template name="process">
         <xsl:with-param name="item" select="three/n3:link" />
    </xsl:call-template>


      </xsl:template>

      <xsl:template name="process">
        <xsl:param name="item" />
        <xsl:value-of select="$item/AA" />
      </xsl:template>

    </xsl:stylesheet>

I am getting blank output.I know the reason because i didn’t append the namespace prefix for it. like “n1:A” like that.

As the is coming multiple times. I wrote a template and called where ever needed. But the name space of each link is diffrent. How to do I modify my code so that I can reuse the template “process”.

Can any one help, how Do I modify the “process” template accordingly to handle with diffrent namespace but same structure.

Thank you.

  • 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-04T23:21:33+00:00Added an answer on June 4, 2026 at 11:21 pm

    Instead of doing this

    <xsl:value-of select="$item/AA" />
    

    You could change the expression to this

    <xsl:value-of select="$item/*[local-name() = 'AA'][namespace-uri()=namespace-uri($item)]" />
    

    i.e. Check the name without namespace is ‘AA’, and that it has the same namespace as the parent element. This would mean if you had another ‘AA’ element within the ‘link’ element with a different namespace, it would not be picked up.

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

Sidebar

Related Questions

I've got this code (which is working properly): <xsl:template name=CamelChain> <xsl:param name=input/> <xsl:param name=position/>
I'm working on an XSL template to convert an XHTML/hResume document to plain text,
I thought we could call the template function without template parameter. Why is this
I working in Rails and I need to call to an PHP-script. I can
I call the following function with a mouseover event but it's not working. My
Everything is working fine until I call the saveFile method (shown below) to write
I'm currently working on what I would call integration tests. I want to verify
working on xcode I realized that if I create a non-void method, I call
I've been working with JavaScript and i need to call a function from another
I'm working with a framework and need to make a call to a specific

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.