You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Kamal Bhatt <kb...@tt.com.au> on 2006/05/26 09:32:54 UTC

Warnings for XSLT

Hi
I keep getting warnings about TraxErrorListener for line 55 and 64 for 
the XSLT included at the end of this file. To make life easier the 
problem is with the following lines:
<xsl:element name="*{local-name()}*">
and
<xsl:attribute name="*{name()}*">

without the curly braces it does not work, but with them I get the 
warnings. As the pipelines that reference this are high traffic, I find 
the logs files jam packed with these warnings. How can I get rid of them?

We are using cocoon-2.1.9 on jboss.

Cheers.


<xsl:stylesheet version="*1.0*" 
xmlns:xsl="*http://www.w3.org/1999/XSL/Transform*" 
xmlns:sup="*http://www.calypso.net.au/apps/supub/SupplierV1.0*" 
xmlns="*http://www.calypso.net.au/apps/supub/SupplierV1.0*">
- <#> <xsl:template match="*files*">
  <xsl:apply-templates select="*sup:supplier*" />
  </xsl:template>
- <#> <xsl:template match="*sup:supplier*">
- <#> <supplier xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*">
  <xsl:apply-templates select="*@*|node()*" />
- <#> <supplementary>
  <xsl:apply-templates select="*../customRows*" />
  </supplementary>
  </supplier>
  </xsl:template>
- <#> <xsl:template match="*node()*">
- <#> <xsl:element name="*{local-name()}*">
  <xsl:apply-templates select="*@**" />
- <#> <xsl:if test="*count(*) = 0*">
  <xsl:value-of select="*.*" />
  </xsl:if>
  <xsl:apply-templates select="*child::**" />
  </xsl:element>
  </xsl:template>
- <#> <xsl:template match="*@**">
- <#> <xsl:attribute name="*{name()}*">
  <xsl:value-of select="*.*" />
  </xsl:attribute>
  </xsl:template>
  </xsl:stylesheet>

-- 
Kamal Bhatt


--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Kamal Bhatt <kb...@tt.com.au>.
WARN  (2006-05-26) 17:27.19:443 [sitemap.transformer.xslt] 
(/apps/ccn/exp/query?max=10&city=LON) TP-Processor14/TraxErrorListener: 
file:/data/content/tsg/ccn/xslt/combine_supub_custom.xsl:65:36

Not too helpful. As I said I fixed it, so I am not bothered by it too 
much, but I would like to know what is to blame so I don't have to 
repeat it.

Cheers.

Jason Johnston wrote:

> Kamal Bhatt wrote:
>
>>
>> Sorry, but this was a cocoon specific issue. The script was working 
>> fine as it was. The problem (which got lost thanks to my bad copying 
>> and pasting) was not the script, it was with the unexplained warnings 
>> (TraxErrorListener) that I got from running the scripts. Is that a 
>> bug or is it something illegal that I am doing in my XSLT that would 
>> not work in another more stringent parser?
>
>
> Can you post the exact warnings you are/were seeing?
>
> TraxErrorListener is simply a class that listens for errors and 
> warnings coming from the XSLT processor, and logs them along with some 
> helpful contextual information.  The thing creating those 
> errors/warnings is most likely not Cocoon, but the XSLT processor.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Kamal Bhatt


--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Jason Johnston <co...@lojjic.net>.
Kamal Bhatt wrote:
> 
> Sorry, but this was a cocoon specific issue. The script was working fine 
> as it was. The problem (which got lost thanks to my bad copying and 
> pasting) was not the script, it was with the unexplained warnings 
> (TraxErrorListener) that I got from running the scripts. Is that a bug 
> or is it something illegal that I am doing in my XSLT that would not 
> work in another more stringent parser?

Can you post the exact warnings you are/were seeing?

TraxErrorListener is simply a class that listens for errors and warnings 
coming from the XSLT processor, and logs them along with some helpful 
contextual information.  The thing creating those errors/warnings is 
most likely not Cocoon, but the XSLT processor.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Kamal Bhatt <kb...@tt.com.au>.
Sorry, but this was a cocoon specific issue. The script was working fine 
as it was. The problem (which got lost thanks to my bad copying and 
pasting) was not the script, it was with the unexplained warnings 
(TraxErrorListener) that I got from running the scripts. Is that a bug 
or is it something illegal that I am doing in my XSLT that would not 
work in another more stringent parser?

