diff --git a/src/main/java/org/docx4j/jaxb/Context.java b/src/main/java/org/docx4j/jaxb/Context.java index 42e904eda5..37cd2e9d04 100644 --- a/src/main/java/org/docx4j/jaxb/Context.java +++ b/src/main/java/org/docx4j/jaxb/Context.java @@ -61,6 +61,9 @@ public class Context { public static JAXBContext jcSectionModel; public static JAXBContext jcXmlDSig; + + /** @since 3.0.1 */ + public static JAXBContext jcMCE; private static Logger log = LoggerFactory.getLogger(Context.class); @@ -157,6 +160,8 @@ public class Context { jcSectionModel = JAXBContext.newInstance("org.docx4j.model.structure.jaxb",classLoader ); jcXmlDSig = JAXBContext.newInstance("org.plutext.jaxb.xmldsig",classLoader ); + + jcMCE = JAXBContext.newInstance("org.docx4.mce",classLoader ); log.debug(".. other contexts loaded .."); diff --git a/src/main/java/org/docx4j/mce/AlternateContent.java b/src/main/java/org/docx4j/mce/AlternateContent.java index 93e17cb9db..5eb109fb46 100644 --- a/src/main/java/org/docx4j/mce/AlternateContent.java +++ b/src/main/java/org/docx4j/mce/AlternateContent.java @@ -3,17 +3,13 @@ import java.util.ArrayList; import java.util.List; -import javax.xml.bind.Unmarshaller; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAnyElement; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlTransient; import javax.xml.bind.annotation.XmlType; -import org.jvnet.jaxb2_commons.ppp.Child; -import org.w3c.dom.Element; /** @@ -26,14 +22,17 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <element name="Choice" maxOccurs="unbounded"> + * <element name="Choice" maxOccurs="unbounded" minOccurs="0"> * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <any processContents='skip' maxOccurs="unbounded"/> + * <any maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <attribute name="Requires" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}MustUnderstand"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}ProcessContent"/> * </restriction> * </complexContent> * </complexType> @@ -43,13 +42,19 @@ * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <any processContents='skip' maxOccurs="unbounded"/> + * <any maxOccurs="unbounded" minOccurs="0"/> * </sequence> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}MustUnderstand"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}ProcessContent"/> * </restriction> * </complexContent> * </complexType> * </element> * </sequence> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}MustUnderstand"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}ProcessContent"/> * </restriction> * </complexContent> * </complexType> @@ -63,16 +68,18 @@ "fallback" }) @XmlRootElement(name = "AlternateContent") -public class AlternateContent - implements Child -{ +public class AlternateContent { - @XmlElement(name = "Choice", required = true) + @XmlElement(name = "Choice") protected List choice; @XmlElement(name = "Fallback") protected AlternateContent.Fallback fallback; - @XmlTransient - private Object parent; + @XmlAttribute(name = "Ignorable", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String ignorable; + @XmlAttribute(name = "MustUnderstand", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String mustUnderstand; + @XmlAttribute(name = "ProcessContent", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String processContent; /** * Gets the value of the choice property. @@ -128,29 +135,75 @@ public void setFallback(AlternateContent.Fallback value) { } /** - * Gets the parent object in the object tree representing the unmarshalled xml document. + * Gets the value of the ignorable property. * * @return - * The parent object. + * possible object is + * {@link String } + * */ - public Object getParent() { - return this.parent; + public String getIgnorable() { + return ignorable; } - public void setParent(Object parent) { - this.parent = parent; + /** + * Sets the value of the ignorable property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIgnorable(String value) { + this.ignorable = value; + } + + /** + * Gets the value of the mustUnderstand property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getMustUnderstand() { + return mustUnderstand; } /** - * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. + * Sets the value of the mustUnderstand property. * - * @param parent - * The parent object in the object tree. - * @param unmarshaller - * The unmarshaller that generated the instance. + * @param value + * allowed object is + * {@link String } + * */ - public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { - setParent(parent); + public void setMustUnderstand(String value) { + this.mustUnderstand = value; + } + + /** + * Gets the value of the processContent property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProcessContent() { + return processContent; + } + + /** + * Sets the value of the processContent property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProcessContent(String value) { + this.processContent = value; } @@ -164,9 +217,12 @@ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <any processContents='skip' maxOccurs="unbounded"/> + * <any maxOccurs="unbounded" minOccurs="0"/> * </sequence> * <attribute name="Requires" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}MustUnderstand"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}ProcessContent"/> * </restriction> * </complexContent> * </complexType> @@ -178,16 +234,18 @@ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { @XmlType(name = "", propOrder = { "any" }) - public static class Choice - implements Child - { + public static class Choice { - @XmlAnyElement - protected List any; + @XmlAnyElement(lax = true) + protected List any; @XmlAttribute(name = "Requires", required = true) protected String requires; - @XmlTransient - private Object parent; + @XmlAttribute(name = "Ignorable", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String ignorable; + @XmlAttribute(name = "MustUnderstand", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String mustUnderstand; + @XmlAttribute(name = "ProcessContent", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String processContent; /** * Gets the value of the any property. @@ -207,13 +265,13 @@ public static class Choice * *

* Objects of the following type(s) are allowed in the list - * {@link Element } + * {@link Object } * * */ - public List getAny() { + public List getAny() { if (any == null) { - any = new ArrayList(); + any = new ArrayList(); } return this.any; } @@ -243,29 +301,75 @@ public void setRequires(String value) { } /** - * Gets the parent object in the object tree representing the unmarshalled xml document. + * Gets the value of the ignorable property. * * @return - * The parent object. + * possible object is + * {@link String } + * */ - public Object getParent() { - return this.parent; + public String getIgnorable() { + return ignorable; } - public void setParent(Object parent) { - this.parent = parent; + /** + * Sets the value of the ignorable property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIgnorable(String value) { + this.ignorable = value; } /** - * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. + * Gets the value of the mustUnderstand property. * - * @param parent - * The parent object in the object tree. - * @param unmarshaller - * The unmarshaller that generated the instance. + * @return + * possible object is + * {@link String } + * + */ + public String getMustUnderstand() { + return mustUnderstand; + } + + /** + * Sets the value of the mustUnderstand property. + * + * @param value + * allowed object is + * {@link String } + * */ - public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { - setParent(parent); + public void setMustUnderstand(String value) { + this.mustUnderstand = value; + } + + /** + * Gets the value of the processContent property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProcessContent() { + return processContent; + } + + /** + * Sets the value of the processContent property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setProcessContent(String value) { + this.processContent = value; } } @@ -281,8 +385,11 @@ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <sequence> - * <any processContents='skip' maxOccurs="unbounded"/> + * <any maxOccurs="unbounded" minOccurs="0"/> * </sequence> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}Ignorable"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}MustUnderstand"/> + * <attribute ref="{http://schemas.openxmlformats.org/markup-compatibility/2006}ProcessContent"/> * </restriction> * </complexContent> * </complexType> @@ -294,14 +401,16 @@ public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { @XmlType(name = "", propOrder = { "any" }) - public static class Fallback - implements Child - { + public static class Fallback { - @XmlAnyElement - protected List any; - @XmlTransient - private Object parent; + @XmlAnyElement(lax = true) + protected List any; + @XmlAttribute(name = "Ignorable", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String ignorable; + @XmlAttribute(name = "MustUnderstand", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String mustUnderstand; + @XmlAttribute(name = "ProcessContent", namespace = "http://schemas.openxmlformats.org/markup-compatibility/2006") + protected String processContent; /** * Gets the value of the any property. @@ -321,41 +430,87 @@ public static class Fallback * *

* Objects of the following type(s) are allowed in the list - * {@link Element } + * {@link Object } * * */ - public List getAny() { + public List getAny() { if (any == null) { - any = new ArrayList(); + any = new ArrayList(); } return this.any; } /** - * Gets the parent object in the object tree representing the unmarshalled xml document. + * Gets the value of the ignorable property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getIgnorable() { + return ignorable; + } + + /** + * Sets the value of the ignorable property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setIgnorable(String value) { + this.ignorable = value; + } + + /** + * Gets the value of the mustUnderstand property. * * @return - * The parent object. + * possible object is + * {@link String } + * */ - public Object getParent() { - return this.parent; + public String getMustUnderstand() { + return mustUnderstand; } - public void setParent(Object parent) { - this.parent = parent; + /** + * Sets the value of the mustUnderstand property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setMustUnderstand(String value) { + this.mustUnderstand = value; + } + + /** + * Gets the value of the processContent property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getProcessContent() { + return processContent; } /** - * This method is invoked by the JAXB implementation on each instance when unmarshalling completes. + * Sets the value of the processContent property. * - * @param parent - * The parent object in the object tree. - * @param unmarshaller - * The unmarshaller that generated the instance. + * @param value + * allowed object is + * {@link String } + * */ - public void afterUnmarshal(Unmarshaller unmarshaller, Object parent) { - setParent(parent); + public void setProcessContent(String value) { + this.processContent = value; } } diff --git a/xsd/mce/markup-compatibility-2006-MINIMAL.xsd b/xsd/mce/markup-compatibility-2006-MINIMAL.xsd index 1c404f61cf..0a84feda90 100644 --- a/xsd/mce/markup-compatibility-2006-MINIMAL.xsd +++ b/xsd/mce/markup-compatibility-2006-MINIMAL.xsd @@ -1,21 +1,30 @@ - - @@ -30,8 +39,57 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file