You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by Santiago Pericas-Geertsen <Sa...@sun.com> on 2003/10/24 00:44:44 UTC

RE: XSLTC - bug - 'Iterator for typed axis 'ancestor-or-self' not supported.'

On Thu, 2003-10-23 at 18:31, Robert Koberg wrote:
> It looks like any use of a namespace prefix and a wildcard is not supported.
> Is this a fact of life? It is painful, if so.

 This appears to be related to the lines that are commented out in
org.apache.xml.dtm.ref.DTMDefaultBaseIterators (lines 148-155). 

 Morris K.: Did you comment these lines out? Should we get back to the
issue you raise the comment?

-- Santiago



RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Morris Kwan <mk...@ca.ibm.com>.



[[
Morris: SAXImpl.getNamespaceAxisIterator(int, int) seems to be missing
a lot of cases in the switch. Robert's stylesheet hits one of them, but
there are others. Do you agree?
]]

I agree. I have never touched the code in this method. Please feel free to
add any missing code.

Regards,

Morris Kwan
XSLT Development
IBM Toronto Lab
Tel: (905)413-3729
Email: mkwan@ca.ibm.com


RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
On Fri, 2003-10-24 at 12:54, Santiago Pericas-Geertsen wrote:
> On Fri, 2003-10-24 at 12:33, Robert Koberg wrote:
> 
>  Yes, I can reproduce that as well. However, if you use
> org.apache.xalan.xslt.Process with the -XSLTC option it works. I'm still
> trying to understand why the difference.
> 

 Scratch that. After recompiling I was able to reproduce it in all
cases. 

 Morris: SAXImpl.getNamespaceAxisIterator(int, int) seems to be missing
a lot of cases in the switch. Robert's stylesheet hits one of them, but
there are others. Do you agree?

-- Santiago



RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
On Fri, 2003-10-24 at 12:33, Robert Koberg wrote:
> Just tried from the command line:
> 
> $ java org.apache.xalan.xsltc.cmdline.Compile ancestor-or-self.xsl
> 
> $ java org.apache.xalan.xsltc.cmdline.Transform ancestor-or-self.xml
> ancestor_or_self
> Translet errors:Iterator for typed axis 'ancestor-or-self' not supported.
> 

 Yes, I can reproduce that as well. However, if you use
org.apache.xalan.xslt.Process with the -XSLTC option it works. I'm still
trying to understand why the difference.

-- Santiago



precompiling Translets

Posted by Robert Koberg <ro...@koberg.com>.
Hi,

I have some questions about precompiling Translets.

- is their an Ant task floating around, by any chance?

- is there a way to set a URIResolver on the commandline one for the
TransformerFactory and another for the Transformer?

- Can I compile xsl:includes first, and then the primary/main XSL and have
the primary main resolve the xsl:includes that have been compiled? (this
would be incredibly cool)

Thanks,
-Rob


RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Robert Koberg <ro...@koberg.com>.
Just tried from the command line:

$ java org.apache.xalan.xsltc.cmdline.Compile ancestor-or-self.xsl

$ java org.apache.xalan.xsltc.cmdline.Transform ancestor-or-self.xml
ancestor_or_self
Translet errors:Iterator for typed axis 'ancestor-or-self' not supported.


RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Robert Koberg <ro...@koberg.com>.
Just tried with the XSL and XML I posted here. I get a slightly different
error but it fails on the same XSL ancestor-or-self (if I comment it out the
transform works as expected).

The error:

$ java
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.xsltc.trax.Transfo
rmerFactoryImpl TestXsltc
Xml xalan dev version: 0
Xml xalan maint version: 2
Xml xalan version: Xalan Java 2.5.2
ERROR:  'Iterator for typed axis 'ancestor-or-self' not supported.'
TransformFilter: javax.xml.transform.TransformerException:
java.lang.RuntimeException: Iterator for typed axis 'ancesto
-or-self' not supported.
javax.xml.transform.TransformerException: java.lang.RuntimeException:
Iterator for typed axis 'ancestor-or-self' not su
ported.
        at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:7
12)
        at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:3
07)
        at TestXsltc.<init>(TestXsltc.java:46)
        at TestXsltc.main(TestXsltc.java:71)
Caused by: java.lang.RuntimeException: Iterator for typed axis
'ancestor-or-self' not supported.
        at
org.apache.xalan.xsltc.runtime.BasisLibrary.runTimeError(BasisLibrary.java:1
394)
        at
org.apache.xalan.xsltc.runtime.BasisLibrary.runTimeError(BasisLibrary.java:1
398)
        at
org.apache.xalan.xsltc.dom.SAXImpl.getNamespaceAxisIterator(SAXImpl.java:123
3)
        at
org.apache.xalan.xsltc.dom.DOMAdapter.getNamespaceAxisIterator(DOMAdapter.ja
va:200)
        at ancestor_or_self.restrict()
        at ancestor_or_self.template$dot$1()
        at ancestor_or_self.applyTemplates()
        at ancestor_or_self.template$dot$0()
        at ancestor_or_self.applyTemplates()
        at ancestor_or_self.transform()
        at
org.apache.xalan.xsltc.runtime.AbstractTranslet.transform(AbstractTranslet.j
ava:545)
        at
org.apache.xalan.xsltc.trax.TransformerImpl.transform(TransformerImpl.java:7
02)
        ... 3 more


RE: XSLTC - bug - 'Iterator for typedaxis'ancestor-or-self'not supported.'

Posted by Robert Koberg <ro...@koberg.com>.

> -----Original Message-----
> From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen@sun.com]
> Sent: Friday, October 24, 2003 8:42 AM
> To: xalan-dev@xml.apache.org
> 
> Robert,
> 
>  Thanks. But I still cannot reproduce you're error (the output is
> slightly different from Xalan due to a known bug in xsl:strip-space, but
> there are no problems with iterators).

Hmmm... when I did it I actually had the template/@name="restrict" in an
xsl:include. I put it in the main XSL to send off to you. Could you stick it
in an include and try it?


> 
>  Were you able to re-compile the sources? 

Yes, after doing a checkout

I suggest doing a clean.
> Incidentally, what JDK are you using?


I am using j2sdk1.4.2

And:

$ java org.apache.xalan.Version
Xalan Java 2.5.2

$ java org.apache.xalan.xslt.EnvironmentCheck
#---- BEGIN writeEnvironmentReport($Revision: 1.23 $): Useful stuff found:
----
version.DOM.draftlevel=2.0fd
java.class.path=/cygdrive/c/test_xalan
version.JAXP=1.1 or higher
java.ext.dirs=c:\j2sdk1.4.2\jre\lib\ext
#---- BEGIN Listing XML-related jars in: foundclasses.sun.boot.class.path
----
xalan.jar-path=c:\j2sdk1.4.2\jre\lib\endorsed\xalan.jar
xercesImpl.jar-apparent.version=xercesImpl.jar from xerces-2_4
xercesImpl.jar-path=c:\j2sdk1.4.2\jre\lib\endorsed\xercesImpl.jar
xml-apis.jar-apparent.version=xml-apis.jar present-unknown-version
xml-apis.jar-path=c:\j2sdk1.4.2\jre\lib\endorsed\xml-apis.jar
#----- END Listing XML-related jars in: foundclasses.sun.boot.class.path
-----
version.xerces2=Xerces-J 2.4.0
version.xerces1=not-present
version.xalan2_2=Xalan Java 2.5.2
version.xalan1=not-present
version.ant=not-present
java.version=1.4.2
version.DOM=2.0
version.crimson=present-unknown-version
sun.boot.class.path=c:\j2sdk1.4.2\jre\lib\endorsed\xalan.jar;c:\j2sdk1.4.2\j
re\lib\endorsed\xercesImpl.jar;c:\j2sdk1.4.
\jre\lib\endorsed\xml-apis.jar;c:\j2sdk1.4.2\jre\lib\rt.jar;c:\j2sdk1.4.2\jr
e\lib\i18n.jar;c:\j2sdk1.4.2\jre\lib\sunrsa
ign.jar;c:\j2sdk1.4.2\jre\lib\jsse.jar;c:\j2sdk1.4.2\jre\lib\jce.jar;c:\j2sd
k1.4.2\jre\lib\charsets.jar;c:\j2sdk1.4.2\j
e\classes
version.SAX=2.0
version.xalan2x=Xalan Java 2.5.2
#----- END writeEnvironmentReport: Useful properties found: -----
# YAHOO! Your environment seems to be OK.