I wish I saw that wiki page earlier, it would have saved me half a day's 
worth or work.

Cheers.

Jason Johnston wrote:

> Kamal Bhatt wrote:
>
>>
>> Apologies, I did not see that. Yes, you are right most of those * is 
>> not meant to be there. It was rendering right when I pasted it in. I 
>> did not realise that is what the browser does. Sorry people, please 
>> ignore the unnecessary *. Someone at work worked out that you don't 
>> need the node() and * would surfice and seems to fix the problem. I 
>> would like to know why it is a problem though..
>
>
> I'm not sure, but one possibility: node() matches not only elements 
> but any node: attributes, text, comments... so your template would 
> have ended up trying to call local-name() on nodes that don't have a 
> local name.  That would explain why changing it to match only elements 
> with * cleared up the problem.
>
> Since this isn't a Cocoon-specific issue, an XSLT mailing list or 
> forum may be a better bet for getting the answer.  Or perhaps one 
> specific to the XSLT processor you're using (Xalan?), since it's 
> likely different processors handle these edge cases differently.
>
>> What I was trying to do is copy one element into another element and 
>> remove unnecessary namespace declarations (as this is meant to be 
>> published XML) whilst retaining a specific namespace (the supplier 
>> namespace).
>
>
> There is a page on the Cocoon wiki about stripping extra namespace 
> declarations, as it is a common problem: 
> http://wiki.apache.org/cocoon/RemoveNamespaces
>
>>
>> <files>
>>  <supplier ...>
>>     ...
>>  </supplier>
>>  <customRows>
>>    ...
>>  </customRows>
>> </files>
>>
>> becomes:
>>
>> <sup:supplier sup:xmlns="..." xmlns="..." ...>
>>  ...
>>  <sup:supplementary>
>>    <sup:customRows>
>>    ...
>>    </sup:customRows>
>>  </sup:supplementary>
>> </sup:supplier>
>>
>> Here is an unadulterated version of the XSLT
>>
>> <xsl:stylesheet version="1.0"
>>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>    xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>    xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>>    >
>>  <xsl:template match="files">
>>     <xsl:apply-templates select="sup:supplier"/>
>>  </xsl:template>
>>  <xsl:template match="sup:supplier">
>>    <supplier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>>      <xsl:apply-templates select="@*|node()"/>
>>      <supplementary>
>>    <xsl:apply-templates select="../customRows"/>
>>      </supplementary>
>>    </supplier>
>>  </xsl:template>
>>
>>  <xsl:template match="node()>
>>    <xsl:element name="{local-name()}">
>>      <xsl:apply-templates select="@*"/>
>>      <xsl:if test="count(*) = 0">
>>        <xsl:value-of select="."/>
>>      </xsl:if>          <xsl:apply-templates select="child::*"/>
>>    </xsl:element>
>>  </xsl:template>
>>
>>  <xsl:template match="@*">
>>    <xsl:attribute name="{name()}">
>>      <xsl:value-of select="."/>
>>    </xsl:attribute>   </xsl:template>
>> </xsl:stylesheet>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Kamal Bhatt


--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Jason Johnston <co...@lojjic.net>.
Kamal Bhatt wrote:
> 
> Apologies, I did not see that. Yes, you are right most of those * is not 
> meant to be there. It was rendering right when I pasted it in. I did not 
> realise that is what the browser does. Sorry people, please ignore the 
> unnecessary *. Someone at work worked out that you don't need the node() 
> and * would surfice and seems to fix the problem. I would like to know 
> why it is a problem though..

I'm not sure, but one possibility: node() matches not only elements but 
any node: attributes, text, comments... so your template would have 
ended up trying to call local-name() on nodes that don't have a local 
name.  That would explain why changing it to match only elements with * 
cleared up the problem.

Since this isn't a Cocoon-specific issue, an XSLT mailing list or forum 
may be a better bet for getting the answer.  Or perhaps one specific to 
the XSLT processor you're using (Xalan?), since it's likely different 
processors handle these edge cases differently.

