473,808 Members | 2,775 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Extending the XHTML transitional XSD

Hi all,
I'm attempting to write a validator for some email template files we
use as part of our e-commerce application (incidentally in C#) and I've
run into a problem as I'm not a huge user of XML.

Essentially an email template can contain any valid XHTML, but also has
tags such as <membershipcard headerand <membershipcard footerthat can
appear anywhere in the body of the HTML.

I've managed to download the XSD for XHTML transitional from the W3C
and can validate plain XHTML files fine, and can do the same with
simple XML containing my tags - but I have no idea how to proceed and
get the .NET parser to validate from either of the XSD's?

Or can I somehow inherit my XSD from the XHTML transitional one? I've
looked at the xsd:redefine tag but have no idea where to start?

Can anyone assist?

Cheers,
Kieran

Sep 3 '06 #1
11 2207
Hi,

take a look at XHTML modularization,
it seems useful to extend the xhmlt specs with custom tags.

There's something in the XHTML section on w3c official site, like this:

http://www.w3.org/MarkUp/Guide/xhtml-m12n-tutorial/

Sep 4 '06 #2

Kidogg wrote:
Essentially an email template can contain any valid XHTML, but also has
tags such as <membershipcard headerand <membershipcard footerthat can
appear anywhere in the body of the HTML.
HTML email is an abomination, XHTML doubly so.

Although the "XHTML route" to adding these elements is obvious (look at
modularized XHTML) you're heading further and further away from what's
a realistically usable version of HTML for today's clients. I'd
strongly recommend that you stick with HTML 4.01 as any "public" use of
"HTML".

There's also a serious question as to why you need to include new tags
in publically published content. If they're new and unknown, then
what's the client expected to do with them ? If they're unusable, why
include them ?

Assuming that they're significant for your in-house CMS, then I'd be
strongly inclined to use them internally with namespaced XHTML
(probably just XHTML 1.0 Strict), then strip them out with a final
"transcode for publication" step, possibly in XSLT, that also converts
it to HTML 4.01. This is also a usable route to plaintext email.

PS - send HTML email to me and it goes straight into /dev/null/ You
_are_ going to support plaintext, aren't you?

Sep 4 '06 #3

Andy Dingley wrote:
Kidogg wrote:
Essentially an email template can contain any valid XHTML, but also has
tags such as <membershipcard headerand <membershipcard footerthat can
appear anywhere in the body of the HTML.

HTML email is an abomination, XHTML doubly so.
Justify yourself. Just because we provide HTML email templates does not
mean that they are massively bloated or horrendously formatted. Some of
our clients simply request that they can have some control over the
formatting of their outputted email.
>
Although the "XHTML route" to adding these elements is obvious (look at
modularized XHTML) you're heading further and further away from what's
a realistically usable version of HTML for today's clients. I'd
strongly recommend that you stick with HTML 4.01 as any "public" use of
"HTML".
Our webpages are fully XHTML strict compliant and we have no issues -
practically full compatibilty across the board in terms of browsers
(including mobile devices). What issues are you aware of regarding
using XHTML as opposed to 4.01?
>
There's also a serious question as to why you need to include new tags
in publically published content. If they're new and unknown, then
what's the client expected to do with them ? If they're unusable, why
include them ?
The point is that they are not included in the final email that is
sent. They are part of a templating system, we have XML email templates
that I wish to validate to stop our clients shooting themselves in the
feet with badly formed XML.
>
Assuming that they're significant for your in-house CMS, then I'd be
strongly inclined to use them internally with namespaced XHTML
(probably just XHTML 1.0 Strict), then strip them out with a final
"transcode for publication" step, possibly in XSLT, that also converts
it to HTML 4.01. This is also a usable route to plaintext email.
Which is what we already do to get our plaintext output. This does not
solve the problem of trying to validate the templates in the first
place however.
>
PS - send HTML email to me and it goes straight into /dev/null/ You
_are_ going to support plaintext, aren't you?
Firstly, as above, of course we do, and secondly, you are not
necesarily the typical market demographic for recepients of emails from
our system - just because you prefer plain text does not hold true for
all users.

Regards,
Kieran

Sep 4 '06 #4

monique wrote:
Hi,

take a look at XHTML modularization,
it seems useful to extend the xhmlt specs with custom tags.

There's something in the XHTML section on w3c official site, like this:

http://www.w3.org/MarkUp/Guide/xhtml-m12n-tutorial/
Thanks for that Monique, it does look like the right track for me. I've
also considered the posibility of just making changes to the
transitional xsd and renaming it / changing the namespace. I take it
that is considered bad practice?

Cheers,
Kieran

Sep 4 '06 #5
On 4 Sep 2006 04:11:14 -0700, "kieranbent on" <ki**********@g mail.com>
wrote:
>Andy Dingley wrote:
>PS - send HTML email to me and it goes straight into /dev/null/ You
_are_ going to support plaintext, aren't you?

Firstly, as above, of course we do, and secondly, you are not
necesarily the typical market demographic for recepients of emails from
our system - just because you prefer plain text does not hold true for
all users.
Throwing HTML email in the bin is a good way of getting rid of
mountains of unwanted mail/pictures/advets/unsolicited stuff. I have
used the technique successfully for years. Anyone who really needs to
contact me shoul/ought to be able to send in plain text, and if they
can't yet, they have to learn.

--
Posted via a free Usenet account from http://www.teranews.com

Sep 4 '06 #6
Hi

I'm afraid that renaming/changing an existing standard is really bad
practise.

It isn't a safe choice,
even if you need a quick and (really!!!) dirty prototype ... :-)

