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

Re: Chunking xml into single-topic docs

Subject: Re: Chunking xml into single-topic docs
From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx>
Date: Thu, 24 Feb 2005 12:42:08 -0500
chunking xml

The trouble you are having is resulting from this bit of code:

At 12:01 PM 2/24/2005, you wrote:
                <xsl:variable name="title">
                  <xsl:when test="contains($file_title,'_')">
             <xsl:value-of select="escape-uri($file_title,true())"/>

                <xsl:variable name="title2">
                  <xsl:when test="contains($title,' ')">

                <xsl:value-of select="substring-before($title,' ')"/>
                  <xsl:when test="contains($title,'/')">

                <xsl:value-of select="substring-before($title,'/')"/>
                    <xsl:value-of select="$title"/>

This is what implements the logic you have described. Since the declaration of $file_title has already converted new-lines into '_', these variable declarations serve basically to trim the name further, ultimately taking whatever string is available up to '_' or ' ' as a code to use for the filename.

The logic is implemented well enough, but of course it's faulty given the requirement, for the reason you outline: files stepping on each other because names are not unique. So you need some other way of generating a unique code for each file.

This is a very open-ended requirement, and only you decide what kind of code would serve. Any ideas? If you were to ask the list what we have done in analogous situations, I'm sure there would be many answers. In particular, the questions come up of whether you need the file names to be transparent, and how long you are willing to let them get. (It's not hard to make them unique and either short or transparent, but generally harder to do all of these together.) Note that until a functional specification is clear, this isn't really an XSLT question. :->

I hope this helps,

"Thus I make my own use of the telegraph, without consulting
the directors, like the sparrows, which I perceive use it
extensively for a perch." -- Thoreau

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.