cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Schmitz <jeffandmon...@mac.com>
Subject Saxon requires an XML parser that reports the QName
Date Thu, 23 Jul 2009 18:32:00 GMT
Hello,
   I've created my own AbstractSAXTransformer that works for the most part.  However, I've
recently added code to switch to a "buffering" mode when it sees a special Element (sspBuffer)
in the startElement function.  In buffering mode, it waits until it sees the special element's
matching endElement call before it issues both the super.startElement and super.endElement
calls for all elements between the special element.  Any page that doesn't have the special
tag I'm looking for is fine, however anytime I process a page with the special tag (and the
code switches to "buffering" mode), I get the below exception on the call to super.endDocument
(not on the call the startElement or endElement).  I added  debug code to see exactly what
I was using in the startElement call, both when in the special "buffer" mode and in normal
mode, and I see no difference in what ultimately is sent to super.startElement, both are providing
non-prefixed labels for the qname (raw).  Here's the output for a simple html table, where
buffering mode is switched into for the output of one empty row:

input:
<table>
   <th></th>
   <ssp:Buffer>
   <tr></tr>
   </ssp:Buffer>
</table>

Debug output:
Calling startElement with uri =  loc=table raw=table
Calling startElement with uri =  loc=th raw=th
Calling endElement with uri =  loc=th raw=th
 -------------------SWITCHED TO BUFFERINGMODE
Calling startElement with uri =   loc=tr raw=tr
Calling endElement with uri =   loc=tr raw=tr
 -----------------DONE WITH BUFFERING MODE
Calling endElement with uri =  loc=table raw=table

I'm really banging my head on this, so any help would be greatly appreciated.

Thanks,
Jeff (see exception below)



org.xml.sax.SAXException: Saxon requires an XML parser that reports the QName of each element
	at net.sf.saxon.event.ReceivingContentHandler.getNameCode(ReceivingContentHandler.java:391)
	at net.sf.saxon.event.ReceivingContentHandler.startElement(ReceivingContentHandler.java:277)
	at org.apache.cocoon.xml.AbstractXMLPipe.startElement(AbstractXMLPipe.java:95)
	at org.apache.xml.serializer.ToXMLSAXHandler.closeStartTag(ToXMLSAXHandler.java:206)
	at org.apache.xml.serializer.ToSAXHandler.flushPending(ToSAXHandler.java:279)
	at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:245)
	at org.apache.xml.dtm.ref.DTMTreeWalker.endNode(DTMTreeWalker.java:375)
	at org.apache.xalan.transformer.TreeWalker2Result.endNode(TreeWalker2Result.java:87)
	at org.apache.xml.dtm.ref.DTMTreeWalker.traverse(DTMTreeWalker.java:118)
	at org.apache.xalan.transformer.TreeWalker2Result.traverse(TreeWalker2Result.java:74)
	at org.apache.xalan.templates.ElemCopyOf.execute(ElemCopyOf.java:186)
	at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395)
	at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376)
	at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2400)
	at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2270)
	at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1356)
	at org.apache.xalan.transformer.TransformerImpl.run(TransformerImpl.java:3447)
	at org.apache.xalan.transformer.TransformerHandlerImpl.endDocument(TransformerHandlerImpl.java:408)
	at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56)
	at org.apache.cocoon.transformation.TraxTransformer.endDocument(TraxTransformer.java:586)
	at org.apache.cocoon.xml.AbstractXMLPipe.endDocument(AbstractXMLPipe.java:56)
	at org.apache.cocoon.transformation.AbstractSAXTransformer.endDocument(AbstractSAXTransformer.java:381)


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


Mime
View raw message