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

RE: Resolving ENTITY attributes

Subject: RE: Resolving ENTITY attributes
From: Gabriel Paiz III <gpaiz@xxxxxxxxx>
Date: Mon, 3 May 1999 09:44:34 -0700

> >> Reading the XSLT spec, I don't see a way of resolving ENTITY-type
> >> attribute values.
> >...
> >> Is there a way to do this? 
> >

> <!DOCTYPE xmldoc ... [
> <!ENTITY img1 SYSTEM "image1.gif" NDATA gif>
> ...
> ]>
> <xmldoc>
> ...
> <xmlimg src="img1"/>
> ...
> </xmldoc>

If you're working with IE5, you can use something like below to save
system ids and match entities to them.  The Microsoft site warns about
using globals in stylesheets,


so it might not work in all situations. 1) Is there a way to test for
the type of a node in the new draft?  2) The test only works if the
template rule is first and doesn't have a match pattern. 

<!-- ******** default element templates ************ -->
	<xsl:if test=".[nodeType() = 6]">
<xsl:template match="textnode()"><xsl:value-of/></xsl:template>

<!-- ******** example rule *********  -->
<xsl:template match="sgmlimg">
  	<xsl:element name="img">
		<xsl:attribute name="src">


var sEntities = new Array();

function saveSystemId(oNode)
	var sName = oNode.nodeName;
	if (sName.length == 0)
	sEntities[sName] = oNode.systemId;

function lookupSystemId(oNode, sAttr)
	var oAttrMap = oNode.attributes;
  	if (oAttrMap == null)
   	var oAttrNode = oAttrMap.getNamedItem(sAttr);
   	if (oAttrNode == null)
   	var sName = oAttrNode.value;
// or, if you can assume the attribute will always exist
//	var sName = oNode.attributes.getNamedItem(sAttr).value;
	if (sName.length == 0)	

Gabriel Paiz III
SPX - Valley Forge T.I.S.
25691 Atlantic Ocean Drive Suite B-7
Lake Forest, CA 92630
USA    www.vftis.com

Tel:	(949) 460 0094
Fax:	(949) 460 0095
e-Mail:	gpaiz@xxxxxxxxx

 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.