Tunneling own XML content in XHMTL etc.

Discussion in 'XML' started by Florian Weimer, Jan 24, 2011.

  1. Is it posssible to embed one's own elements within an XHMTL document,
    in such a way that the XHTML part and the foreign structure can be
    validated separately?

    I would like to have something like this:

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Title</title>
    </head>
    <body>
    <div xmlns:fw="http://www.enyo.de/xml/html-gen">
    <fw:xlist name="foo"/>
    </div>
    </body>
    </html>

    Unfortunately, this doesn't work. And I can't find a suitable
    loophole in the XHTML schema.

    Eventually, I want to run a generator over the combined document and
    lower it to XHTML, expanding things like table of contents,
    references, etc.

    It doesn't have to be XHTML per se, Docbook would probably work, too.

    Would XHTML Modularization help with such a task?
     
    Florian Weimer, Jan 24, 2011
    #1
    1. Advertising

  2. On 1/24/2011 1:42 PM, Florian Weimer wrote:
    > Is it posssible to embed one's own elements within an XHMTL document,
    > in such a way that the XHTML part and the foreign structure can be
    > validated separately?
    >
    > Would XHTML Modularization help with such a task?


    That's very much what the modularization was intended to do.

    "Modularization also allows for the extension of XHTML's layout and
    presentation capabilities, using the extensibility of XML, without
    breaking the XHTML standard. This development path provides a stable,
    useful, and implementable framework for content developers and
    publishers to manage the rapid pace of technological change on the Web."

    http://www.w3.org/TR/xhtml-modularization

    --
    Joe Kesselman,
    http://www.love-song-productions.com/people/keshlam/index.html

    {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
    /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
     
    Joe Kesselman, Jan 24, 2011
    #2
    1. Advertising

  3. In case it isn't obvious, note the use of XML Namespaces in Bill's
    example to distinguish the base XHTML tags from the added tags.


    --
    Joe Kesselman,
    http://www.love-song-productions.com/people/keshlam/index.html

    {} ASCII Ribbon Campaign | "may'ron DaroQbe'chugh vaj bIrIQbej" --
    /\ Stamp out HTML mail! | "Put down the squeezebox & nobody gets hurt."
     
    Joe Kesselman, Jan 25, 2011
    #3
  4. * William F. Hammond:

    >> Unfortunately, this doesn't work. And I can't find a suitable
    >> loophole in the XHTML schema.

    >
    > What do you mean by "doesn't work"?


    It doesn't validate.

    > <style type="text/css">
    > xlist:before {
    > content: "This is foo"
    > }
    > </style>


    > <div xmlns="http://www.enyo.de/xml/html-gen">
    > <xlist name="foo"/>
    > </div>


    I'm surprised that CSS isn't really namespace-aware (in the Firefox
    implementation at least).
     
    Florian Weimer, Jan 25, 2011
    #4
  5. El 25/01/2011 7:43, Florian Weimer escribió:
    > * William F. Hammond:
    >
    >>> Unfortunately, this doesn't work. And I can't find a suitable
    >>> loophole in the XHTML schema.

    >>
    >> What do you mean by "doesn't work"?

    >
    > It doesn't validate.
    >
    >> <style type="text/css">
    >> xlist:before {
    >> content: "This is foo"
    >> }
    >> </style>

    >
    >> <div xmlns="http://www.enyo.de/xml/html-gen">
    >> <xlist name="foo"/>
    >> </div>

    >
    > I'm surprised that CSS isn't really namespace-aware (in the Firefox
    > implementation at least).


    But it is! Only you have to serve the page as XHTML instead of HTML, and
    declare the namespace in the CSS:

    --------------
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>Title</title>
    <style type="text/css">
    @namespace gen "http://www.enyo.de/xml/html-gen";
    gen|xlist:before {
    content: "This is foo"
    }
    </style>
    </head>
    <body>
    <div xmlns="http://www.enyo.de/xml/html-gen">
    <xlist name="foo"/>
    </div>
    </body>
    </html>
    --------------

    Just save it as xxx.xhtml and open it in FireFox.

    --
    Manuel Collado - http://lml.ls.fi.upm.es/~mcollado
     
    Manuel Collado, Jan 25, 2011
    #5
  6. * Joe Kesselman:

    > On 1/24/2011 1:42 PM, Florian Weimer wrote:
    >> Is it posssible to embed one's own elements within an XHMTL document,
    >> in such a way that the XHTML part and the foreign structure can be
    >> validated separately?
    >>
    >> Would XHTML Modularization help with such a task?

    >
    > That's very much what the modularization was intended to do.
    >
    > "Modularization also allows for the extension of XHTML's layout and
    > presentation capabilities, using the extensibility of XML, without
    > breaking the XHTML standard. This development path provides a stable,
    > useful, and implementable framework for content developers and
    > publishers to manage the rapid pace of technological change on the
    > Web."
    >
    > http://www.w3.org/TR/xhtml-modularization


    Okay, I will have a look at that.

    It seems that there is also a standard which attempts to streamline
    tasks like this---NVDL. Has anyone used it? What is tool support like
    (in Java and libxml2)?
     
    Florian Weimer, Feb 5, 2011
    #6
  7. * Manuel Collado:

    > Just save it as xxx.xhtml and open it in FireFox.


    It seems to require a version later than 3.5, though.
     
    Florian Weimer, Feb 5, 2011
    #7
    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. bigbinc

    http tunneling, and soap.

    bigbinc, Dec 8, 2003, in forum: Java
    Replies:
    0
    Views:
    407
    bigbinc
    Dec 8, 2003
  2. BT
    Replies:
    4
    Views:
    564
    Jan Faerber
    Feb 14, 2005
  3. Replies:
    3
    Views:
    559
    Steven Cheng[MSFT]
    Oct 9, 2006
  4. Kevin Walzer

    Re: PIL (etc etc etc) on OS X

    Kevin Walzer, Aug 1, 2008, in forum: Python
    Replies:
    4
    Views:
    411
    Fredrik Lundh
    Aug 13, 2008
  5. Matthias Braun

    XHMTL and CSS Problem

    Matthias Braun, Jan 31, 2010, in forum: HTML
    Replies:
    14
    Views:
    1,299
    Matthias Braun
    Feb 1, 2010
Loading...

Share This Page