Hi
What I need to do is to take the following XML (or some variant of it):
<?xml version="1.0" encoding="UTF-8"?>
<MyRawHTML>
<H1>Hello, world!</H1>
</MyRawHTML>
And apply an XSLT to it along the lines of:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<html>
<head>
</head>
<body>
<p>
<xsl:value-of select="/MyRawHTML" />
<!-- This doesn't work either:
<![CDATA[<H1>Hello, world!</H1>]]>
-->
</p>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
So that I get:
<html>
<head>
</head>
<body>
<p>
<H1>Hello, world!</H1>
</p>
</body>
</html>
Is this possible? I have tried to use CDATA, but I just get the text
"<H1>Hello, world!</H1>" coming through instead.
Thank you for any help anyone can provide.
Marek 3 2285
Hello! What I need to do is to take the following XML (or some variant of it): <?xml version="1.0" encoding="UTF-8"?> <MyRawHTML> <H1>Hello, world!</H1> </MyRawHTML>
Value-Of is wrong here, it converts everything to a string (if you put
it here).
Use copy-of:
<xsl:copy-of select="/MyRawHTML/*/node()" />
This copies all the content of MyRawHTML, including Attributes to the
output.
Beware of namespace problems!
<MyRawHTML xmlns="urn:foo" >
<h1>Hello, world!</h1>
</MyRawHTML>
Will give you this:
<html xmlns="http://www.w3.org/1999/xhtml/">
<body>
<h1 xmlns="urn:foo" >Hello, world!</h1>
</body>
</html>
This means, that the h1-Element is not an HTML-Element and will not be
rendered as you thought by some browsers (Mozilla).
This will give you the output you wish:
<MyRawHTML xmlns="urn:foo" >
<h1 xmlns="http://www.w3.org/1999/xhtml/>Hello, world!</h1>
</MyRawHTML>
--
Pascal Schmitt
It will work if your XML is as follows instead of ur XSLT
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="test.xslt "?>
<MyRawHTML>
<![CDATA[<H1>Hello, world!</H1>]]>
</MyRawHTML>
Can you get your XML in this format?
If not - then we can look @ some other Solution.
----------------------------------------------------------------------
"Marek" wrote: Hi What I need to do is to take the following XML (or some variant of it): <?xml version="1.0" encoding="UTF-8"?> <MyRawHTML> <H1>Hello, world!</H1> </MyRawHTML>
And apply an XSLT to it along the lines of:
<?xml version="1.0" encoding="UTF-8"?> <xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <html> <head> </head> <body> <p> <xsl:value-of select="/MyRawHTML" />
<!-- This doesn't work either: <![CDATA[<H1>Hello, world!</H1>]]> -->
</p> </body> </html> </xsl:template> </xsl:stylesheet>
So that I get:
<html> <head> </head> <body> <p> <H1>Hello, world!</H1> </p> </body> </html>
Is this possible? I have tried to use CDATA, but I just get the text "<H1>Hello, world!</H1>" coming through instead.
Thank you for any help anyone can provide.
Marek
I have te same problem as Marek:
I want to use HTML tags in the XML data file, and I want to keep these
tags in the output.
I tried the CDATA all way, and it doesn't work.
This thing with the "node()" doesn't work too.
But it seems good. Maybe some mistake in the example? (not the double
quote)
Plz help me!
Thanks
--
Mekett
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message1774249.html This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ed Lai |
last post by:
A few weeks ago I have the idea of converting XML instance data to a
HTML form, using tags as the label and the resulting form can be used
to edit the XML data. So I started to play around with it, and have
some prelimary proof of concept stuff working. Then I started to
search around on the web for similar works. There seem to be quite a
few people with the same idea. The following is an example. However as
far as I can tell, nobody...
|
by: Donald Firesmith |
last post by:
Are html tags allowed within meta tags? Specifically, if I have html
tags within a <definition> tag within XML, can I use the definition as
the content within the <meta content="description> tag? If not, is
there an easy way to strip the html tags from the <definition> content
before inserting the content into the meta tag?
|
by: john T |
last post by:
Is there anyway to vertically center a html table using css in such a
way it does not alter the html table. When I tryied it just screws up.
|
by: Howard Kaikow |
last post by:
Where is the official documentation of what constitutes a minimally
compliant HTML file?
--
http://www.standards.com/; See Howard Kaikow's web site.
|
by: Eric Lindsay |
last post by:
Should HTML 4.01 Strict markup be done in upper case or in lower case?
I understand that HTML allows either upper or lower case. I also notice
that XHTML apparently requires lower case. However I saw some mention
that the HTML DOM uses upper case for markup elements.
So, should I worry about what this means?
I am inclined to go with lower case, for two reasons.
Easier to change if I subsequently want to use XHTML.
| |
by: Eric Lindsay |
last post by:
I have been trying to get a better understanding of simple HTML, but I
am finding conflicting information is very common. Not only that, even
in what seemed elementary and without any possibility of getting wrong
it seems I am on very shaky ground .
For example, pretty much every book and web course on html that I have
read tells me I must include <html>, <head> and <body> tag pairs.
I have always done that, and never questioned it. ...
|
by: Arthur Dent |
last post by:
Hello all, ive been programming with ASP.NET since it came out, but am just
getting my feet with now with v.2.
Ive noticed something strange in the way my HTML tables get rendered with 2.
I use tables to layout my pages, doing three rows, a header, content and
footer. When i do this, i make the tables height=100%,
so the footer always shows up at the very bottom of the page.
With 2.0/2005 though, when it renders the pages, it doesnt...
|
by: sysxperts |
last post by:
Hi,
I have a mail server that generates archives in a directory for every
message sent or received and each archive has an associated XML file
with <sender>, <receiver>, <subject> and other email related tags and
all files have same exact format. I would like to generate reports in
a web page based upon the content of these XML files but not sure where
to start. I know how to make an individual XML file display in browser
by linking a...
|
by: Peter Michaux |
last post by:
Hi,
I am experimenting with some of the Ruby on Rails JavaScript generators
and see something I haven't before. Maybe it is worthwhile?
In the page below the script is enclosed in
//<!]>
Is this trick grounded in any real information about HTML vs XHTML? I
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |