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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T21:24:00+00:00 2026-05-14T21:24:00+00:00

I have an xml file and an xslt file. The xml file has a

  • 0

I have an xml file and an xslt file.

The xml file has a xmlns=”exa:com.test” attribute.

If i remove this attribute in the xml the xpath sentences in my xslt works. But if i leave it, doesnt work.

Im using the following code to mix xml and xslt:

XslCompiledTransform transformer = new XslCompiledTransform();

transformer.Load(HttpContext.Current.Server.MapPath("xslt\\searchresults.xslt"));  

transformer.Transform(xmlreader, null, utf8stringwriter);

What im doing wrong? How could i mix xml and xslt if the xml has the xmlns attribute on top?

  • 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-14T21:24:00+00:00Added an answer on May 14, 2026 at 9:24 pm

    The xmlns attribute without prefix name replaces the default namespace, so that your query matches nodes with a different (empty) namespace. You need to use a prefixed namespace in the XSLT XPath queries (or a XmlNamespaceManager for isolated XPath queries) and your queries will work again as expected.

    In the XSLT:

    <xsl:stylesheet ... xmlns:exa="exa:com.test">
    

    Then, assuming that you used to match for instance xyz, you now change your query like this:

    <xsl:template match="exa:xyz"> ...
    

    In general you might want to read some docs on XML namespaces.

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

Sidebar

Related Questions

All, I have an XML file which I transform it using an XSLT document
I have an XSLT transform I am using to process an XML file, inserting
I have an xml file which describes (among other things) elements with attribute values
I have an XML document that has an XML node named Description The Description
Simple question. I have an XML file with a few dozens of comment blocks.
Again a simple thing. I have a stylesheet that parses XML and XSL files.
When processing XML by means of standard DOM, attribute order is not guaranteed after
The top answer to this question describes a technique to implement an efficient XSLT
I am doing an xslt transform inside my c# program. When I run the
I'm still searching, but I haven't found yet the way to perform something like

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.