> 
> -- Santiago
> 
> On Fri, 2003-10-24 at 11:01, Robert Koberg wrote:
> > Here you go:
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <t:folder id="abc" xmlns:t="tttt">
> >   <t:folder id="restrict">
> >     <t:folder id="under_restrict"/>
> >   </t:folder>
> > </t:folder>
> >
> >   --o--
> >
> > <?xml version="1.0" encoding="utf-8"?>
> > <xsl:stylesheet
> >   version="1.0"
> >   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> >    xmlns:t="tttt"
> >    exclude-result-prefixes="t">
> >
> >   <xsl:output method="html" encoding="utf-8" indent="yes"/>
> >
> >   <xsl:strip-space elements="*"/>
> >
> >   <xsl:template match="/">
> >     <html>
> >       <head>
> >         <title>XSLTC ns_prefix:wildcard bug</title>
> >       </head>
> >       <body>
> >         <xsl:apply-templates/>
> >       </body>
> >     </html>
> >   </xsl:template>
> >
> >
> >   <xsl:template match="t:folder">
> >     <xsl:call-template name="restrict"/>
> >     <xsl:apply-templates/>
> >   </xsl:template>
> >
> >   <xsl:variable name="site_restrict_idref" select="'restrict'"/>
> >
> >   <xsl:template name="restrict">
> >     <xsl:choose>
> >       <xsl:when test="ancestor-or-self::t:*[@id=$site_restrict_idref]">
> >         <xsl:text>folder id: </xsl:text>
> >       </xsl:when>
> >       <xsl:otherwise>
> >         <xsl:text>restriced id: </xsl:text>
> >       </xsl:otherwise>
> >     </xsl:choose>
> >     <xsl:value-of select="@id"/>
> >     <br/>
> >   </xsl:template>
> >
> > </xsl:stylesheet>
> >
> >
> >
> >
> > > -----Original Message-----
> > > From: Santiago Pericas-Geertsen
> [mailto:Santiago.PericasGeertsen@sun.com]
> > > Sent: Friday, October 24, 2003 7:57 AM
> > > To: xalan-dev@xml.apache.org
> > >
> > > On Fri, 2003-10-24 at 10:31, Robert Koberg wrote:
> > > > >
> > > > >  After I sent the message, I tried compiling and running the
> > > stylesheet
> > > > > but was unable to reproduce the problem.
> > > >
> > > > Was there a fix put in or are you saying it was never a bug?
> > >
> > >  Neither :-) Do you have a simple xsl/xml pair that we can try?
> > >
> > > > Also, I just updated my distribution and tried to build the source,
> but
> > > it
> > > > fails because java_cup is not declared (line 128) in:
> > > > java\src\org\apache\xalan\xsltc\util\JavaCupRedirect.java
> > >
> > >  Hmmm, 'java_cup' is a package name. You may want to double check
> > > (perhaps remove and update again) the jar bin/java_cup.jar
> > >
> > > -- Santiago
> >


RE: XSLTC - bug - 'Iterator for typed axis'ancestor-or-self'not supported.'

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
Robert,

 Thanks. But I still cannot reproduce you're error (the output is
slightly different from Xalan due to a known bug in xsl:strip-space, but
there are no problems with iterators).

 Were you able to re-compile the sources? I suggest doing a clean.
Incidentally, what JDK are you using?

-- Santiago