I've seen examples of the modularization in a custom cms
where new tags acts as placeholders to tell the engine
where the dynamic contents need to be placed.

All the markers are replaced by the engine with the contents
in a single XSLT transformation.

So the output is XHTML Strict 1.0 compliant.

That's all.

Bye ;-)

kieranbenton ha scritto:
monique wrote:
Hi,

take a look at XHTML modularization,
it seems useful to extend the xhmlt specs with custom tags.

There's something in the XHTML section on w3c official site, like this:

http://www.w3.org/MarkUp/Guide/xhtml-m12n-tutorial/

Thanks for that Monique, it does look like the right track for me. I've
also considered the posibility of just making changes to the
transitional xsd and renaming it / changing the namespace. I take it
that is considered bad practice?

Cheers,
Kieran
Sep 4 '06 #7

Ben Newsam wrote:
Throwing HTML email in the bin is a good way of getting rid of
mountains of unwanted mail/pictures/advets/unsolicited stuff.
We probably shouldn't talk too loudly about that, as it's one of the
most useful spam filters around 8-)

Phishing usually falls flat in plaintext as the phishing sites become
obvious when viewed that way. For this reason, most phishfood is pure
HTML and deliberately without a plaintext version. They're not just
being inaccessible here, they're doing it deliberately. Now I've no
real problem with someone who sends me competent HTML _and_ a plaintext
version, but HTML alone just smells so much like spam it's going
straight in the bin.

Sep 4 '06 #8
kieranbenton wrote:
HTML email is an abomination, XHTML doubly so.

Justify yourself.
What MIME type are you using when you send them out? XHTML is not
widely processable as XML out in "the real world", so you're dependent
on Appendix C for getting it to work. Assuming that you're going to go
with HTML for email, then it ought to be HTML and not XHTML. There is
no reason for sending it with a pure-XML MIME type on it.

Sep 4 '06 #9
"Kidogg" <ki**********@g mail.comwrites:
...
I've managed to download the XSD for XHTML transitional from
the W3C and can validate plain XHTML files fine, and can do the
same with simple XML containing my tags - but I have no idea
how to proceed and get the .NET parser to validate from either
of the XSD's?
Or can I somehow inherit my XSD from the XHTML transitional
one? I've looked at the xsd:redefine tag but have no idea where
to start?
Unless you're doing something rather unusual you probably won't
need to use xsd:redefine. All you need to do is induce the
validator to create a single schema containing (a) the components
you want from the schema for XHTML transitional, and (b) the
components from your schema for your stuff. Many validators will
take run-time parameters indicating a set of schema documents
they should read and build schema components from; many (most?)
will automatically read and process any schema document mentioned
in a schemaLocation hint in the XML instance, unless you
explicitly tell them not to do so.

It probably won't be essential, but it may be convenient to
create a driver file: a single schema document that imports both
the XHTML schema documents you want and your own stuff. It might
look like this:

<xsd:schema xmlns:xsd ="http://www.w3.org/2001/XMLSchema" >

<xsd:annotation >
<xsd:documentat ion>
<div xmlns="http://www.w3.org/1999/xhtml">
<p>Simple driver file for schema with XHTML and my-stuff.</p>
<p>Just import what we know we need. This provides a single
schema document to start out from.</p>
</div>
</xsd:documentati on>
</xsd:annotation>

<xsd:import
namespace="http ://www.example.com/myschema"
schemaLocation= "http://www.example.com/myschema.xsd"/>

<xsd:import
namespace="http ://www.w3.org/199/xhtml"
schemaLocation= "http://www.example.com/mycache/xhtml-transitional.xs d"/>

</xsd:schema>

Strictly speaking, the schemaLocation attribute on xsd:import
is a hint, not an instruction; you'll want to consult the
documentation for the validator you're using to see whether
it honors the hint (almost all current schema processors
seems to -- it can be a problem to tell them NOT to do so,
if for some reason you want to prevent it).

