XHTML in XML

Discussion in 'XML' started by Biblin, Sep 7, 2004.

  1. Biblin

    Biblin Guest

    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.
     
    Biblin, Sep 7, 2004
    #1
    1. Advertising

  2. 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/
     
    Martin Honnen, Sep 7, 2004
    #2
    1. Advertising

  3. Biblin

    Biblin Guest

    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" <> wrote in message
    news:413d8cf9$0$422$-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/
     
    Biblin, Sep 7, 2004
    #3
  4. Martin Honnen, Sep 7, 2004
    #4
  5. In article <413d8cf9$0$422$-online.net>,
    Martin Honnen <> 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
     
    Patrick TJ McPhee, Sep 8, 2004
    #5
  6. Biblin

    Greg Guest

    Patrick TJ McPhee wrote:
    > In article <413d8cf9$0$422$-online.net>,
    > Martin Honnen <> 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
    >



    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
     
    Greg, Dec 12, 2004
    #6
  7. http://www.w3.org/TR/xhtml1-schema/#schemas

    "Greg" <> wrote in message
    news:...
    Patrick TJ McPhee wrote:
    > In article <413d8cf9$0$422$-online.net>,
    > Martin Honnen <> 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
    >



    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
     
    Wole Ogunremi, Dec 12, 2004
    #7
  8. 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
     
    David Dorward, Dec 12, 2004
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    902
  2. chronos3d
    Replies:
    9
    Views:
    786
    Andy Dingley
    Dec 5, 2006
  3. Usha2009
    Replies:
    0
    Views:
    1,140
    Usha2009
    Dec 20, 2009
  4. xhtml champs
    Replies:
    0
    Views:
    537
    xhtml champs
    Aug 1, 2011
  5. xhtml champs
    Replies:
    0
    Views:
    1,046
    xhtml champs
    Aug 2, 2011
Loading...

Share This Page