On Fri, 2003-10-24 at 11:01, Robert Koberg wrote:
> Here you go:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <t:folder id="abc" xmlns:t="tttt">
>   <t:folder id="restrict">
>     <t:folder id="under_restrict"/>
>   </t:folder>
> </t:folder>
> 
>   --o--
> 
> <?xml version="1.0" encoding="utf-8"?>
> <xsl:stylesheet 
>   version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:t="tttt"
>    exclude-result-prefixes="t">
>   
>   <xsl:output method="html" encoding="utf-8" indent="yes"/>
>   
>   <xsl:strip-space elements="*"/>
>   
>   <xsl:template match="/">
>     <html>
>       <head>
>         <title>XSLTC ns_prefix:wildcard bug</title>
>       </head>
>       <body>
>         <xsl:apply-templates/>
>       </body>
>     </html>
>   </xsl:template>
>   
> 
>   <xsl:template match="t:folder">
>     <xsl:call-template name="restrict"/>
>     <xsl:apply-templates/>
>   </xsl:template>
>   
>   <xsl:variable name="site_restrict_idref" select="'restrict'"/>
> 
>   <xsl:template name="restrict">
>     <xsl:choose>
>       <xsl:when test="ancestor-or-self::t:*[@id=$site_restrict_idref]">
>         <xsl:text>folder id: </xsl:text>
>       </xsl:when>
>       <xsl:otherwise>
>         <xsl:text>restriced id: </xsl:text>
>       </xsl:otherwise>
>     </xsl:choose>
>     <xsl:value-of select="@id"/>
>     <br/>
>   </xsl:template>
>   
> </xsl:stylesheet>
> 
> 
> 
> 
> > -----Original Message-----
> > From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen@sun.com]
> > Sent: Friday, October 24, 2003 7:57 AM
> > To: xalan-dev@xml.apache.org
> > 
> > On Fri, 2003-10-24 at 10:31, Robert Koberg wrote:
> > > >
> > > >  After I sent the message, I tried compiling and running the
> > stylesheet
> > > > but was unable to reproduce the problem.
> > >
> > > Was there a fix put in or are you saying it was never a bug?
> > 
> >  Neither :-) Do you have a simple xsl/xml pair that we can try?
> > 
> > > Also, I just updated my distribution and tried to build the source, but
> > it
> > > fails because java_cup is not declared (line 128) in:
> > > java\src\org\apache\xalan\xsltc\util\JavaCupRedirect.java
> > 
> >  Hmmm, 'java_cup' is a package name. You may want to double check
> > (perhaps remove and update again) the jar bin/java_cup.jar
> > 
> > -- Santiago
> 


RE: XSLTC - bug - 'Iterator for typed axis'ancestor-or-self'not supported.'

Posted by Robert Koberg <ro...@koberg.com>.
Here you go:

<?xml version="1.0" encoding="UTF-8"?>
<t:folder id="abc" xmlns:t="tttt">
  <t:folder id="restrict">
    <t:folder id="under_restrict"/>
  </t:folder>
</t:folder>

  --o--

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet 
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:t="tttt"
   exclude-result-prefixes="t">
  
  <xsl:output method="html" encoding="utf-8" indent="yes"/>
  
  <xsl:strip-space elements="*"/>
  
  <xsl:template match="/">
    <html>
      <head>
        <title>XSLTC ns_prefix:wildcard bug</title>
      </head>
      <body>
        <xsl:apply-templates/>
      </body>
    </html>
  </xsl:template>
  

  <xsl:template match="t:folder">
    <xsl:call-template name="restrict"/>
    <xsl:apply-templates/>
  </xsl:template>
  
  <xsl:variable name="site_restrict_idref" select="'restrict'"/>

  <xsl:template name="restrict">
    <xsl:choose>
      <xsl:when test="ancestor-or-self::t:*[@id=$site_restrict_idref]">
        <xsl:text>folder id: </xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>restriced id: </xsl:text>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:value-of select="@id"/>
    <br/>
  </xsl:template>
  
