xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] html tags in xml elements


Subject: RE: [xsl] html tags in xml elements
From: Steve Perriman <sperriman@xxxxxxxxxxxx>
Date: Thu, 7 Mar 2002 11:41:56 -0000

Hi Alice,

Just noticed this, I don't think there were any replies so here goes.

>Sorry if this is not the right forum. I'm new to xsl/xml,
>and I'd like to have an element in my DTD that allows for
>html tags in it like:
>
><Status>
>	<Code>3030</Code>
>	<Description>This is an <b>error</b> </Description>
></Status>
>
>If I don't use xhtml, do I have to subset the set of html tags
>and redefine them in my DTD?

It depends what you are trying to do!  If your goal is to output HTML from
your source XML file, the answer is no, you don't need to define HTML tags
in your DTD.  It's more likely that you would put your HTML in the XSL
stylesheet, and as long as it is well-formed, the XSL processor will take
care of it.

As I understand it, one goal of XML is to separate presentation from data,
so it is probably not a good a idea trying to include tags like <b> in your
source file.  However, you do need some way of tagging the bits you want to
appear in bold.  This again will depend on why you want certain text in
bold, etc.  Your source XML might then look like this:

<Status>
	<Code>3030</Code>
	<Description>This is an <emphasis>error</emphasis> </Description>
</Status>

In the stylesheet, you would then need a template to convert this to
whatever formatting style you wanted, e.g., something like:

<xsl:template  ...>
<b>
<xsl:value-of select="emphasis" />
</b>
</xsl:template>

Using CSS, you could format it anyway you wanted:

<xsl:template  ...>
<span class="emphasis">
<xsl:value-of select="emphasis" />
</span>
</xsl:template>

Hope this helps.

Steve Perriman
Intranet/Internet Support Technician
South Trafford College




----------------------------------------------------------------------------
---------
This message is sent in confidence for the addressee only. It may
contain confidential or sensitive information. The contents are not to
be disclosed to anyone other than the addressee. Unauthorised
recipients are requested to preserve this confidentiality and to advise us
of any errors in transmission. Thank you
----------------------------------------------------------------------------
---------

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



Current Thread
Keywords
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor