|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Feature Request: equivalent to DSSSL read-entity function
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 <example> 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








