[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: How to embed HTMl tags within an XML file

Subject: RE: How to embed HTMl tags within an XML file
From: "Evan Lenz" <elenz@xxxxxxxxxxx>
Date: Thu, 28 Sep 2000 14:50:12 -0700
html tags within xml
A standard way to do this would be to designate special non-HTML elements in
a namespace.  Or, if you find that HTML elements are the exception rather
than the rule, you may wish to use the HTML namespace for them.  Either way,
if you put them in different namespaces, your stylesheet will be able to
always copy HTML elements, and do special things with the rest.

<html xmlns:special="http://foo.bar.com">

<xsl:stylesheet version="1.0"

  <!-- Recursively copy all elements and attributes and their
children... -->
  <xsl:template match="*|@*">
      <xsl:apply-templates select="*|@*|text()"

  <!-- ...except for elements in this namespace, which will require special
processing -->
  <xsl:template match="foo:*">
    <!-- Do special stuff for elements in this namespace -->


Note that I used two different prefixes in the source and stylesheet
documents for the same namespace.  This is just to drill down the point that
it matters not what prefix is used or whether one is used at all (could be a
default namespace).  The stylesheet processor cares only about what
namespace an element or attribute is in, identified by the namespace URI,
not a prefix.  If the namespace URI is null, it's the same as saying the
element is "not in a namespace".

Hope this helps!  Feel free to ask any more specific questions if you need

Evan Lenz
XYZFind, the search engine *designed* for XML
Download our free beta software: http://www.xyzfind.com/beta

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxx]On Behalf Of pmitra
Sent: Thursday, September 28, 2000 12:30 PM
To: XSL-List@xxxxxxxxxxxxxxxx
Subject: How to embed HTMl tags within an XML file

I was wondering if anyone has any ideas on how to include tags like <LI>
or <P> or any other HTML tags in an XML file such that it will all be
extracted with the tags by the XSL and the generated HTML will format
the document using those tags.
I do not want to define particular tags in a DTD, I want to pass through
any generic HTMl tag, that any XML author may feel they want to put in:

For example,

<UL>Items header
<LI>This is the first item
<LI>This is the second item

How can I pass the whole above section as is through an XSL such that
HTMl can format this as a list?

Mila Mitra

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread


Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
First Name
Last Name
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.