473,804 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Could not find function: empty

Hello,

I'm using xalan 2.6, and trying to invoke a transformation using XSL
file that contains the function "empty", but I'm getting the below
exception, I think the empty function is a valid XPath function, and
XML Spy can translate docuements using this XSL file without any
problems.

Is it a bug in xalan? I tried 2.7 but I got the same exception.

Any idea what's happening?
javax.xml.trans form.Transforme rException: Could not find function:
empty
at org.apache.xpat h.compiler.XPat hParser.error(X PathParser.java :602)
at
org.apache.xpat h.compiler.XPat hParser.Functio nCall(XPathPars er.java:
1449)
at org.apache.xpat h.compiler.XPat hParser.Primary Expr(XPathParse r.java:
1388)
at org.apache.xpat h.compiler.XPat hParser.FilterE xpr(XPathParser .java:
1287)
at org.apache.xpat h.compiler.XPat hParser.PathExp r(XPathParser.j ava:
1220)
at org.apache.xpat h.compiler.XPat hParser.UnionEx pr(XPathParser. java:
1178)
at org.apache.xpat h.compiler.XPat hParser.UnaryEx pr(XPathParser. java:
1084)
at
org.apache.xpat h.compiler.XPat hParser.Multipl icativeExpr(XPa thParser.java:
1005)
at
org.apache.xpat h.compiler.XPat hParser.Additiv eExpr(XPathPars er.java:
947)
at
org.apache.xpat h.compiler.XPat hParser.Relatio nalExpr(XPathPa rser.java:
872)

Jul 5 '07 #1
5 3696
Abdelhalim wrote:
Hello,

I'm using xalan 2.6, and trying to invoke a transformation using XSL
file that contains the function "empty",
empty() is an XPath2 function, and xalan implements XSLT 1 and XPath 1.

David

--
http://dpcarlisle.blogspot.com
Jul 5 '07 #2
Abdelhalim,

For someone to be able to answer your question you should prune your
stylesheet down as much as possible to isolate the problem. Then you
should post the XSL code to the newsgroup so that people can examine the
problem. You should be able to get the XSL code down to under 20 lines;
anything more and people will be less inclined to offer comments.

Cheers
Justin Johansson

Abdelhalim wrote:
Hello,

I'm using xalan 2.6, and trying to invoke a transformation using XSL
file that contains the function "empty", but I'm getting the below
exception, I think the empty function is a valid XPath function, and
XML Spy can translate docuements using this XSL file without any
problems.

Is it a bug in xalan? I tried 2.7 but I got the same exception.

Any idea what's happening?
javax.xml.trans form.Transforme rException: Could not find function:
empty
at org.apache.xpat h.compiler.XPat hParser.error(X PathParser.java :602)
at
org.apache.xpat h.compiler.XPat hParser.Functio nCall(XPathPars er.java:
1449)
at org.apache.xpat h.compiler.XPat hParser.Primary Expr(XPathParse r.java:
1388)
at org.apache.xpat h.compiler.XPat hParser.FilterE xpr(XPathParser .java:
1287)
at org.apache.xpat h.compiler.XPat hParser.PathExp r(XPathParser.j ava:
1220)
at org.apache.xpat h.compiler.XPat hParser.UnionEx pr(XPathParser. java:
1178)
at org.apache.xpat h.compiler.XPat hParser.UnaryEx pr(XPathParser. java:
1084)
at
org.apache.xpat h.compiler.XPat hParser.Multipl icativeExpr(XPa thParser.java:
1005)
at
org.apache.xpat h.compiler.XPat hParser.Additiv eExpr(XPathPars er.java:
947)
at
org.apache.xpat h.compiler.XPat hParser.Relatio nalExpr(XPathPa rser.java:
872)
Jul 5 '07 #3
David Carlisle wrote:
empty() is an XPath2 function, and xalan implements XSLT 1 and XPath 1.
However, depending on what you're doing, there are XPath 1 idioms which
will return equivalent values. For example, to get an empty nodeset you
could ask for the parent of the root node, the children of an attribute,
or similar known-empty paths.
--
Joe Kesselman / Beware the fury of a patient man. -- John Dryden
Jul 6 '07 #4
Joseph Kesselman wrote:
David Carlisle wrote:
>empty() is an XPath2 function, and xalan implements XSLT 1 and XPath 1.

