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

RE: Error when switching to java 1.5

Subject: RE: Error when switching to java 1.5
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Tue, 24 Oct 2006 19:43:37 +0100
java 1.5 xslt
You either need to pursue the problem with the support channel for the XSLT
processor in question, or you need to switch to a different XSLT processor.
Trying to change your code to work around the problem isn't a good way
forward unless you know very specifically what the problem is.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: footh [mailto:footh@xxxxxxxxx] 
> Sent: 24 October 2006 19:38
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Error when switching to java 1.5
> 
> Thanks for the reply.
> 
> I am using Xalan 2.7 which implements XSLT 1.0.
> 
> The idea behind the identity template is to just repeat the 
> source XML.  So, that is my desired result.
>  In this case, I have HTML mixed in with custom XML. 
> The custom XML gets transformed with specific templates while 
> the HTML should just be copied over.
> 
> I've experimented a little on the results.  It turns out that 
> the error occurs when the processor first hits an attribute 
> inside an HTML tag.  What I did was change the problematic 
> "apply-templates" tag to this:
> 
> <xsl:apply-templates select="@id|node()" />
> 
> Then used a simple source XML doc:
> 
> <div id="someid">hello</div>
> 
> And, I received the error.  But if I took out the "id"
> attribute then I did not receive the error.  Of course, if I 
> changed it to another attribute, then I wouldn't receive an 
> error, but the attribute would not be copied to the result.
> 
> So, clearly, something is going wrong with coping over attributes.
> 
> Note that if I use this identity template:
> 
> <xsl:template match="@*|node()">
>   <xsl:copy>
>     <xsl:apply-templates select="@*|node()"/>
>   </xsl:copy>
> </xsl:template>
> 
> Everything works fine.  BUT, this template does not remove 
> namespaces (which causes the result to not conform to valid XHTML).
> 
> So, if anyone can suggest another way to have an identity 
> template that removes namespaces, that would be great.  For 
> reference, here is the identity template combo I'm using that 
> is problematic (on the second template):
> 
> <xsl:template match="@*">
>   <xsl:attribute name="{name()}"
> namespace="{namespace-uri()}">
>    <xsl:value-of select="." />
>   </xsl:attribute>
> </xsl:template>
> 
> <xsl:template match="*">
>   <xsl:element name="{name()}"
> namespace="{namespace-uri()}">
>    <xsl:apply-templates select="@*|node()" />
>   </xsl:element>
> </xsl:template>
> 
> 
> 
> 
> --- Mukul Gandhi <gandhi.mukul@xxxxxxxxx> wrote:
> 
> > Can you please tell, what is your source XML and the desired output?
> > 
> > Which XSLT processor and its version are you using?
> > Are you using XSLT
> > 1.0 or XSLT 2.0?
> > 
> > This information will help us to solve the problem.
> > 
> > On 10/21/06, footh <footh@xxxxxxxxx> wrote:
> > > I am using an identity template that removes namespaces 
> in a Cocoon 
> > > application that runs under Tomcat.  Previously, I was using Java 
> > > 1.4.2 but
> > once I
> > > switched to Java 1.5 I receive a null pointer 
> TransformerException.  
> > > Following is the identity template that matches all nodes.  The 
> > > error occurs
> > on
> > > the "apply-templates" tag.  On the "select"
> > attribute,
> > > the presence of the "@*" symbol causes the error. 
> > If
> > > I remove it, everything is fine.  However, then 
> attributes of nodes 
> > > are not rendered.  Has anyone encountered this problem 
> before?  Any 
> > > suggestions?
> > >
> > >  <xsl:template match="*">
> > >   <xsl:element name="{name()}"
> > > namespace="{namespace-uri()}">
> > >     <xsl:apply-templates select="@*|node()" />
> > >   </xsl:element>
> > >  </xsl:template>
> > 
> > 
> > --
> > Regards,
> > Mukul Gandhi
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection 
> around http://mail.yahoo.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.