Search in sources :

Example 11 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project ph-schematron by phax.

the class PSInclude method getAsMicroElement.

@Nonnull
public IMicroElement getAsMicroElement() {
    final IMicroElement ret = new MicroElement(CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_INCLUDE);
    ret.setAttribute(CSchematronXML.ATTR_HREF, m_sHref);
    return ret;
}
Also used : IMicroElement(com.helger.xml.microdom.IMicroElement) MicroElement(com.helger.xml.microdom.MicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) Nonnull(javax.annotation.Nonnull)

Example 12 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project ph-schematron by phax.

the class PSName method getAsMicroElement.

@Nonnull
public IMicroElement getAsMicroElement() {
    final IMicroElement ret = new MicroElement(CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_NAME);
    ret.setAttribute(CSchematronXML.ATTR_PATH, m_sPath);
    if (m_aForeignAttrs != null)
        for (final Map.Entry<String, String> aEntry : m_aForeignAttrs.entrySet()) ret.setAttribute(aEntry.getKey(), aEntry.getValue());
    return ret;
}
Also used : MicroElement(com.helger.xml.microdom.MicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) Nonnull(javax.annotation.Nonnull)

Example 13 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project ph-schematron by phax.

the class PSP method getAsMicroElement.

@Nonnull
public IMicroElement getAsMicroElement() {
    final IMicroElement ret = new MicroElement(CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_P);
    ret.setAttribute(CSchematronXML.ATTR_ID, m_sID);
    ret.setAttribute(CSchematronXML.ATTR_CLASS, m_sClass);
    ret.setAttribute(CSchematronXML.ATTR_ICON, m_sIcon);
    if (m_aForeignElements != null)
        for (final IMicroElement aForeignElement : m_aForeignElements) ret.appendChild(aForeignElement.getClone());
    for (final Object aContent : m_aContent) if (aContent instanceof String)
        ret.appendText((String) aContent);
    else
        ret.appendChild(((IPSElement) aContent).getAsMicroElement());
    if (m_aForeignAttrs != null)
        for (final Map.Entry<String, String> aEntry : m_aForeignAttrs.entrySet()) ret.setAttribute(aEntry.getKey(), aEntry.getValue());
    return ret;
}
Also used : MicroElement(com.helger.xml.microdom.MicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) Nonnull(javax.annotation.Nonnull)

Example 14 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project ph-schematron by phax.

the class PSRule method getAsMicroElement.

@Nonnull
public IMicroElement getAsMicroElement() {
    final IMicroElement ret = new MicroElement(CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_RULE);
    ret.setAttribute(CSchematronXML.ATTR_FLAG, m_sFlag);
    if (m_bAbstract)
        ret.setAttribute(CSchematronXML.ATTR_ABSTRACT, "true");
    ret.setAttribute(CSchematronXML.ATTR_CONTEXT, m_sContext);
    ret.setAttribute(CSchematronXML.ATTR_ID, m_sID);
    if (m_aRich != null)
        m_aRich.fillMicroElement(ret);
    if (m_aLinkable != null)
        m_aLinkable.fillMicroElement(ret);
    if (m_aForeignElements != null)
        for (final IMicroElement aForeignElement : m_aForeignElements) ret.appendChild(aForeignElement.getClone());
    for (final PSInclude aInclude : m_aIncludes) ret.appendChild(aInclude.getAsMicroElement());
    for (final PSLet aLet : m_aLets) ret.appendChild(aLet.getAsMicroElement());
    for (final IPSElement aContent : m_aContent) ret.appendChild(aContent.getAsMicroElement());
    if (m_aForeignAttrs != null)
        for (final Map.Entry<String, String> aEntry : m_aForeignAttrs.entrySet()) ret.setAttribute(aEntry.getKey(), aEntry.getValue());
    return ret;
}
Also used : MicroElement(com.helger.xml.microdom.MicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) Nonnull(javax.annotation.Nonnull)

