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

Feature Request: equivalent to DSSSL read-entity function

Subject: Feature Request: equivalent to DSSSL read-entity function
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 16 Jan 1999 00:12:40 -0500
xsl read
In my training materials I would like to inject the text string equivalent
of the contents of an external file.  By "text string equivalent", I expect
the read function to translate characters matching the built-in entities
into entity references.

In DSSSL, this was done with "(read-entity filename)", so I've used that in
my post-process to implement my own version of <xsl:read-entity
system-id="filename"> for the time being.

Example:

Consider a file "ken.txt" with the content:

    This is a test file
    It has <example> markup therein.

Consider the markup:  <ext-file href="ken.txt">

In my stylesheet, I already have the following (where the "p" namespace is
interpreted by my DSSSL-based back-end):

<xsl:template match="ext-file">             <!--obtaining from outside-->
  <p:read-entity system-id="{@href}"/>
</xsl:template>

I suppose the XSL equivalent could be just changing the prefix:

<xsl:template match="ext-file">             <!--obtaining from outside-->
  <xsl:read-entity system-id="{@href}"/>
</xsl:template>

This processing on the markup above would show up in the result tree
indistinguishable from:

<xsl:text>This is a test file
It has &lt;example&gt; markup therein.</xsl:text>

.... but it means that my training materials are created from my working
example and exercise files (not retyped with possible errors or maintenance
headaches) ... so I perceive a real need here.

Because of the filtering of sensitive characters, there is no risk of
creating invalid XML in the output stream, so I think it is innocuous (and
powerful) to add this to XSL.

Thanks!

............ Ken

--
G. Ken Holman         mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.  http://www.CraneSoftwrights.com/s/
Box 266,                                V: +1(613)489-0999
Kars, Ontario CANADA K0A-2E0            F: +1(613)489-0995
Training:   http://www.CraneSoftwrights.com/s/schedule.htm
Resources: http://www.CraneSoftwrights.com/s/resources.htm
Shareware: http://www.CraneSoftwrights.com/s/shareware.htm
Next XSL Training (see training link):   WWW8 - 1999-05-11


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
Email
First Name
Last Name
Company
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.