473,326 Members | 2,111 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,326 software developers and data experts.

Extend xhtml1.0 with custom elements

Hello, I'm newbe to xml/dtd (and probably I don't use all the termins
correctly). I'm writing an application that parses xhtml file with
custom elements and splits it into 2 parts - valid xhtml1.0 and a
script file.
basicly I have this:
....
<MYML:form action="">
<MYML:input type="text"> ... ...
</MYML:form>
....
then my parser searches for MYML:form transforms it to xhtml1:
<form action="">
<input type="text"> ... ...
</form>
and produces script that handles submition of this form.

I'm using xerces validating parser (is it a good choice?) and I want to
write a module to extend xhtml_1.0 dtd to include my custom element. I
read w3.ord TRs (Modularization of XHTML, w3schools tutorials and
others) but I still have some trouble.
My goal is to make sure that MYML dtd is superset of xhtml_1.0 - any
valid xhtml1 is also valid MYML document (when I followed examples on
the w3.org site I always have some troble - somtimes valid xhtml docs
don't validate against MYML dtd. For instance, I have problems with
<script ...> tag - it doesn't seem to be recognized anymore). The
second thing is that I want to make sure that my new MYML:form element
may appear only where XHTML:form element may appear and (if that's
possible) MYML:form could include HTML:input or MYML:input and so on
for other form elements (when a form element is used with MYML prefix
then there will be some extra code generated for this element). MYML
form elements (such as MYML:input) should have all the attributes from
the usual input element plus some extra MYML.attribs
It should be modular - I want to be able to make custom dtd's for all
xhtml1.0 dtd's (strict, transitional, frameset). From the beginning I
downloaded xhtml1-strict.dtd and tried to edit it to add the extra
attributes, then I would have to repeat the same task with other dtd's.
I gave up this aproach when I googled to Modularization of XHTML, which
seem to be a better solution.
If someone on this group knows something about
dtd/extending/modularization, please help me with this task (by an
advice, or a link to a good source on this subject)

Thank you

Sep 7 '05 #1
3 2842


__PPS__ wrote:

<MYML:form action="">
<MYML:input type="text"> ... ...
</MYML:form>
One thing is for sure, writing DTDs for XML with namespaces is a tedious
thing, if I had the choice I would opt to use XSD schemas instead of
DTDs. That assumes that MYML:form is supposed to be a qualified name and
you want to have those elements in your own namespace.

If someone on this group knows something about
dtd/extending/modularization, please help me with this task (by an
advice, or a link to a good source on this subject)


The XHTML 1.0 DTDs are not easy to use for modularization, as you have
already found the W3C later, after XHTML 1.0 has laid the foundation for
modularization with
<http://www.w3.org/TR/xhtml-modularization>
so take that as a start and then look at
<http://www.w3.org/TR/xhtml11>
which makes use of that.
XHTML Basic <http://www.w3.org/TR/xhtml-basic> is also an example.

But in the end you want more than using the defined modules, you want to
have your own module and mix that, an example of that is MathML as a DTD
module:
<http://www.w3.org/TR/MathML2/appendixa.html#parsing.module>
There is also a working draft mixing XHTML, MathML and SVG:
<http://www.w3.org/TR/XHTMLplusMathMLplusSVG>

There is also this tutorial:
<http://www.w3.org/MarkUp/Guide/xhtml-m12n-tutorial/>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Sep 7 '05 #2
Martin Honnen wrote:
One thing is for sure, writing DTDs for XML with namespaces is a tedious
thing, if I had the choice I would opt to use XSD schemas instead of
DTDs. That assumes that MYML:form is supposed to be a qualified name and
you want to have those elements in your own namespace.
Yes, I need my own namespace, however, it doesn't seem to be difficult
to implement with dtd. I chose dtd over xsd because xhtml1.0 is defined
by dtd
The XHTML 1.0 DTDs are not easy to use for modularization, as you have
already found the W3C later, after XHTML 1.0 has laid the foundation for
modularization with
<http://www.w3.org/TR/xhtml-modularization>
so take that as a start and then look at
<http://www.w3.org/TR/xhtml11>
which makes use of that.
XHTML Basic <http://www.w3.org/TR/xhtml-basic> is also an example.


I looked these docs, thanks. But the problem is that my resultin
document should be xhtml 1.0 (after transformation) but xhtml11 is more
strict. That means that some xhtml1.0 valid docs will not be valid for
my new MyML dtd (as it's going to be xhtml11 base). Am I right about
that?
One other thing - I read alot of tutorials - all of them describe how
to define <!ELEMENT ...> <!ATTRLIST ...> or whatever, but I never saw
anything about conditions as I saw inside some of the dtd's:
<![%MyML.prefixed;[
<!ENTITY % MyML.pfx "%MyML.prefix;:" >
]]>
<!ENTITY % MyML.pfx "" >

Where I could read about complete syntax for dtd (all those <!ENTETY
with '%' sign, vs <!ENTETY without '%' sign) etc... I still don't
understand a lot from the standard dtd's

thanks

Sep 7 '05 #3
ok, I found where syntax for dtd's s defined - xml specs define it.

Sep 7 '05 #4

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

Similar topics

5
by: Bill M. | last post by:
Hello, I would like to extend or sub-class the base HTMLSelectElement and add some custom properties and methods. So far this works to create a new select element. var new_select= new...
2
by: Marek Mänd | last post by:
I have simple structure like: <div> <h3 style="text-align:center;"> <span style="float:right;">input type="image"/></span> <span style="float:left;">input type="image"/></span> boxes titlebar...
4
by: Rudy | last post by:
Hello all, I'm sure there is, just can't figure it out. I have the RGB code and the color number. But the color doesn't exsist in Visual studio.net. Can I add this color to the system pallet it...
10
by: mike | last post by:
regards: Where to find tag mapping-table of HTML translated to XHTML1.0 Any positive suggestion is welcome. thank you May goodness be with you all
6
by: jk | last post by:
Looking through WebUIValidation.js, I discovered that the standard validators don't cater for non-numeric date formats (e.g. dd-MMM-yyyy) which I would like to do To keep code to a minimum, I...
3
by: eXt | last post by:
For a realtime-application (half an application at least, kind of a framework) I am working with I need a event managing system and naturally it must be fast. I have defined a set of available...
2
by: Rob Meade | last post by:
Hi all, I've just started putting my pages together in .net 2.0 moving from 1.1 - using Visual Studio 2005 - most things have gone smoothly enough - however I am experiencing a little odd...
3
by: Rudi Hausmann | last post by:
Hi! I create HTML pages on the server side. I want to extend DIV elements with more information. E.g.: <DIV id="Joe" /> Now I want Joe to have an age for example and access it using:
0
by: mk189 | last post by:
Hi, I am trying to create XML schema of custom markup language, enriched by XHTML. In simplified version, the XML documet could look like that: <a:alarm-manual xmlns:a="alarm-manual"...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.