</xsl:stylesheet>




> -----Original Message-----
> From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen@sun.com]
> Sent: Friday, October 24, 2003 7:57 AM
> To: xalan-dev@xml.apache.org
> 
> On Fri, 2003-10-24 at 10:31, Robert Koberg wrote:
> > >
> > >  After I sent the message, I tried compiling and running the
> stylesheet
> > > but was unable to reproduce the problem.
> >
> > Was there a fix put in or are you saying it was never a bug?
> 
>  Neither :-) Do you have a simple xsl/xml pair that we can try?
> 
> > Also, I just updated my distribution and tried to build the source, but
> it
> > fails because java_cup is not declared (line 128) in:
> > java\src\org\apache\xalan\xsltc\util\JavaCupRedirect.java
> 
>  Hmmm, 'java_cup' is a package name. You may want to double check
> (perhaps remove and update again) the jar bin/java_cup.jar
> 
> -- Santiago


RE: XSLTC - bug - 'Iterator for typed axis 'ancestor-or-self'not supported.'

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
On Fri, 2003-10-24 at 10:31, Robert Koberg wrote:
> > 
> >  After I sent the message, I tried compiling and running the stylesheet
> > but was unable to reproduce the problem.
> 
> Was there a fix put in or are you saying it was never a bug?

 Neither :-) Do you have a simple xsl/xml pair that we can try? 

> Also, I just updated my distribution and tried to build the source, but it
> fails because java_cup is not declared (line 128) in:
> java\src\org\apache\xalan\xsltc\util\JavaCupRedirect.java

 Hmmm, 'java_cup' is a package name. You may want to double check
(perhaps remove and update again) the jar bin/java_cup.jar

-- Santiago



RE: XSLTC - bug - 'Iterator for typed axis 'ancestor-or-self'not supported.'

Posted by Robert Koberg <ro...@koberg.com>.

> -----Original Message-----
> From: Santiago Pericas-Geertsen [mailto:Santiago.PericasGeertsen@sun.com]
> Sent: Friday, October 24, 2003 6:39 AM
> To: xalan-dev@xml.apache.org
> 
> On Fri, 2003-10-24 at 09:13, Morris Kwan wrote:
> > >> Morris K.: Did you comment these lines out? Should we
> > >> get back to the issue you raise the comment?
> > No. That change was not made by me. However, I do not think the control
> > flow would go into DTMDefaultBaseIterators. It should call
> > SAXImpl.getTypedAxisIterator() instead. I can take a look at it.
> 
>  After I sent the message, I tried compiling and running the stylesheet
> but was unable to reproduce the problem.

Was there a fix put in or are you saying it was never a bug?

Also, I just updated my distribution and tried to build the source, but it
fails because java_cup is not declared (line 128) in:
java\src\org\apache\xalan\xsltc\util\JavaCupRedirect.java

-Rob

> 
> -- Santiago


RE: XSLTC - bug - 'Iterator for typed axis 'ancestor-or-self' not supported.'

Posted by Santiago Pericas-Geertsen <Sa...@sun.com>.
On Fri, 2003-10-24 at 09:13, Morris Kwan wrote:
> >> Morris K.: Did you comment these lines out? Should we
> >> get back to the issue you raise the comment?
> No. That change was not made by me. However, I do not think the control
> flow would go into DTMDefaultBaseIterators. It should call
> SAXImpl.getTypedAxisIterator() instead. I can take a look at it.

 After I sent the message, I tried compiling and running the stylesheet
but was unable to reproduce the problem.

-- Santiago



RE: XSLTC - bug - 'Iterator for typed axis 'ancestor-or-self' not supported.'

Posted by Morris Kwan <mk...@ca.ibm.com>.



>> Morris K.: Did you comment these lines out? Should we
>> get back to the issue you raise the comment?
No. That change was not made by me. However, I do not think the control
flow would go into DTMDefaultBaseIterators. It should call
SAXImpl.getTypedAxisIterator() instead. I can take a look at it.

-- Morris Kwan