question on preserving embedded XHTML through XSLT of an XML document

C

chriscorbell

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
 
J

Joseph Kesselman

chriscorbell said:
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.
 
X

xmlator

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top