Anindita,
The exception occurs because somebody sets an indentation size of 0 on the Saxon serializer, and Saxon rejects it (I alread mentioned this on the Saxon mailing-list - it should support a value of 0...). This new restriction happened at some point when we upgraded from an older serializer to the Saxon serializer.
This said, the reason this serializer is used with an indentation level of 0 is because your custom processor is calling:
TransformerUtils.getXMLIdentityTransformer();
I am curious about why this method is used. I think it should only be used internally. But you can use the following method:
TransformerUtils.getIdentityTransformer();
And then use:
TransformerUtils.applyOutputProperties(...);
To set the correct transformation properties on it, or just do something like:
transformer.setOutputProperty("encoding", "utf-8");
transformer.setOutputProperty("method", "xml");
transformer.setOutputProperty("version", "1.0");
transformer.setOutputProperty("indent", "yes");
transformer.setOutputProperty("{http://saxon.sf.net/}indent-spaces", "1");I would recommend against using the Saxon-specific extension if possible, because if we change serializers one day your code won't work anymore. So if you can avoid specifying the indentation for your particular purpose, you should probably do it.
-Erik
Anindita Goswami wrote:
Hi,
I am migrating from oxf v2.6 to 2.7. I have replaced the old jar files with the new ones. I did not make any other change, While displaying the xforms page it is throwing the following error:
*Type* class java.lang.IllegalArgumentException
*Message* Value of {{http://saxon.sf.net/}indent-s...} must be a positive integer
*Stack Trace* java.lang.IllegalArgumentException: Value of {{http://saxon.sf.net/}indent-s...} must be a positive integer
at org.orbeon.saxon.Controller.setOutputProperty(Controller.java:239)
at org.orbeon.oxf.xml.TransformerUtils.applyXMLOutputProperties(TransformerUtils.java:164)
at org.orbeon.oxf.xml.TransformerUtils.getXMLIdentityTransformer(TransformerUtils.java:152)
at com.csc.nbp.info.GetInstance.generateGetInstance(GetInstance.java:79)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java(Compiled Code))
at java.lang.reflect.Method.invoke(Method.java(Compiled Code))
at org.orbeon.oxf.processor.SimpleProcessor$1.readImpl(SimpleProcessor.java:70)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1106)
at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:340)
at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$000(PipelineProcessor.java:61)
at org.orbeon.oxf.processor.pipeline.PipelineProcessor$2.run(PipelineProcessor.java:97)
at org.orbeon.oxf.processor.ProcessorImpl.executeChildren(ProcessorImpl.java:505)
at org.orbeon.oxf.processor.pipeline.PipelineProcessor.access$100(PipelineProcessor.java:61)
at org.orbeon.oxf.processor.pipeline.PipelineProcessor$1.readImpl(PipelineProcessor.java:95)
at org.orbeon.oxf.processor.ProcessorImpl$6.read(ProcessorImpl.java:945)
at org.orbeon.oxf.processor.ProcessorImpl$ProcessorOutputImpl.read(ProcessorImpl.java:1106)
at org.orbeon.oxf.processor.ProcessorImpl.readInputAsSAX(ProcessorImpl.java:340)
I am having saxon-6_5_2 and saxon-8_1_1_orbeon in my lib. Any clue why it is happening? And what are the steps I should follow for this upgradation?
Thanks Anindita
------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ orbeon-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/orbeon-user
