473,382 Members | 1,386 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

XHTML in XML

Is there a way of allowing XHTML tags in an XML document without including
them as #PCDATA?

I have a DTD for my document but want to include the XHTML DTD as well to
allow these extra tags. Can I do this and if so, how?

Thanks.
Jul 20 '05 #1
7 1626


Biblin wrote:
Is there a way of allowing XHTML tags in an XML document without including
them as #PCDATA?
XHTML is XML so there is no problem to use it inside of an XML document e.g.
<root>
<description>
<p xmlns="http://www.w3.org/1999/xhtml">description goes here</p>
</description>
</root>
I have a DTD for my document but want to include the XHTML DTD as well to
allow these extra tags. Can I do this and if so, how?


DTDs are very restricted when it comes to have XML with elements from
different namespaces while a W3C schema is able to model such documents
well by having a schema for each targetNamespace and using <xs:import>
to import one schema into the other.

If you really need to combine DTDs then check http://www.w3.org/, there
are some definitions for markup languages combining XHTML and MathML for
instance.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
Will I be able to validate the page if I use XML Schema? All the online
validators I have seen only support DTD's.
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:41*********************@newsread2.arcor-online.net...


Biblin wrote:
Is there a way of allowing XHTML tags in an XML document without including them as #PCDATA?
XHTML is XML so there is no problem to use it inside of an XML document

e.g. <root>
<description>
<p xmlns="http://www.w3.org/1999/xhtml">description goes here</p>
</description>
</root>
I have a DTD for my document but want to include the XHTML DTD as well to allow these extra tags. Can I do this and if so, how?


DTDs are very restricted when it comes to have XML with elements from
different namespaces while a W3C schema is able to model such documents
well by having a schema for each targetNamespace and using <xs:import>
to import one schema into the other.

If you really need to combine DTDs then check http://www.w3.org/, there
are some definitions for markup languages combining XHTML and MathML for
instance.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #3


Biblin wrote:
Will I be able to validate the page if I use XML Schema? All the online
validators I have seen only support DTD's.


There are XML parser implementations that support validation against a
W3C XML schema, for instance Xerces-C and Xerces-J from
http://xml.apache.org/, or MSXML from http://msdn.microsoft.com/.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #4
In article <41*********************@newsread2.arcor-online.net>,
Martin Honnen <Ma***********@gmx.de> wrote:

% > I have a DTD for my document but want to include the XHTML DTD as well to
% > allow these extra tags. Can I do this and if so, how?
%
% DTDs are very restricted when it comes to have XML with elements from
% different namespaces while a W3C schema is able to model such documents
% well by having a schema for each targetNamespace and using <xs:import>
% to import one schema into the other.

It's not too difficult to combine DTDs. In this case:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
%xhtml;

The issue isn't even with namespaces -- it's with namespace prefixes. In
this case, you mustn't give the HTML elements a namespace prefix, and
you must declare the default namespace prefix like this

xmlns='http://www.w3.org/1999/xhtml'

.. If the XHTML DTD were written to support modularity, you would be able
to specify what the prefix is, but you wouldn't be able to vary it in
instances of your document.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #5
Patrick TJ McPhee wrote:
In article <41*********************@newsread2.arcor-online.net>,
Martin Honnen <Ma***********@gmx.de> wrote:

% > I have a DTD for my document but want to include the XHTML DTD as well to % > allow these extra tags. Can I do this and if so, how?
%
% DTDs are very restricted when it comes to have XML with elements from % different namespaces while a W3C schema is able to model such documents % well by having a schema for each targetNamespace and using <xs:import> % to import one schema into the other.

It's not too difficult to combine DTDs. In this case:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
%xhtml;

The issue isn't even with namespaces -- it's with namespace prefixes. In this case, you mustn't give the HTML elements a namespace prefix, and
you must declare the default namespace prefix like this

xmlns='http://www.w3.org/1999/xhtml'

. If the XHTML DTD were written to support modularity, you would be able to specify what the prefix is, but you wouldn't be able to vary it in
instances of your document.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com

Hi,

Is there an XML Schema document that defines XHTML 1.1 ? Or is really
defined only in a DTD? [1]

The closest I can find is a W3C "working draft" from February 2004
titled "Modularization of XHTML™ in XML Schema". [2] Not yet the
"recommendation" I was hoping for.

I'm looking for the value I would put in the "schemaLocation" attribute
of the "xsd:import" element that I would add to my own XML Schema
document so I can add XHTML to my XML instance document and still
validate it against my XML Schema (with Xerces 2.6.2, incidentally).

