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

RE: how to workaround restriction of overloading func

Subject: RE: how to workaround restriction of overloading functions
From: Robby Pelssers <Robby.Pelssers@xxxxxxx>
Date: Tue, 17 Jul 2012 18:24:55 +0200
RE:  how to workaround restriction of overloading  func
Oh...

Or should I create both a matcher template AND a function to resolve this?

<xsl:function name="znapz:getURI" as="xs:anyURI">
  <xsl:param name="element"/>
  <xsl:apply-templates select="$element" mode="getURI"/>
</xsl:function>

<xsl:template match="maximo:crontask" as="xs:anyURI" mode="getURI">
   ...
</xsl:template>

<xsl:template match="maximo:table" as="xs:anyURI" mode="getURI">
   ...
</xsl:template>

-----Original Message-----
From: Robby Pelssers [mailto:Robby.Pelssers@xxxxxxx]
Sent: Tuesday, July 17, 2012 6:13 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  how to workaround restriction of overloading functions

I thought I was almost there but I run into my next issue.  F [Saxon-PE
9.3.0.5] Cannot create an attribute node whose parent is a document node

Not sure how I can tackle this one.  Probably this was the reason why I chose
the function approach in the first place

        <xsl:result-document method="xml">
            <xsl:attribute name="href">
                <xsl:apply-templates select="." mode="getURI"/>
            </xsl:attribute>
            ....
        </xsl:result-document>


This would have worked
        <xsl:result-document method="xml" href="{znapz:getURI(.)}">
            ....
        </xsl:result-document>

Any thoughts?
Robby


-----Original Message-----
From: Robby Pelssers [mailto:Robby.Pelssers@xxxxxxx]
Sent: Tuesday, July 17, 2012 5:41 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  how to workaround restriction of overloading functions

;-)   simplicity rocks !!

Thx for the help again

Robby

-----Original Message-----
From: Andrew Welch [mailto:andrew.j.welch@xxxxxxxxx]
Sent: Tuesday, July 17, 2012 5:35 PM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  how to workaround restriction of overloading functions

On 17 July 2012 16:32, Robby Pelssers <Robby.Pelssers@xxxxxxx> wrote:
> Damn...
>
> I was already thinking along those lines but I wasn't sure if such approach
would work.
>
>
> So let's assume I needed an uber-function that would return a sequence of
URI's, would sth  like this work?
>
> I want a list of all URI's stored in a variable uniqueURIs.  Since I can't
use mode in a select statement like
> <xsl:variable name="uniqueURIs" select="/maximo:*" mode="getURI"/>
>
> I will probably need to call a function?
> <xsl:variable name="uniqueURIs" select="znapz:getUniqueURIs(/maximo:*)"/>

or just apply-templates in the variable:

<xsl:variable name="uniqueURIs" as="xs:anyURI+">
  <xsl:apply-templates select="/maximo:*" mode="getURI"/>
</



--
Andrew Welch
http://andrewjwelch.com

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.