@@ -332,6 +332,9 @@ public class Application {
332
332
<listitem >
333
333
<para ><link linkend =" oxm-xmlbeans-xsd" ><literal >xmlbeans-marshaller</literal ></link ></para >
334
334
</listitem >
335
+ <listitem >
336
+ <para ><link linkend =" oxm-castor-xsd" ><literal >castor-marshaller</literal ></link ></para >
337
+ </listitem >
335
338
<listitem >
336
339
<para ><link linkend =" oxm-jibx-xsd" ><literal >jibx-marshaller</literal ></link ></para >
337
340
</listitem >
@@ -475,6 +478,86 @@ public class Application {
475
478
</bean>
476
479
</beans>
477
480
]]> </programlisting >
481
+ <section xml : id =" oxm-castor-xsd" >
482
+ <title >XML Schema-based Configuration</title >
483
+ <para >
484
+ The <literal >castor-marshaller</literal > tag configures a
485
+ <classname >org.springframework.oxm.castor.CastorMarshaller</classname >.
486
+ Here is an example:
487
+ </para >
488
+
489
+ <programlisting language =" xml" >
490
+ <![CDATA[ <oxm:castor-marshaller id="marshaller" mapping-location="classpath:org/springframework/oxm/castor/mapping.xml"/>]]> </programlisting >
491
+
492
+ <para >
493
+ The marshaller instance can be configured in two ways, by specifying either the location of
494
+ a mapping file (through the <property >mapping-location</property > property), or by
495
+ identifying Java POJOs (through the <property >target-class</property > or
496
+ <property >target-package</property > properties) for which there exist corresponding
497
+ XML descriptor classes. The latter way is usually used in conjunction with XML code generation
498
+ from XML schemas.
499
+ </para >
500
+
501
+ <para >
502
+ Available attributes are:
503
+ <informaltable >
504
+ <tgroup cols =" 3" >
505
+ <colspec colwidth =" 1.5*" />
506
+ <colspec colwidth =" 4*" />
507
+ <colspec colwidth =" 1*" />
508
+ <thead >
509
+ <row >
510
+ <entry >Attribute</entry >
511
+ <entry >Description</entry >
512
+ <entry >Required</entry >
513
+ </row >
514
+ </thead >
515
+ <tbody >
516
+ <row >
517
+ <entry >
518
+ <literal >id</literal >
519
+ </entry >
520
+ <entry >the id of the marshaller</entry >
521
+ <entry >no</entry >
522
+ </row >
523
+ <row >
524
+ <entry >
525
+ <literal >encoding</literal >
526
+ </entry >
527
+ <entry >the encoding to use for unmarshalling from XML</entry >
528
+ <entry >no</entry >
529
+ </row >
530
+ <row >
531
+ <entry >
532
+ <literal >target-class</literal >
533
+ </entry >
534
+ <entry >a Java class name for a POJO for which an XML class descriptor is available (as
535
+ generated through code generation)
536
+ </entry >
537
+ <entry >no</entry >
538
+ </row >
539
+ <row >
540
+ <entry >
541
+ <literal >target-package</literal >
542
+ </entry >
543
+ <entry >a Java package name that identifies a package that contains POJOs and their
544
+ corresponding Castor
545
+ XML descriptor classes (as generated through code generation from XML schemas)
546
+ </entry >
547
+ <entry >no</entry >
548
+ </row >
549
+ <row >
550
+ <entry >
551
+ <literal >mapping-location</literal >
552
+ </entry >
553
+ <entry >location of a Castor XML mapping file</entry >
554
+ <entry >no</entry >
555
+ </row >
556
+ </tbody >
557
+ </tgroup >
558
+ </informaltable >
559
+ </para >
560
+ </section >
478
561
</section >
479
562
</section >
480
563
0 commit comments