-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


OK.

This is strange.  I have the following stylesheet.  The problem is that I can't
use an extension without a root element (NPEs).  

<xsl:stylesheet xmlns="http://www.w3.org/1999/xhtml"; 
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; 
                xmlns:tasks="http://schemas.openprivacy.org/reptile/settings/jvm/tasks";
                xmlns:bootstrap="http://schemas.openprivacy.org/reptile/bootstrap";
                xmlns:pe="xalan://org.openprivacy.reptile.extensions.JVMProperties"
                xmlns:jp="http://schemas.openprivacy.org/reptile/java/properties";
                extension-element-prefixes="pe"
                version="1.0">

    <xsl:output indent="yes" 
                omit-xml-declaration="yes"/>                

    <xsl:template match="/bootstrap:bootstrap">

        <jp:properties>

            <!-- fill in properties -->
            <pe:properties/>

        </jp:properties>

    </xsl:template>

</xsl:stylesheet>


The only problem is that if I remove the <jp:properties> parent node I get an
Exception.   Example:

    <xsl:template match="/bootstrap:bootstrap">

        <!-- fill in properties -->
        <pe:properties/>

    </xsl:template>

I tried to find an entry about this in Bugzilla but didn't see anything that
could apply.  

Here is the offending code from the stack trace I will include below:

  public void addAttribute(
          String uri, String localName, String rawName, String type, String value)
            throws TransformerException
  {

    QueuedStartElement qe = getQueuedElem();

    if ( !qe.nsDeclsHaveBeenAdded() )
        addNSDeclsToAttrs();

- ----------- and the stack trace ------------------- 


file:/usr/local/rsync/projects/reptile/tmp/../src/xsl/settings/jvm/properties.xsl; 
Line 48; Column -1; 

javax.xml.transform.TransformerException: Unknown error when calling extension!
        at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1269)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3070)
        at java.lang.Thread.run(Thread.java:498)
- ---------
; SystemID: 
file:/usr/local/rsync/projects/reptile/tmp/../src/xsl/settings/jvm/properties.xsl; 
Line#: 48; Column#: -1
; SystemID: 
file:/usr/local/rsync/projects/reptile/tmp/../src/xsl/settings/jvm/properties.xsl; 
Line#: 48; Column#: -1
javax.xml.transform.TransformerException: Unknown error when calling extension!
        at 
org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:326)
        at 
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:499)
        at 
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2251)
        at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2134)
        at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1246)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3070)
        at java.lang.Thread.run(Thread.java:498)
- ---------
java.lang.NullPointerException
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttribute(ResultTreeHandler.java:1183)
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttribute(ResultTreeHandler.java:1291)
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttributes(ResultTreeHandler.java:1313)
        at 
org.apache.xalan.transformer.ClonerToResultTree.cloneToResultTree(ClonerToResultTree.java:208)
        at 
org.apache.xalan.transformer.ResultTreeHandler.cloneToResultTree(ResultTreeHandler.java:819)
        at 
org.apache.xalan.extensions.XSLProcessorContext.outputToResultTree(XSLProcessorContext.java:260)
        at 
org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:428)
        at 
org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:305)
        at 
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:499)
        at 
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2251)
        at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2134)
        at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1246)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3070)
        at java.lang.Thread.run(Thread.java:498)
- ---------
java.lang.NullPointerException
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttribute(ResultTreeHandler.java:1183)
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttribute(ResultTreeHandler.java:1291)
        at 
org.apache.xalan.transformer.ResultTreeHandler.addAttributes(ResultTreeHandler.java:1313)
        at 
org.apache.xalan.transformer.ClonerToResultTree.cloneToResultTree(ClonerToResultTree.java:208)
        at 
org.apache.xalan.transformer.ResultTreeHandler.cloneToResultTree(ResultTreeHandler.java:819)
        at 
org.apache.xalan.extensions.XSLProcessorContext.outputToResultTree(XSLProcessorContext.java:260)
        at 
org.apache.xalan.extensions.ExtensionHandlerJavaClass.processElement(ExtensionHandlerJavaClass.java:428)
        at 
org.apache.xalan.templates.ElemExtensionCall.execute(ElemExtensionCall.java:305)
        at 
org.apache.xalan.templates.ElemForEach.transformSelectedNodes(ElemForEach.java:499)
        at 
org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:193)
        at 
org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2251)
        at 
org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2134)
        at 
org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1246)
        at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3070)
        at java.lang.Thread.run(Thread.java:498)


- -- 
Kevin A. Burton ( [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] )
        Cell: 408-910-6145 URL: http://relativity.yi.org ICQ: 73488596 

Linux.  Don't leave home without it!



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: Get my public key at: http://relativity.yi.org/pgpkey.txt

iD8DBQE7b0asAwM6xb2dfE0RAj3bAJ9c8ViwthGAVwldKn6G7fycc6yCswCffqBV
HMiLclT6Sxl2WuZfP5mIxvo=
=lhz9
-----END PGP SIGNATURE-----

Reply via email to