cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hiloliddin Karimov <HKari...@central.nbu.com>
Subject Problem with paginating transformer
Date Mon, 17 Jun 2002 11:39:03 GMT
Hi all,

I am trying use paginating transformer in scratchpad.
What's problem with elementURI in the PageRules, it is NullPointerException.
I get error:
Original exception : java.lang.NullPointerException at
org.apache.cocoon.transformation.pagination.PageRules.match(PageRules.java:
22) at
org.apache.cocoon.transformation.pagination.Pagesheet.processStartElement(Pa
gesheet.java:264) at
org.apache.cocoon.transformation.pagination.Paginator.startElement(Paginator
.java:196) at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.j
ava:445) at
...
is must use <items> in the images.xml for PageRules.elementURI getting
value, if yes: how? and what is it?
But, when I take out ...&& this.elementURI.equals(namespace) from
RageRules.match() it works.
such as:
in PageRules.java
...
    public boolean match(String element, String namespace) {
//        return (this.elementName.equals(element) &&
this.elementURI.equals(namespace));
        return ( this.elementName.equals(element) );
    }
...

=== here what I have ===:
sitemap.xmap:
...
  <map:transformers default="xslt">
    <map:transformer name="paginate"
         src="org.apache.cocoon.transformation.pagination.Paginator"/>
  </map:transformers>
...
  <map:match pattern="page(*)">
   <map:generate src="docs/document.xml"/>
   <map:transform type="paginate" src="pagesheets/images.xml">
<!--     <map:parameter name="page" value="{2}"/>-->
     <map:parameter name="page" value="{1}"/>
   </map:transform>
   <map:serialize type="xml"/>
  </map:match>
...

pagesheets\images.xml:
<?xml version="1.0"?>
<pagesheet xmlns="http://apache.org/cocoon/paginate/1.0">
  <rules>
    <count type="element" name="row" num="3"/>
<!--    <count type="element" name="b" num="3"/> -->
  </rules>
</pagesheet>


docs\document.xml:
<?xml version="1.0" encoding="UTF-8" ?> 
<page>
  <rowset xmlns="http://apache.org/cocoon/SQL/2.0" nrofrows="15">
    <row>
      <username>user1</username> 
      <balance>10.01</balance> 
      <status>Y</status> 
    </row>
    <row>
      <username>user2</username> 
      <balance>10.01</balance> 
      <status>Y</status> 
    </row>
...
  </rowset>
</page>

and I try:
 <a>
  <b/>
  <b/>
  <b/>
  <b/>
  <b/>
  <b/>
  <b/>
 </a>
same error.

Thanks a lot in advance for any help,
Hill

Cocoon 2.1-dev; Tomcat 4.0; JDK SDK 1.3.1; WinNT 4.0;

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message