> What I was trying to do is copy one element 
> into another element and remove unnecessary namespace declarations (as 
> this is meant to be published XML) whilst retaining a specific namespace 
> (the supplier namespace).

There is a page on the Cocoon wiki about stripping extra namespace 
declarations, as it is a common problem: 
http://wiki.apache.org/cocoon/RemoveNamespaces

> 
> <files>
>  <supplier ...>
>     ...
>  </supplier>
>  <customRows>
>    ...
>  </customRows>
> </files>
> 
> becomes:
> 
> <sup:supplier sup:xmlns="..." xmlns="..." ...>
>  ...
>  <sup:supplementary>
>    <sup:customRows>
>    ...
>    </sup:customRows>
>  </sup:supplementary>
> </sup:supplier>
> 
> Here is an unadulterated version of the XSLT
> 
> <xsl:stylesheet version="1.0"
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>    xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>    >
>  <xsl:template match="files">
>     <xsl:apply-templates select="sup:supplier"/>
>  </xsl:template>
>  <xsl:template match="sup:supplier">
>    <supplier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>      <xsl:apply-templates select="@*|node()"/>
>      <supplementary>
>    <xsl:apply-templates select="../customRows"/>
>      </supplementary>
>    </supplier>
>  </xsl:template>
> 
>  <xsl:template match="node()>
>    <xsl:element name="{local-name()}">
>      <xsl:apply-templates select="@*"/>
>      <xsl:if test="count(*) = 0">
>        <xsl:value-of select="."/>
>      </xsl:if>          <xsl:apply-templates select="child::*"/>
>    </xsl:element>
>  </xsl:template>
> 
>  <xsl:template match="@*">
>    <xsl:attribute name="{name()}">
>      <xsl:value-of select="."/>
>    </xsl:attribute>   </xsl:template>
> </xsl:stylesheet>
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Martynas Jusevicius <ma...@gmail.com>.
Have you tried <xsl:stylesheet ... exclude-result-prefixes="sup">?

Martynas

