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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:02:17+00:00 2026-06-15T11:02:17+00:00

I am trying to transform some HTML files to my own XML-format via XSL.

  • 0

I am trying to transform some HTML files to my own XML-format via XSL.

For this purpose I use HTML Tidy to clean up the input files, then transform them to xhtml with html2xhtml and then use a xsl script with msxsl to transform the xhtml files to my own format.

However, the last step is failing with not a error message at all (it is a semantical fail; not a technical ;-)): My output file just contains empty tags.

I had a problem like this before and removed the xmlns attribute from the html tag, what causes nearly all of the online transformers to work with my files correctly. MSXSL now writes the following error message: “Use of default namespace declaration attribute in DTD not supported”.

Find the files I use here: http://pastie.org/5483087

Thank you 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-06-15T11:02:18+00:00Added an answer on June 15, 2026 at 11:02 am

    Well that is the FAQ with XSLT and XPath 1.0, the elements in your input XHTML document are in a namespace and your XSLT does not take that into account. You need to change it to e.g.

    <xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xhtml="http://www.w3.org/1999/xhtml"
    exclude-result-prefixes="xhtml">
    <xsl:template match="/">
    
      <stellenausschreibung>
        <hochschule><xsl:value-of select="//xhtml:div[@id='contentText']/xhtml:img/@alt" /></hochschule>
        <anbieter><xsl:value-of select="//xhtml:p[@id='ad_employer']" /></anbieter>
        <typ><xsl:value-of select="//xhtml:h1" /></typ>
        <bewerbungsschluss><xsl:value-of select="//xhtml:span[@id='ad_bewerbungsschluss']" /></bewerbungsschluss>
        <erscheinungsdatum><xsl:value-of select="//xhtml:span[@class='job_published_at']" /></erscheinungsdatum>
    
        <inhalt><xsl:value-of select="//xhtml:p[@id='ad_job']" /></inhalt>
      </stellenausschreibung>
    
    </xsl:template>
    </xsl:stylesheet>
    

    The prefix (in my example xhtml) for the XHTML namespace used in the stylesheet can of course be freely chosen but it is necessary to use one as with XSLT/XPath 1.0 a path of e.g. //p always selects p elements in no namespace.

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

Sidebar

Related Questions

I'm trying to use XSL-stylesheets in order to transform some generated XML-data to HTML-output.
I am trying to transform an xml file with xsl stylesheet into html. this
I'm trying to transform one XML format to another using XSL. Try as I
I'm trying to transform some XML-data to HTML with XSLT for my bachelor thesis.
I'm trying to transform some XML into HTML using XSLT . Problem: I can't
I am using lxml 2.2.8 and trying to transform some existing html files into
I'm trying to take a xml document and transform to a standard html list
I am trying to display xml data in html via XSLT. I am building
Pretty basic developer here. I currently use mappath to transform my XSL and XML
I am trying to use Regular Expressions to decode some HTML I retrieve from

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.