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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:27:17+00:00 2026-06-01T02:27:17+00:00

First, a thank you in advance. Second, this is my first post so apologies

  • 0

First, a thank you in advance. Second, this is my first post so apologies for any errors or wrongdoings.

I am a noob w/ xml and xslt, and can’t seem to figure this out. When I transform some xml using xslt 2.0, some of the headers from the xslt leaks into the new xml. It doesn’t seem to do it in xslt 1.0 (granted the xslt is a little different). Here is the xml:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xml_content>
<feed_name>feed</feed_name>
<feed_info>
    <entry_1>
        <id>1</id>
        <pub_date>1320814800</pub_date>
    </entry_1>
</feed_info>
</xml_content>

Here is the xslt:

<xsl:stylesheet version="2.0" 
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns="http://www.w3.org/TR/xhtml1/strict">
<xsl:output method="xml" indent="yes" />

<xsl:template match="xml_content">  
<Records>
    <xsl:for-each select="feed_info/entry_1">
        <Record>
            <ID><xsl:value-of select="id" /></ID>
            <PublicationDate><xsl:value-of select='xs:dateTime("1970-01-01T00:00:00") + xs:integer(pub_date) * xs:dayTimeDuration("PT1S")'/></PublicationDate>
        </Record>
    </xsl:for-each>
</Records>
</xsl:template>
</xsl:stylesheet>

Here is the new xml. Look specifically at the first “Records” element.

<?xml version="1.0" encoding="UTF-8"?>
<Records xmlns:xs="http://www.w3.org/2001/XMLSchema"
     xmlns="http://www.w3.org/TR/xhtml1/strict">
         <Record>
             <ID>1</ID>
             <PublicationDate>2011-11-09T05:00:00</PublicationDate>
         </Record>
</Records>
  • 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-01T02:27:18+00:00Added an answer on June 1, 2026 at 2:27 am

    Well if you put in literal result elements and the xsl:stylesheet defines a default namespace (with e.g. xmlns="http://www.w3.org/TR/xhtml1/strict") then that namespace applies to those result elements and the XSLT processor correctly emits that namespace declaration on the root of the result document. I am sure that happens with XSLT 1.0 and 2.0.

    As for the xmlns:xs="http://www.w3.org/2001/XMLSchema", you can get rid of that by adding exclude-result-prefixes="xs" on the xsl:stylesheet element.

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

Sidebar

Related Questions

Thank you in advance for any help with this problem. The Problem: Using Jquery
First of all thanks in advance, this has been very frustrating and I'm hoping
First, I would to thank everyone for all the help they provide via this
want somme help, thank you by advance. I've two page aspx, the first is
First hi and thanks in advance in ASP.NET : assume that i have a
$('#servertable td:eq(' + server + ')') this finds only 1 (first I think) match,
This is the logical flow for my application: At first, when the view controller
I mean if I check first clients input and it is OK the second
Yay, first post on SO! (Good work Jeff et al.) We're trying to solve
This is my first website attempt and I've been following a great tutorial while

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.