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

  • Home
  • SEARCH
  • 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 5997263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:14:19+00:00 2026-05-23T00:14:19+00:00

It’s a problem with match elements which have specific node. The xml: <?xml version=1.0

  • 0

It’s a problem with match elements which have specific node.

The xml:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" herf="B1.xsl"?>
<profile xmlns:base = "urn:mytest:baseInfo"
xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#">
    <base:Description>
        <base:text>description of profile</base:text>
    </base:Description>
    <prf:Component>
        <prf:Keyboard>PhoneKeyPad</prf:Keyboard>
        <prf:Model>SampleModel</prf:Model>
        <prf:NumberOfSoftKeys>3</prf:NumberOfSoftKeys>
        <prf:PixelAspectRatio>1x1</prf:PixelAspectRatio>
        <prf:ScreenSize>128x240</prf:ScreenSize>
    </prf:Component>
</profile>

and the XSLT is:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:base = "urn:mytest:baseInfo" xmlns:prf="http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#">
<xsl:output method="xml" indent="yes"/>


<xsl:template match="prf:*">
    <xsl:variable name="temp">
        <xsl:value-of select="local-name(.)"/>
    </xsl:variable>

    <xsl:element name="{$temp}">
        <xsl:apply-templates/>
    </xsl:element>
</xsl:template>

</xsl:stylesheet>

The result is:

<?xml version="1.0" encoding="UTF-8"?>description of profile<Component>
    <Keyboard>PhoneKeyPad</Keyboard>
    <Model>SampleModel</Model>
    <NumberOfSoftKeys>3</NumberOfSoftKeys>
    <PixelAspectRatio>1x1</PixelAspectRatio>
    <ScreenSize>128x240</ScreenSize>
</Component>

Why the “description of profile” is also output? It has “base” namespace.

Thanks in advance.

  • 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-23T00:14:20+00:00Added an answer on May 23, 2026 at 12:14 am

    The simple answer is: Because you never tell the XSLT processor to ignore it.

    You provide a template that processes prf:*, but you do not forbid the processing of base:. Given nothing else, the XSLT processor applies default behavior (built-in rules, also here) to any nodes it encounters that are not handled by any custom template.

    The default behavior for element nodes is:

    • copy their text-node children to the output,
    • process their child elements

    Knowing that, your <base:Description> and <base:Text> elements produce exactly what you see. To prevent it, either catch them with an empty template:

    <xsl:template match="base:*" /> 
    

    or direct the program flow manually by defining a template for the root node:

    <xsl:template match="/">
      <xsl:apply-templates select="profile/prf:Component" />
    </xsl:template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have a reasonable size flat file database of text documents mostly saved in
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.