On 5/29/06, Kamal Bhatt <kb...@tt.com.au> wrote:
>
> Apologies, I did not see that. Yes, you are right most of those * is not
> meant to be there. It was rendering right when I pasted it in. I did not
> realise that is what the browser does. Sorry people, please ignore the
> unnecessary *. Someone at work worked out that you don't need the node()
> and * would surfice and seems to fix the problem. I would like to know
> why it is a problem though.. What I was trying to do is copy one element
> into another element and remove unnecessary namespace declarations (as
> this is meant to be published XML) whilst retaining a specific namespace
> (the supplier namespace). eg:
>
> <files>
>   <supplier ...>
>      ...
>   </supplier>
>   <customRows>
>     ...
>   </customRows>
> </files>
>
> becomes:
>
> <sup:supplier sup:xmlns="..." xmlns="..." ...>
>   ...
>   <sup:supplementary>
>     <sup:customRows>
>     ...
>     </sup:customRows>
>   </sup:supplementary>
> </sup:supplier>
>
> Here is an unadulterated version of the XSLT
>
> <xsl:stylesheet version="1.0"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>     xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0"
>     >
>   <xsl:template match="files">
>      <xsl:apply-templates select="sup:supplier"/>
>   </xsl:template>
>
>   <xsl:template match="sup:supplier">
>     <supplier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
>       <xsl:apply-templates select="@*|node()"/>
>       <supplementary>
>     <xsl:apply-templates select="../customRows"/>
>       </supplementary>
>     </supplier>
>   </xsl:template>
>
>   <xsl:template match="node()>
>     <xsl:element name="{local-name()}">
>       <xsl:apply-templates select="@*"/>
>       <xsl:if test="count(*) = 0">
>         <xsl:value-of select="."/>
>       </xsl:if>
>       <xsl:apply-templates select="child::*"/>
>     </xsl:element>
>   </xsl:template>
>
>   <xsl:template match="@*">
>     <xsl:attribute name="{name()}">
>       <xsl:value-of select="."/>
>     </xsl:attribute>
>   </xsl:template>
> </xsl:stylesheet>
>
>
>
> Lars Huttar wrote:
>
> > Kamal Bhatt wrote:
> >
> >>
> >> Hi
> >> I keep getting warnings about TraxErrorListener for line 55 and 64
> >> for the XSLT included at the end of this file. To make life easier
> >> the problem is with the following lines:
> >> <xsl:element name="*{local-name()}*">
> >> and
> >> <xsl:attribute name="*{name()}*">
> >
> > ||
> >
> >>
> >> without the curly braces it does not work, but with them I get the
> >> warnings. As the pipelines that reference this are high traffic, I
> >> find the logs files jam packed with these warnings. How can I get rid
> >> of them?
> >>
> >> We are using cocoon-2.1.9 on jboss.
> >>
> >> Cheers.
> >>
> >>
> >> <xsl:stylesheet version="*1.0*"
> >> xmlns:xsl="*http://www.w3.org/1999/XSL/Transform*"
> >> xmlns:sup="*http://www.calypso.net.au/apps/supub/SupplierV1.0*"
> >> xmlns="*http://www.calypso.net.au/apps/supub/SupplierV1.0*">
> >> - <#> <xsl:template match="*files*">
> >>  <xsl:apply-templates select="*sup:supplier*" />
> >>  </xsl:template>
> >> - <#> <xsl:template match="*sup:supplier*">
> >> - <#> <supplier xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*">
> >>  <xsl:apply-templates select="*@*|node()*" />
> >> - <#> <supplementary>
> >>  <xsl:apply-templates select="*../customRows*" />
> >>  </supplementary>
> >>  </supplier>
> >>  </xsl:template>
> >> - <#> <xsl:template match="*node()*">
> >> - <#> <xsl:element name="*{local-name()}*">
> >>  <xsl:apply-templates select="*@**" />
> >> - <#> <xsl:if test="*count(*) = 0*">
> >>  <xsl:value-of select="*.*" />
> >>  </xsl:if>
> >>  <xsl:apply-templates select="*child::**" />
> >>  </xsl:element>
> >>  </xsl:template>
> >> - <#> <xsl:template match="*@**">
> >> - <#> <xsl:attribute name="*{name()}*">
> >>  <xsl:value-of select="*.*" />
> >>  </xsl:attribute>
> >>  </xsl:template>
> >>  </xsl:stylesheet>
> >>
> >
> > Please describe what you mean by these asterisks, and we can try to
> > ...  OH!!!
> >
> > I bet you copied and pasted from the browser where these attribute
> > values were shown in BOLD, or something!
> > And the bold got translated into asterisks!   (+,+)
> >
> > (Deleting several sentences I wrote above about ill-formed XML element
> > names.)
> >
> > OK, looking at your stylesheet afresh...
> > Your curly brackets look OK, though the templates could be simplified.
> > Can you tell us in more detail what the warnings say?
> >
> > Here is a simpler version of your last two templates:
> >
> >  <xsl:template match="node()">
> >    <xsl:copy>
> >      <xsl:apply-templates select="@*"/>
> >      <xsl:if test="not(*)">
> >        <xsl:value-of select="."/>
> >      </xsl:if>
> >      <xsl:apply-templates select="*"/>
> >    </xsl:copy>
> >  </xsl:template>
> >  <xsl:template match="@*">
> >    <xsl:copy-of select="." />
> >  </xsl:template>
> >
> > Depending on what you're trying to do, you may find an identity
> > template useful:
> > http://www.xmltraining.biz/xsltidentity
> >
> > HTH,
> > Lars
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>
>
> --
> Kamal Bhatt
>
>
> --
> Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Kamal Bhatt <kb...@tt.com.au>.
Apologies, I did not see that. Yes, you are right most of those * is not 
meant to be there. It was rendering right when I pasted it in. I did not 
realise that is what the browser does. Sorry people, please ignore the 
unnecessary *. Someone at work worked out that you don't need the node() 
and * would surfice and seems to fix the problem. I would like to know 
why it is a problem though.. What I was trying to do is copy one element 
into another element and remove unnecessary namespace declarations (as 
this is meant to be published XML) whilst retaining a specific namespace 
(the supplier namespace). eg:

