entity expansion in stylesheets

Subject: entity expansion in stylesheets
From: "Ben Jung" <benjamin.jung@xxxxxxxxx>
Date: Tue, 9 May 2000 16:44:43 +0100
Hi!

Using stylesheet transformations, I have difficulties to extracting an
entity expansion from an XML document. I declared the entity (in the XML as
well as the XSL document) and the attribute type as 'entity' (in the XML
document).
I tried MSIE5 as well as xt. but couldn't get any reasonable result. I hope
you can help me here.

For more clarification, let's assume the following two files (XML and XSL):
------------------------------------------------------------
<?xml version='1.0'?>

<!DOCTYPE person [
  <!ENTITY m "male">
  <!ENTITY f "female">

  <!ELEMENT person (name, age)>
  <!ATTLIST person sex ENTITY #REQUIRED>

  <!ELEMENT name (#PCDATA)>

  <!ELEMENT age (#PCDATA)>
]>

<person sex='m'>
  <name>Michael</name>
  <age>44</age>
</person>
------------------------------------------------------------
<?xml version='1.0'?>

<!DOCTYPE stylesheet [
  <!ENTITY m "male">
  <!ENTITY f "female">
]>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>

<xsl:template match='//person'>
  <xsl:value-of select='@sex'/>
</xsl:template>

</xsl:stylesheet>
------------------------------------------------------------

The expected output is 'male' (the expanded entity), but unfortunatly, I
always get 'm' (the entity's name). Any suggestions/comments what I am doing
wrong here?

Thanks for your time, Ben



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


Current Thread