However, depending on what you're doing, there are XPath 1 idioms which
will return equivalent values. For example, to get an empty nodeset you
could ask for the parent of the root node, the children of an attribute,
or similar known-empty paths.
According to <http://www.w3.org/TR/xquery-operators/#func-emptythe
function returns true if the sequence is empty and false otherwise so
with XPath 1.0 you could use
count($arg) = 0
to check whether arg is empty.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 6 '07 #5
Martin Honnen wrote:
According to <http://www.w3.org/TR/xquery-operators/#func-emptythe
function returns true if the sequence is empty and false otherwise so
with XPath 1.0 you could use
count($arg) = 0
to check whether arg is empty.
or simpler (and possibly more efficient) just $arg (s in a boolean
context a node set coerces to true just if it's non empty.

David

--
http://dpcarlisle.blogspot.com
Jul 6 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2151
by: Jaime Wyant | last post by:
Will someone explain this to me? >>> "test".find("") 0 Why is the empty string found at position 0? Thanks! jw
4
3855
by: Greg Baker | last post by:
I don't know what standard protocol is in this newsgroup. Am I allowed to post code and ask for help? I hope so.. :) Here's my problem: I am trying problem 127 of the valladolid online contests (http://online-judge.uva.es/p/v1/127.html). The program I wrote seems to work fine, but it takes way too much memory to run. I am not that good at programming C++, unfortunately, so I can't seem to find my memory leak. As far as I can tell,...
22
3855
by: mail.zhf | last post by:
if have two char use equality, out first. example: char str = "gbdfssdffss"; out is: f.
9
13775
by: Clinton Frankland | last post by:
Hi, On a Windows 2000 Server when attempting to use System.IO.Directory.CreateDirectory(string.concat(Server.MapPath(""), "\verify")) I receive a System.IO.DirectoryNotFoundException error: Could not find a part of the path "D:\". The full path is "D:\hshome\clinton\test.gotchasoft.com\verify" The web is running using impersonation as a user on the local machine.
4
2477
by: Matt Kruse | last post by:
According to standards, if an option is selected and it has no VALUE attribute, the contents of the option tag is to be submitted. So: <select name="sel"> <option selected>Value</option> </select> will submit as "sel=Value".
3
10676
by: Himmel | last post by:
I have added a section of code to a function that is designed to copy data from several tables and place them into a single table. The new table already contains a unique ID and name, and I am working on adding data from the second table to it. The problem is that the second table has multiple records for each ID. For example, review this sample data: New Table: ID NAME OBJ1 1 Billy 2 Bobby 3 Sue
2
4534
by: ilany | last post by:
Hi to all... Would greatly appreciate any suggestions. I'm trying to evaluate an expression during run-time that looks something like this: Eval("RecordAdd_Addresses(False,"John","","Doe","New York","NY","11216","US","12345678","","",Empty,Empty,Empty)") I get this error:
9
4564
by: WebArchitect | last post by:
I have a text file. My text file contains lines with double quotes around it. I trying to code if a line has double quotes around it Then make it bold My code is below and it is not working. Please Help <? $filename = "whatsnew.txt"; # file to read if (file_exists($filename)) {
1
6474
by: Beamor | last post by:
function art_menu_xml_parcer($content, $showSubMenus) { $doc = new DOMDocument(); $doc->loadXML($content);//this is the line in question $parent = $doc->documentElement; $elements = $parent->childNodes; need help. my site worked fine on my localhost but when i uploaded it to my live server i keep getting this error need help to recode line to match my hosting server. im using php 5 i have attached the common_method file
0
10600
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10352
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10354
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10097
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7642
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3835
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.