<files>
  <supplier ...>
     ...
  </supplier>
  <customRows>
    ...
  </customRows>
</files>

becomes:

<sup:supplier sup:xmlns="..." xmlns="..." ...>
  ...
  <sup:supplementary>
    <sup:customRows>
    ...
    </sup:customRows>
  </sup:supplementary>
</sup:supplier>

Here is an unadulterated version of the XSLT

<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:sup="http://www.calypso.net.au/apps/supub/SupplierV1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns="http://www.calypso.net.au/apps/supub/SupplierV1.0"
    >
  <xsl:template match="files">
     <xsl:apply-templates select="sup:supplier"/>
  </xsl:template> 

  <xsl:template match="sup:supplier">
    <supplier xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <xsl:apply-templates select="@*|node()"/>
      <supplementary>
    <xsl:apply-templates select="../customRows"/>
      </supplementary>
    </supplier>
  </xsl:template>
 
  <xsl:template match="node()>
    <xsl:element name="{local-name()}">
      <xsl:apply-templates select="@*"/>
      <xsl:if test="count(*) = 0">
        <xsl:value-of select="."/>
      </xsl:if>     
      <xsl:apply-templates select="child::*"/>
    </xsl:element>
  </xsl:template>

  <xsl:template match="@*">
    <xsl:attribute name="{name()}">
      <xsl:value-of select="."/>
    </xsl:attribute>  
  </xsl:template>
</xsl:stylesheet>



Lars Huttar wrote:

> Kamal Bhatt wrote:
>
>>
>> Hi
>> I keep getting warnings about TraxErrorListener for line 55 and 64 
>> for the XSLT included at the end of this file. To make life easier 
>> the problem is with the following lines:
>> <xsl:element name="*{local-name()}*">
>> and
>> <xsl:attribute name="*{name()}*">
>
> ||
>
>>
>> without the curly braces it does not work, but with them I get the 
>> warnings. As the pipelines that reference this are high traffic, I 
>> find the logs files jam packed with these warnings. How can I get rid 
>> of them?
>>
>> We are using cocoon-2.1.9 on jboss.
>>
>> Cheers.
>>
>>
>> <xsl:stylesheet version="*1.0*" 
>> xmlns:xsl="*http://www.w3.org/1999/XSL/Transform*" 
>> xmlns:sup="*http://www.calypso.net.au/apps/supub/SupplierV1.0*" 
>> xmlns="*http://www.calypso.net.au/apps/supub/SupplierV1.0*">
>> - <#> <xsl:template match="*files*">
>>  <xsl:apply-templates select="*sup:supplier*" />
>>  </xsl:template>
>> - <#> <xsl:template match="*sup:supplier*">
>> - <#> <supplier xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*">
>>  <xsl:apply-templates select="*@*|node()*" />
>> - <#> <supplementary>
>>  <xsl:apply-templates select="*../customRows*" />
>>  </supplementary>
>>  </supplier>
>>  </xsl:template>
>> - <#> <xsl:template match="*node()*">
>> - <#> <xsl:element name="*{local-name()}*">
>>  <xsl:apply-templates select="*@**" />
>> - <#> <xsl:if test="*count(*) = 0*">
>>  <xsl:value-of select="*.*" />
>>  </xsl:if>
>>  <xsl:apply-templates select="*child::**" />
>>  </xsl:element>
>>  </xsl:template>
>> - <#> <xsl:template match="*@**">
>> - <#> <xsl:attribute name="*{name()}*">
>>  <xsl:value-of select="*.*" />
>>  </xsl:attribute>
>>  </xsl:template>
>>  </xsl:stylesheet>
>>
>
> Please describe what you mean by these asterisks, and we can try to 
> ...  OH!!!
>
> I bet you copied and pasted from the browser where these attribute 
> values were shown in BOLD, or something!
> And the bold got translated into asterisks!   (+,+)
>
> (Deleting several sentences I wrote above about ill-formed XML element 
> names.)
>
> OK, looking at your stylesheet afresh...
> Your curly brackets look OK, though the templates could be simplified.
> Can you tell us in more detail what the warnings say?
>
> Here is a simpler version of your last two templates:
>
>  <xsl:template match="node()">
>    <xsl:copy>
>      <xsl:apply-templates select="@*"/>
>      <xsl:if test="not(*)">
>        <xsl:value-of select="."/>
>      </xsl:if>
>      <xsl:apply-templates select="*"/>
>    </xsl:copy>
>  </xsl:template>
>  <xsl:template match="@*">
>    <xsl:copy-of select="." />
>  </xsl:template>
>
> Depending on what you're trying to do, you may find an identity 
> template useful:
> http://www.xmltraining.biz/xsltidentity
>
> HTH,
> Lars
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