Once you succeed in getting the processor to build a schema
with components for both namespaces you're interested in,
you may discover that one or the other of the schema authors
has failed to indicate any place where elements in other
namespaces are legal. It's been a while since I read the
XHTML schema documents, so I don't remember whether they
have wildcards for other namespaces at appropriate locations
or not. If they do, and your stuff does, too, then you're
done. (From your description, I infer that your declaration
for a template will allow as content any element from the
XHTML namespace; if it doesn't, either I've misunderstood
your design or you may want to make a change.)

If the XHTML schema documents have no wildcards, then you'll need
to do something about it, to make sure your stuff (e.g. your
membershipcardh eader and membershipcardf ooter elements) can occur
at appropriate locations in an HTML context. The easiest way is
to declare your elements as substitutable for appropriate XHTML
elements.

If, for example, membershipcardh eader should be able to
appear pretty much wherever the XHTML 'p' element can
appear, then you'd write

<xsd:element name="membershi pcardheader"
substitutionGro up="xhtml:p"
... >
...
</xsd:element>

One concern here is that the type of membershipcardh eader
needs to be the same as that of xhtml:p, or derived from
it by extension or restriction. Be sure you're using the
schema documents from the Modularization of XHTML document,
not the ones intended for stand-alone use in "XHTML 1.0
in XML Schema".

I hope this helps.

--C. M. Sperberg-McQueen
World Wide Web Consortium

Sep 7 '06 #10

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

Similar topics

1
2145
by: Gordon - Adelphia | last post by:
I have a question regarding xhtml. Why, why, why does the ELEMENT <body> allow “unblocked” text. HTML does not (though, most browsers will render). Xhtml (transitional) however allows text nodes (PCDATA). All of HTML 4, xhtml – transitional, and xhtml-strict allow <div> to contain “unblocked” text. Does anybody know why – I’m looking for the philosophy behind allowing such. I’m in the process of encapsulating xhtml mark-up in content...
17
2485
by: Werner Partner | last post by:
I tried to begin with XHTML 1.0 and succeeded to get one document valid. But I got a feedback which sounds as if I should change something in my document: The document located at <http://www.kantele.de/> was tentatively found to be Valid. That means it would validate as XHTML 1.0 Transitional if you updated the source document to match the options used (typically this message indicates that you used either the Document Type override...
35
4650
by: The Bicycling Guitarist | last post by:
My web site has not been spidered by Googlebot since April 2003. The site in question is at www.TheBicyclingGuitarist.net/ I received much help from this NG and the stylesheets NG when updating the code before then. My host's tech guy just sent me the following. Isn't it okay to specify UTF-8 as the charset in the HTTP headers at the server level? Isn't it okay to have validated XHTML 1.0 strict code? ...
29
3914
by: Armand Karlsen | last post by:
I have a website ( http://www.zen62775.zen.co.uk ) that I made HTML 4.01 Transitional and CSS compliant, and I'm thinking of converting it into XHTML to learn a little about it. Which XHTML variant would you recommend? The w3c HTML validator mentions XHTML 1.0 Transitional, Basic, Strict, and XHTML 1.1. Would I be able to make my existing CSS work in the XHTML page without modification to the .css file?
8
1960
by: Anthony Williams | last post by:
Morning all, I'm having a wee problem with a project I'm working on at the moment. I'm leading my company into producing a website, based upon Web Standards, which will be created using XHTML and CSS, and powered by ASP.NET. My first problem, which I'm near to solving, was that ASP.NET doesn't produce valid XHTML output. We don't want to spend money on third-party components, and we can't wait for ASP.NET 2.0, so we needed to find a
20
2587
by: Alan Silver | last post by:
Hello, I have read about the problems that IE has when using a doctype of HTML 4.01 Transitional. I was advised to use Strict wherever possible. My question is, does the same apply to XHTML 1.0 Transitional? I develop sites using ASP.NET, which emits valid XHTML 1.0 Transitional, but not XHTML 1.0 Strict (for example, it includes a hidden form field with the name of _VIEWSTATE, which isn't valid in Strict, but is in Transitional).
6
7870
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
2
4576
by: Radu | last post by:
Hi. I have been working at home on a web project (VSNET 2005 SP1). Now I have brought the project at work, and I suddenly have plenty of warnings like: Validation (XHTML 1.0 Transitional) - Attribute..... is not a valid attribute of..... Validation (XHTML 1.0 Transitional) - Attribute..... is considered outdated. A newer construct is recommended. Validation (XHTML 1.0 Transitional) - Attribute values must be enclosed in quotation marks.
14
3053
by: tader | last post by:
so i got script like that <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Drag and Drop</title> <style> #slater { display:block;
0
9600
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,...
0
10631
Oralloy
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...
1
10374
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,...
0
10114
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6880
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5548
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...
0
5686
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3859
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
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...

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.