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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:28:23+00:00 2026-05-15T13:28:23+00:00

I have a document like this: <?xml-stylesheet type=text/css href=http://ltw1001.web.cs.unibo.it/svg.css encoding=UTF-8?> <!DOCTYPE html PUBLIC -//W3C//DTD

  • 0

I have a document like this:

<?xml-stylesheet type="text/css" href="http://ltw1001.web.cs.unibo.it/svg.css" encoding="UTF-8"?>
<!DOCTYPE html  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg= "http://www.w3.org/2000/svg">
<body>
<svg:svg width="500" height="560" version="1.1" >

...
...

</svg:svg></body></html>

i should extract only the content of body i tred with:

<?xml version="1.0" standalone="no"?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns="http://www.w3.org/HTML/1998/html4">
    <xsl:template match="/">
        <xsl:value-of select="//body" />
    </xsl:template>
</xsl:stylesheet>

but it don’t work

  • 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-15T13:28:24+00:00Added an answer on May 15, 2026 at 1:28 pm

    You have (at least) two problems:

    1. The default namespaces are different, so the template matches in the XSL won’t work. Either make them match or provide explicit namespace prefixes in the stylesheet.
    2. The value-of-select will return the text value of the body element, which is probably not what you want.

    If all you’re trying to accomplish is to output the SVG part as an SVG doctype, then do the following:

    1. Google “XSL Identity Transform” to understand how to do a “deep copy” from the input to the output.
    2. Add an <xsl:output ...> tag with doctype-public and doctype-system attributes specifying the doctype information you want output.

    This is untested, but should be pretty close. You’ll have to add the doctype info:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet 
      xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
      xmlns:svg= "http://www.w3.org/2000/svg"
      version="2.0">
    
      <xsl:output method="xml" doctype-public="..." doctype-system="..."/>
    
      <xsl:template match="/">
        <xsl:apply-templates select="//svg:svg"/>    
      </xsl:template>
    
      <xsl:template match="@*|node()">
        <xsl:copy>
          <xsl:apply-templates select="@*|node()"/>
        </xsl:copy>
      </xsl:template>
    
    </xsl:stylesheet>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have a xml document that looks like this <foo> <bar id=9 />
I am writing an XML document in C#. I have something like this... string
I have an XML document something like ::: <?xml version=1.0 encoding=utf-8?> <?mso-application progid=Excel.Sheet?> <Workbook
I have a simple xml document that looks like the following snippet. I need
I have a complete XML document in a string and would like a Document
In my Python app, I have an XML document that I'd like to transform
I have a ClickOnce environment like this: \\Fileserver\ClickOnceApps\App1.application C:\Documents and Settings\user\Start Menu\Programs\publisher\app1.appref-ms My understanding
I have an <img> in an HTML document that I would like to highlight
So I have a User model that :has_many other models like Documents, Videos, Posts
I have several A4 PDF documents which I would like (two into one) glue

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.