Hi ED

thanks for your help, with your little example I was able to do exactly what I wanted to!

regards

Sascha

 

 


saxon-help@lists.sourceforge.net schrieb am 16.02.06 08:17:13:


Hi Sascha

An included module such as utilities.xsl may start like

<xsl:stylesheet
xmlns:utilities="http://www.me.org/utilities.xsl"
...
>

<xsl:function as="xs:string" name="utilities:get-variable-name">
...
</xsl:function>

and be included as

<xsl:stylesheet
xmlns:utilities="http://www.me.org/utilities.xsl"
...
exclude-re! sult-prefixes="utilities"
>

<xsl:include href="utilities.xsl"/>

and used as

<xsl:value-of select="utilities:get-variable-name(.)"/>

Depeneding on usage, the exclude-result-prefixes may be unnecessary.

Regards

Ed Willink


> -----Original Message-----
> From: saxon-help-admin@lists.sourceforge.net
> [mailto:saxon-help-admin@lists.sourceforge.net] On Behalf Of
> Sascha Punzmann
> Sent: 15 February 2006 20:50
> To: saxon-help@lists.sourceforge.net
> Subject: Re: [saxon] XSLT 2.0 using xsl:function within
> multiple stylesheets?
>
>
> Hi Ed,
>
> thanks for the answer, but I don't completely get it! Maybe
> you can give
> me a simple example!
>
> I have one *main* stylesheet, one included *sub* stylesheet and one
> *function* stylesheet that contains my custom functions.
>
> I want tha! t the function is available in *main* and *sub.
> *What exactly
> do I have to do to make this?
>
> 1. Distinct Namespace for *main* and *sub* (How exactly?)
> 2. What do you mean by disciplined inclusion tree?
>
> Sorry to ask so much but I really need to get it.
>
> Thaks in advance
>
> Sascha
>
>
> Ed Willink wrote:
> > Hi Sascha
> >
> > Yes namespaces is the solution.
> >
> > Give each include module a distinct namespace.
> >
> > However with includes you are including rather than referencing, so
> > you cannot have
> > a function library that can be referenced as many times as
> you like.
> > You must arrange
> > for your includes to form a disciplined inclusion tree so that
> > everything is defined exactly
> > once, even as your tree grows. So put all your utilities in
> a tree of
> > utility functions! that
> > gets included only by your main stylesheet.
> >
> > Regards
> >
> > Ed Willink
> >
> > -----Original Message-----
> > *From:* saxon-help-admin@lists.sourceforge.net
> > [mailto:saxon-help-admin@lists.sourceforge.net] *On Behalf Of
> > *Sascha Punzmann
> > *Sent:* 15 February 2006 15:53
> > *To:* saxon-help@lists.sourceforge.net
> > *Subject:* [saxon] XSLT 2.0 using xsl:function within multiple
> > stylesheets?
> >
> > Hi, maybe this is easy to solve, but I can't find a solution.
> >
> > I use the a main stylesheet, the includes several other
> > stylesheets (templates). The whole processing works!
> >
> > When I declare and use custom functions (<xsl:function) in the
> > main sheet, this function is only available in the main
> > stylesheet, but not in the! included templates!
> >
> > Does any of have an ide a how I can make those <xsl:functions>
> > available within all of my stylesheet, even the imported ones?
> >
> > I thought about including them through a namespace declaration,
> > but I don't know if and how this can be done!
> >
> > Regards
> >
> > Sascha
> >
> >
> > --
> > This email has been verified as Virus free
> > Virus Protection and more available at http://www.plus.net
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep
> through log files for problems? Stop! Download the new AJAX
> search engine that makes searching your log files as easy as
> surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&
dat=121642
_! ______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/saxon-help
--
This email has been verified as Virus free
Virus Protection and more available at http://www.plus.net



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
saxon-help mailing list
saxon-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/saxon-help