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

RE: efficient filtering of XML files. ( XML!=content && XSL

Subject: RE: efficient filtering of XML files. ( XML!=content && XSLT!=pr esentation )?
From: "Dave Pawson" <dave.pawson@xxxxxxxxxx>
Date: Sun, 9 Apr 2000 14:23:14 +0100
xsl encode
Just trying this idea out, below is an example of seperating
content from presentation.

the xml file contains pure content.
The hdrs.xml file contains the 'labels' for the content
(could be selected based on language)
The xsl file presents the content, pre-pending each required
one with any necessary labelling.

Just for fun :-) good idea Mike B/Dan M

What would make it slightly more terse (and more flexible) would be
to have a named template do the call, calculating the
path to root, which is then inverted by another named template
which is used to access the hdrs.xml file with a 'stupid'
string as default in case you've forgotten to include it.
Now that would be neat ;-)



main xml file
<?xml version="1.0" ?>
<file-list>
  <absolute>file://\f:\sgml\files\file1.xml</absolute>
  <absolute>file://\f:\sgml\files\file2.xml</absolute>
</file-list>

file hdrs.xml

<?xml version="1.0" ?>
<file-list>
   <absolute>File name is: </absolute>
  </file-list>


xsl file

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        version="1.0">
<xsl:output method="xml" encoding="utf-8" indent="yes"/>
<xsl:template match="file-list">
  <BODY>
    <xsl:value-of
select="document('../files/hdrs.xml',.)/file-list/absolute"/><xsl:value-of
select="absolute"/>
  </BODY>
</xsl:template>
</xsl:stylesheet>

output

<?xml version="1.0" encoding="utf-8"?>
<BODY>File name is:file://\f:\sgml\files\file1.xml</BODY>


so long as the hdrs file has enough structure to
reflect sufficient seperation, it is simple enough
to isolate appropriate headers.
Now all my fixed text can go into a seperate header
file which can be chosen by the stylesheet.


Nice idea IMHO

Regards DaveP


 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.