-- 
Kamal Bhatt


--
Disclaimer: This email is confidential and may contain privileged information for the sole use of the person or business to which it is addressed. If you are not the intended recipient, please notify the sender by return e-mail or phone as you must not view, disseminate, distribute or copy this email without our consent. We do not accept any liability in connection with any computer virus, data corruption, incompleteness, or unauthorised amendment of this email. It is the sole responsibility of the receiver to scan for viruses before opening.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Warnings for XSLT

Posted by Lars Huttar <la...@sil.org>.
Kamal Bhatt wrote:
>
> Hi
> I keep getting warnings about TraxErrorListener for line 55 and 64 for 
> the XSLT included at the end of this file. To make life easier the 
> problem is with the following lines:
> <xsl:element name="*{local-name()}*">
> and
> <xsl:attribute name="*{name()}*">
||
>
> without the curly braces it does not work, but with them I get the 
> warnings. As the pipelines that reference this are high traffic, I 
> find the logs files jam packed with these warnings. How can I get rid 
> of them?
>
> We are using cocoon-2.1.9 on jboss.
>
> Cheers.
>
>
> <xsl:stylesheet version="*1.0*" 
> xmlns:xsl="*http://www.w3.org/1999/XSL/Transform*" 
> xmlns:sup="*http://www.calypso.net.au/apps/supub/SupplierV1.0*" 
> xmlns="*http://www.calypso.net.au/apps/supub/SupplierV1.0*">
> - <#> <xsl:template match="*files*">
>  <xsl:apply-templates select="*sup:supplier*" />
>  </xsl:template>
> - <#> <xsl:template match="*sup:supplier*">
> - <#> <supplier xmlns:xsi="*http://www.w3.org/2001/XMLSchema-instance*">
>  <xsl:apply-templates select="*@*|node()*" />
> - <#> <supplementary>
>  <xsl:apply-templates select="*../customRows*" />
>  </supplementary>
>  </supplier>
>  </xsl:template>
> - <#> <xsl:template match="*node()*">
> - <#> <xsl:element name="*{local-name()}*">
>  <xsl:apply-templates select="*@**" />
> - <#> <xsl:if test="*count(*) = 0*">
>  <xsl:value-of select="*.*" />
>  </xsl:if>
>  <xsl:apply-templates select="*child::**" />
>  </xsl:element>
>  </xsl:template>
> - <#> <xsl:template match="*@**">
> - <#> <xsl:attribute name="*{name()}*">
>  <xsl:value-of select="*.*" />
>  </xsl:attribute>
>  </xsl:template>
>  </xsl:stylesheet>
>

Please describe what you mean by these asterisks, and we can try to ...  
OH!!!

I bet you copied and pasted from the browser where these attribute 
values were shown in BOLD, or something!
And the bold got translated into asterisks!   (+,+)

(Deleting several sentences I wrote above about ill-formed XML element 
names.)

OK, looking at your stylesheet afresh...
Your curly brackets look OK, though the templates could be simplified.
Can you tell us in more detail what the warnings say?

Here is a simpler version of your last two templates:

  <xsl:template match="node()">
    <xsl:copy>
      <xsl:apply-templates select="@*"/>
      <xsl:if test="not(*)">
        <xsl:value-of select="."/>
      </xsl:if>
      <xsl:apply-templates select="*"/>
    </xsl:copy>
  </xsl:template>
  <xsl:template match="@*">
    <xsl:copy-of select="." />
  </xsl:template>

Depending on what you're trying to do, you may find an identity template 
useful:
http://www.xmltraining.biz/xsltidentity

HTH,
Lars



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org