question on preserving embedded XHTML through XSLT of an XML document

Discussion in 'XML' started by chriscorbell, Nov 27, 2006.

  1. chriscorbell

    chriscorbell Guest

    I have a specific but somewhat high-level question on how to approach a
    schema which embeds a subset of XHTML in some elements.

    I have a schema defined for a logical document structure. Sections of
    this document can contain presentation text; the schema allows a subset
    of XHTML for these sections. All of this works fine as far as XML
    schema validation etc.

    I have an XSL transformation defined to convert my xml document to
    XHTML. Here the containing and structuring XML elements are converted
    to document sections with a TOC, internal anchors, etc. In this case I
    want the "embedded" XHTML sections to be simply copied verbatim to the
    output, i.e. not explicitly parsed or transformed. I can't seem to
    succeed in doing this - is there a way? Or a preferable approach?

    TIA,
    Chris
     
    chriscorbell, Nov 27, 2006
    #1
    1. Advertising

  2. Re: question on preserving embedded XHTML through XSLT of an XMLdocument

    chriscorbell wrote:
    > want the "embedded" XHTML sections to be simply copied verbatim to the
    > output, i.e. not explicitly parsed or transformed.


    XSLT won't "copy verbatim" without parsing -- but you could certainly do
    an xsl:copy-of on the XHTML subtree to copy it through essentially
    unchanged, or just let those elements be handled by an identity template.

    It's hard to give a more explicit example without knowing exacty what
    your input looks like.

    --
    Joe Kesselman / Beware the fury of a patient man. -- John Dryden
     
    Joseph Kesselman, Nov 27, 2006
    #2
    1. Advertising

  3. chriscorbell

    Guest

    > I can't seem to succeed in doing this - is there a way?

    Can you construct a small example? It's hard to guess
    what it is exactly that's failing to do what you want.
    There's no a priori reason you can't copy your XHTML
    over *structurally* verbatim (parsed and re-emitted
    in a functionally identical form).

    > Or a preferable approach?


    Hard to guess the complexities of your exact situation
    and goals. In general, however, I would become
    anxious upon seeing XHTML presentation elements
    mixed in with more "pure" XML content. Have you
    considered a more complete separation of content
    and presentation, such as a completely separate
    XHTML "style" document, that contains placeholders
    where your XML->XHTML transformed pure content
    can be inserted?

    Ron Burk
    www.xmlator.com
     
    , Nov 27, 2006
    #3
    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. Sven Steinacker
    Replies:
    1
    Views:
    720
    Johannes Koch
    Oct 27, 2003
  2. Sven Steinacker
    Replies:
    0
    Views:
    680
    Sven Steinacker
    Oct 27, 2003
  3. Replies:
    4
    Views:
    691
  4. TTroy
    Replies:
    16
    Views:
    804
    Peter Nilsson
    Jan 31, 2005
  5. Replies:
    4
    Views:
    545
Loading...

Share This Page