Class ToXml<C,​N>

    • Constructor Detail

      • ToXml

        public ToXml​(ValidatorHandler validatorHandler,
                     List<org.apache.xerces.xs.XSModel> schemaInformation)
    • Method Detail

      • getNodeNamespaceURI

        public String getNodeNamespaceURI​(N node)
        return namespace of node, if known. If not, it will be determined from the schema.
      • asSource

        public Source asSource​(C container)
        Obtain the XmlAligner as a Source that can be used as input of a Transformer.
      • startParse

        public void startParse​(C container)
                        throws SAXException
        Align the XML according to the schema.
        Throws:
        SAXException
      • getRootNode

        public abstract N getRootNode​(C container)
      • hasChild

        public abstract boolean hasChild​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                         N node,
                                         String childName)
                                  throws SAXException
        Throws:
        SAXException
      • getChildrenByName

        public abstract Iterable<N> getChildrenByName​(N node,
                                                      org.apache.xerces.xs.XSElementDeclaration childElementDeclaration)
                                               throws SAXException
        Throws:
        SAXException
      • isNil

        public abstract boolean isNil​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                      N node)
      • getText

        public abstract String getText​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                       N node)
      • getUnprocessedChildElementNames

        protected Set<String> getUnprocessedChildElementNames​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                                              N node,
                                                              Set<String> processedChildren)
                                                       throws SAXException
        Throws:
        SAXException
      • handleRootNode

        public void handleRootNode​(C container,
                                   String name,
                                   String nodeNamespace)
                            throws SAXException
        Pushes node through validator. Must push all nodes through validatorhandler, recursively, respecting the alignment request. Must set current=node before calling validatorHandler.startElement(), in order to get the right argument for the onStartElement / performAlignment callbacks.
        Throws:
        SAXException
      • handleElement

        public void handleElement​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                  N node)
                           throws SAXException
        Throws:
        SAXException
      • handleElementContents

        public void handleElementContents​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                          N node)
                                   throws SAXException
        Throws:
        SAXException
      • handleComplexTypedElement

        protected void handleComplexTypedElement​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                                 N node)
                                          throws SAXException
        Throws:
        SAXException
      • handleSimpleTypedElement

        protected void handleSimpleTypedElement​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                                org.apache.xerces.xs.XSSimpleTypeDefinition simpleTypeDefinition,
                                                N node)
                                         throws SAXException
        Throws:
        SAXException
      • processChildElement

        protected void processChildElement​(N node,
                                           String parentName,
                                           org.apache.xerces.xs.XSElementDeclaration childElementDeclaration,
                                           boolean mandatory,
                                           Set<String> processedChildren)
                                    throws SAXException
        Throws:
        SAXException
      • getBestChildElementPath

        public List<org.apache.xerces.xs.XSParticle> getBestChildElementPath​(org.apache.xerces.xs.XSElementDeclaration elementDeclaration,
                                                                             N node,
                                                                             boolean silent)
                                                                      throws SAXException
        Throws:
        SAXException
      • getBestMatchingElementPath

        public boolean getBestMatchingElementPath​(org.apache.xerces.xs.XSElementDeclaration baseElementDeclaration,
                                                  N baseNode,
                                                  org.apache.xerces.xs.XSParticle particle,
                                                  List<org.apache.xerces.xs.XSParticle> path,
                                                  List<String> failureReasons)
                                           throws SAXException
        Parameters:
        baseElementDeclaration - TODO
        particle -
        failureReasons - returns the reasons why no match was found
        path - in this list the longest list of child elements, that matches the available, is maintained. Null if no matching.
        Returns:
        true when a matching path is found. if false, failureReasons will contain reasons why.
        Throws:
        SAXException
      • getRootElement

        public String getRootElement()
      • setRootElement

        public void setRootElement​(String rootElement)
      • getTargetNamespace

        public String getTargetNamespace()
      • setTargetNamespace

        public void setTargetNamespace​(String targetNamespace)
      • isDeepSearch

        public boolean isDeepSearch()
      • setDeepSearch

        public void setDeepSearch​(boolean deepSearch)
      • isFailOnWildcards

        public boolean isFailOnWildcards()
      • setFailOnWildcards

        public void setFailOnWildcards​(boolean failOnWildcards)