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

Re: Split files with XSLT2.0 xsl:result-document

Subject: Re: Split files with XSLT2.0 xsl:result-document
From: Colin Paul Adams <colin@xxxxxxxxxxxxxxxxxx>
Date: 06 Dec 2004 14:59:23 +0000
xsl split file
>>>>> "Robert" == Robert Soesemann <rsoesemann@xxxxxxxxxxx> writes:


    Robert> E.g. the input file:

    Robert> \in_dir \foo \bar.xml

    Robert> Needs to be splitted to

    Robert> \out_dir \foo \bar1.xml <-- number unnamed fragments
    Robert> \bar2.xml <-- number unnamed fragments \bar#xyz.xml <--

that's not quite right                                 ^
the fragment needs to come after the .xml.

    Robert> use /anchor/@name for name extension
    Robert> Can anybody help me to solve this? Thanks in advance!

You are right that you can do this with xsl:result-document, as the
href attribute can be an attribute-valued template.

But it's not straight-forward, since the name-relationship you want
between the input documents and the output documents is not a relative
URI.

I think you might want to write an xsl:function to help determine the
output name. Then you can use that function within the href="{expression}".

You can use the base-uri function to get the input file URI. 
you can use insert-before to insert the number.
Then if there is an anchor present, use concat to add the fragment-id
-- 
Colin Paul Adams
Preston Lancashire

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.