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

Re: Daisy chaining XSLT and also how can I check wheth

Subject: Re: Daisy chaining XSLT and also how can I check whether the XSLT processor supports a specific extension (specifically, ext:node-set)?
From: "ohaya ohaya@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 7 Aug 2024 19:32:59 -0000
Re:  Daisy chaining XSLT and also how can I check wheth
 Hi David (et al),
Wow, this is kind of scary :( !!
So I tested on xsltproc with the exlst: prefix and and it said the node-set
was available....
So then I tested on the product itself, and I modified the test code to use
"msxsl:" prefix and when i tested it said it was NOT available :( ....
So, then, I decided to test again, but with the "exslt:" prefix (even though
the product is running Windows), and.... IT SAID the node set is available!!!
Here's the actual code I used (on the product):
B B B  <xsl:message>Test for exslt:node-set() function</xsl:message>
B B B  <xsl:choose>
B B B B B B B  <xsl:when test="function-available('exslt:node-set') = ''">
B B B B B B B B B B B  <xsl:message>+++++++++ exslt:node-set NOT available
;)</xsl:message>
B B B B B B B B B B B  <node-set-NOT-AVAILABLE/>
B B B B B B B  </xsl:when>
B B B B B B B  <xsl:otherwise>
B B B B B B B B B B B  <xsl:message>+++++++++ exslt:node-set IS
available</xsl:message>
B B B B B B B B B B B  <node-set-IS-AVAILABLE/>
B B B B B B B  </xsl:otherwise>
B B B  </xsl:choose>
That basically injects a different nodename into the output XML, depending on
the available vs. not-available of the node-set function...
and here is what I saw when I tested on the product for the output XML:
B B B  <ExtraDetails xmlns:exslt="http://exslt.org/common"
xmlns:msxsl="urn:schemas-microsoft-com:xslt"><node-set-IS-AVAILABLE/>Command=
...=11497T;</ExtraDetails>


Ok, next I am going to test the code in the SO threads I linked....
Jim






    On Wednesday, August 7, 2024 at 02:06:09 PM EDT, David Carlisle
<d.p.carlisle@xxxxxxxxx> wrote:




On Wed, 7 Aug 2024 at 18:18, ohaya ohaya@xxxxxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

 David,
The way the product works, is there is a config parameter that point to the
XLST file to be used and then the output from the XSLT gets sent to the actual
target syslogd (over network), so no browser is involved....
I read through your page and it mentions:
function-available('exslt:node-set')
Can you suggest maybe a small XSLT that uses
"function-available('exslt:node-set')" that I could use to check if whatever
is doing the processing supports the node-set function?

you would use
<xsl:choose><xsl:when test="function-available('exslt:node-set')">B 
<xsl:apply-templatesB 
select="exslt:node-set($nodevar)"/></xsl:when><xsl:otherwise>B  .. whatever
you want to do if it isn't available</xsl:otherwise></xsl:choose>

The ancient trick I linked to allows you to avoid having this checkB 
everywhere you need the function as long as the system has some way of
defining a function.
But I haven't used xslt1 for decades.
David

Can you suggest maybe a small XSLT that uses
"function-available('exslt:node-set')" that I could use to check if whatever
is doing the processing supports the node-set function?

Then, I could try running that test XSLT under xsltproc on linux to test the
test and then after that also try to run the test on the product, to determine
whether or not the node-set function is available?

Per the links I included in my original post, I think I need to confirm that
node-set function is available to be able to try to use the code that was
suggested in the stack overflow threads...

Jim


    On Wednesday, August 7, 2024 at 12:13:52 PM EDT, David Carlisle
d.p.carlisle@xxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

 seems like only yesterday on this list I advertised
http://dpcarlisle.blogspot.com/2007/05/exslt-node-set-function.html
to make exslt:node-set work seamlessly on systems that supported it and
systems that had a similar function in a different namespace
David (a greyer version)



On Wed, 7 Aug 2024 at 16:48, Martin Honnen martin.honnen@xxxxxx
<xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:




 On 07/08/2024 17:36, ohaya ohaya@xxxxxxxxx wrote:



  From those threads above, it sounds like what I thinking of doing is
POSSIBLE, but one of the requirements is the availability of an extension:
  ext:node-set
  So I wanted to find out:
  a) How can I check that the XSLT processor supports that extension?B  Is
there like a small XSLT that I can test that would tell me whether or not the
XSLT processor that is running the XSLT supports that ext:node-set
extension?B B 





Use https://www.w3.org/TR/xslt-10/#function-function-available to check from
within XSLT if a certain function is available.

Most XSLT 1.0 processors support exsl:node-set in the namespace
http://exslt.org/common, with the exception of older Microsoft products like
MSXML or XslTransform which instead support a node-set extension function in a
Microsoft namespace.

Not sure about Xalan, I think the Java product has support for a Xalan
specific namespace as well as the EXSLT namespace.





 XSL-List info and archiveEasyUnsubscribe(by email)
XSL-List info and archiveEasyUnsubscribe(by email)  XSL-List info and
archiveEasyUnsubscribe(by email)

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.