/**
 * Copyright (C) 2014-2016 Philip Helger (www.helger.com)
 * philip[at]helger[dot]com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.helger.schematron.svrl;

import javax.annotation.concurrent.NotThreadSafe;

import org.oclc.purl.dsdl.svrl.ObjectFactory;
import org.oclc.purl.dsdl.svrl.SchematronOutputType;

import com.helger.commons.debug.GlobalDebug;
import com.helger.jaxb.AbstractJAXBMarshaller;

/**
 * This is the XML reader and write for Schematron SVRL documents. It reads XML
 * DOM documents and returns {@link SchematronOutputType} elements and vice
 * versa. The reading and writing itself is done with JAXB.<br>
 *
 * @author Philip Helger
 */
@NotThreadSafe
public class SVRLMarshaller extends AbstractJAXBMarshaller <SchematronOutputType>
{
  public SVRLMarshaller ()
  {
    super (SchematronOutputType.class, CSVRL.SVRL_XSDS, o -> new ObjectFactory ().createSchematronOutput (o));
    setWriteFormatted (GlobalDebug.isDebugMode ());
  }
}

@@ -1,16 +1,15 @@
 /**
-%0D
 %0A * Copyrigh
@@ -54,17 +54,16 @@
 ger.com)
-%0D
 %0A * phil
@@ -82,21 +82,19 @@
 %5Bdot%5Dcom
-%0D
 %0A *
-%0D
 %0A * Lice
@@ -152,17 +152,16 @@
 cense%22);
-%0D
 %0A * you 
@@ -220,17 +220,16 @@
 License.
-%0D
 %0A * You 
@@ -263,21 +263,19 @@
 cense at
-%0D
 %0A *
-%0D
 %0A *     
@@ -320,21 +320,19 @@
 ENSE-2.0
-%0D
 %0A *
-%0D
 %0A * Unle
@@ -394,17 +394,16 @@
 software
-%0D
 %0A * dist
@@ -463,17 +463,16 @@
 %22 BASIS,
-%0D
 %0A * WITH
@@ -539,17 +539,16 @@
 implied.
-%0D
 %0A * See 
@@ -610,17 +610,16 @@
 ions and
-%0D
 %0A * limi
@@ -644,22 +644,20 @@
 License.
-%0D
 %0A */
-%0D
 %0Apackage
@@ -684,19 +684,17 @@
 on.svrl;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -735,19 +735,17 @@
 eadSafe;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -782,17 +782,16 @@
 Factory;
-%0D
 %0Aimport 
@@ -835,19 +835,17 @@
 putType;
-%0D%0A%0D
+%0A
 %0Aimport 
@@ -881,17 +881,16 @@
 alDebug;
-%0D
 %0Aimport 
@@ -932,16 +932,13 @@
 ler;
-%0D%0A%0D
+%0A
 %0A/**
-%0D
 %0A * 
@@ -1013,17 +1013,16 @@
 eads XML
-%0D
 %0A * DOM 
@@ -1089,17 +1089,16 @@
 and vice
-%0D
 %0A * vers
@@ -1157,13 +1157,11 @@
 %3Cbr%3E
-%0D
 %0A *
-%0D
 %0A * 
@@ -1185,14 +1185,12 @@
 lger
-%0D
 %0A */
-%0D
 %0A@No
@@ -1200,17 +1200,16 @@
 readSafe
-%0D
 %0Apublic 
@@ -1286,12 +1286,10 @@
 ype%3E
-%0D
 %0A%7B
-%0D
 %0A  p
@@ -1315,14 +1315,12 @@
 r ()
-%0D
 %0A  %7B
-%0D
 %0A   
@@ -1354,16 +1354,42 @@
 e.class,
+%0A           false ? null :
  CSVRL.S
@@ -1397,18 +1397,29 @@
 RL_XSDS,
- o
+%0A           x
  -%3E new 
@@ -1463,13 +1463,12 @@
 ut (
-o
+x
 ));
-%0D
 %0A   
@@ -1519,14 +1519,11 @@
 ());
-%0D
 %0A  %7D
-%0D
 %0A%7D
-%0D
 %0A

Test for with XSD/without XSD