<xsd:import namespace="http://www.w3.org/1999/xhtml"
schemalocation="???"/>

Thanks,

Greg.

[1] http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
[2] http://www.w3.org/TR/xhtml-m12n-schema

Jul 20 '05 #6
http://www.w3.org/TR/xhtml1-schema/#schemas

"Greg" <sa**********@hotmail.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Patrick TJ McPhee wrote:
In article <41*********************@newsread2.arcor-online.net>,
Martin Honnen <Ma***********@gmx.de> wrote:

% > I have a DTD for my document but want to include the XHTML DTD as well to % > allow these extra tags. Can I do this and if so, how?
%
% DTDs are very restricted when it comes to have XML with elements from % different namespaces while a W3C schema is able to model such documents % well by having a schema for each targetNamespace and using <xs:import> % to import one schema into the other.

It's not too difficult to combine DTDs. In this case:

<!ENTITY % xhtml PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN">
%xhtml;

The issue isn't even with namespaces -- it's with namespace prefixes. In this case, you mustn't give the HTML elements a namespace prefix, and
you must declare the default namespace prefix like this

xmlns='http://www.w3.org/1999/xhtml'

. If the XHTML DTD were written to support modularity, you would be able to specify what the prefix is, but you wouldn't be able to vary it in
instances of your document.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com

Hi,

Is there an XML Schema document that defines XHTML 1.1 ? Or is really
defined only in a DTD? [1]

The closest I can find is a W3C "working draft" from February 2004
titled "Modularization of XHTMLT in XML Schema". [2] Not yet the
"recommendation" I was hoping for.

I'm looking for the value I would put in the "schemaLocation" attribute
of the "xsd:import" element that I would add to my own XML Schema
document so I can add XHTML to my XML instance document and still
validate it against my XML Schema (with Xerces 2.6.2, incidentally).

<xsd:import namespace="http://www.w3.org/1999/xhtml"
schemalocation="???"/>

Thanks,

Greg.

[1] http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd
[2] http://www.w3.org/TR/xhtml-m12n-schema
Jul 20 '05 #7
Wole Ogunremi wrote:

Please don't top post or full quote, it makes it very difficult to follow
the flow of conversation.
http://www.w3.org/TR/xhtml1-schema/#schemas


To quote:
This document provides informative XML Schemas for XHTML 1.0 [XHTML1].
These Schemas are still work in progress, and are likely to change in
future updates.

The previous poster was looking for a _recommendation_ describing a scheme
for _XHTML_1.1_.
--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 20 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Peter Rohleder | last post by:
Hi, I have a few simple questions in order to use modularized xhtml and getting it to work. A simple example may make this obviouse: Lets say we want to create a simple xml-file to reflect...
59
by: Philipp Lenssen | last post by:
I've tested some of the new Nokia 6600 functionality. It ships with WAP2 and XHTML Support (it says). What it does is check the Doctype -- if it's not the XHTML Mobile Profile Doctype, but a...
32
by: jp29 | last post by:
My take on problems composing, serving and rendering XHTML documents/web pages: 1. Typical conscientious web authors are producing XHTML documents (Web pages) that feature valid Markup and with...
16
by: Mcginkel | last post by:
I am trying to find a way to load XHTML content in an Iframe. I use to do this in html by using the following code : var iframeObject = document.createElement("iframe");...
82
by: Buford Early | last post by:
I read this in http://annevankesteren.nl/2004/12/xhtml-notes "A common misconception is that XHTML 1.1 is the latest version of the XHTML series. And although it was released a bit more than a...
2
by: Joris Janssens | last post by:
I'm trying to write a program for validating XHTML 1.1-documents against the XHTML 1.1 DTD (which is actually the same as validating an XML-file) but I always get a "(404) Not found" error. This...
12
by: Alex D. | last post by:
How can I stop asp.net from rendering XHTML istead of HTML? My javascripts are rendering wrong because of that. It is rendering &amp; to clients instead of &. Any help? Thanks, Alejandro.
11
by: Tomek Toczyski | last post by:
What is the best way to attach a caption to an image in xhtml? I can attach a caption to a table by a "<caption>" tag but I would like to do sth similar to an image. How to do it in a natural...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
10
by: Robert Huff | last post by:
Can someone offer suggestions why, on the same server (Apache 2.2.8), this works <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> <html lang="en-US"> <head> <link rel=stylesheet...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.