Example 15 with IMicroElement

use of com.helger.xml.microdom.IMicroElement in project ph-schematron by phax.

the class PSSchema method getAsMicroElement.

@Nonnull
public IMicroElement getAsMicroElement() {
    final IMicroElement ret = new MicroElement(CSchematron.NAMESPACE_SCHEMATRON, CSchematronXML.ELEMENT_SCHEMA);
    ret.setAttribute(CSchematronXML.ATTR_ID, m_sID);
    if (m_aRich != null)
        m_aRich.fillMicroElement(ret);
    ret.setAttribute(CSchematronXML.ATTR_SCHEMA_VERSION, m_sSchemaVersion);
    ret.setAttribute(CSchematronXML.ATTR_DEFAULT_PHASE, m_sDefaultPhase);
    ret.setAttribute(CSchematronXML.ATTR_QUERY_BINDING, m_sQueryBinding);
    if (m_aForeignElements != null)
        for (final IMicroElement aForeignElement : m_aForeignElements) ret.appendChild(aForeignElement.getClone());
    for (final PSInclude aInclude : m_aIncludes) ret.appendChild(aInclude.getAsMicroElement());
    if (m_aTitle != null)
        ret.appendChild(m_aTitle.getAsMicroElement());
    for (final PSNS aNS : m_aNSs) ret.appendChild(aNS.getAsMicroElement());
    for (final PSP aP : m_aStartPs) ret.appendChild(aP.getAsMicroElement());
    for (final PSLet aLet : m_aLets) ret.appendChild(aLet.getAsMicroElement());
    for (final PSPhase aPhase : m_aPhases) ret.appendChild(aPhase.getAsMicroElement());
    for (final PSPattern aPattern : m_aPatterns) ret.appendChild(aPattern.getAsMicroElement());
    for (final PSP aP : m_aEndPs) ret.appendChild(aP.getAsMicroElement());
    if (m_aDiagnostics != null)
        ret.appendChild(m_aDiagnostics.getAsMicroElement());
    if (m_aForeignAttrs != null)
        for (final Map.Entry<String, String> aEntry : m_aForeignAttrs.entrySet()) ret.setAttribute(aEntry.getKey(), aEntry.getValue());
    return ret;
}
Also used : MicroElement(com.helger.xml.microdom.MicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) IMicroElement(com.helger.xml.microdom.IMicroElement) Nonnull(javax.annotation.Nonnull)

Aggregations

IMicroElement (com.helger.xml.microdom.IMicroElement)41 Nonnull (javax.annotation.Nonnull)30 MicroElement (com.helger.xml.microdom.MicroElement)18 IMicroDocument (com.helger.xml.microdom.IMicroDocument)7 OpenAS2Exception (com.helger.as2lib.exception.OpenAS2Exception)3 IReadableResource (com.helger.commons.io.resource.IReadableResource)3 File (java.io.File)3 CommandResult (com.helger.as2.cmd.CommandResult)2 XMLPartnershipFactory (com.helger.as2lib.partner.xml.XMLPartnershipFactory)2 CommonsArrayList (com.helger.commons.collection.impl.CommonsArrayList)2 IMicroNode (com.helger.xml.microdom.IMicroNode)2 MicroDocument (com.helger.xml.microdom.MicroDocument)2 Partnership (com.helger.as2lib.partner.Partnership)1 Partner (com.helger.as2lib.partner.xml.Partner)1 IMessageProcessor (com.helger.as2lib.processor.IMessageProcessor)1 ValueEnforcer (com.helger.commons.ValueEnforcer)1 Nonempty (com.helger.commons.annotation.Nonempty)1 ICommonsList (com.helger.commons.collection.impl.ICommonsList)1 DefaultHierarchyVisitorCallback (com.helger.commons.hierarchy.visit.DefaultHierarchyVisitorCallback)1 EHierarchyVisitorReturn (com.helger.commons.hierarchy.visit.EHierarchyVisitorReturn)1