private void doInclude(final URL url, final XsdAtom xsdAtom, final XsltX xsltX) throws IOException { final Collection<Element> children = ElementU.getChildren(xsdAtom.getElement(), XsdU.INCLUDE); for (final Element child : children) { final String schemaLocation = ElementU.getAttribute(child, XsdU.SCHEMA_LOCATION); final URL urlInclude = URLCodec.resolve(url, schemaLocation); add(null, urlInclude, xsltX); } }
private void doImport(final URL url, final XsdAtom xsdAtom, final XsltX xsltX) throws IOException { final Collection<Element> children = ElementU.getChildren(xsdAtom.getElement(), XsdU.IMPORT); for (final Element child : children) { final String namespace = ElementU.getAttribute(child, XsdU.NAMESPACE); final String schemaLocation = ElementU.getAttribute(child, XsdU.SCHEMA_LOCATION); final URL urlImport = URLCodec.resolve(url, schemaLocation); add(namespace, urlImport, xsltX); } }
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops") private XedCursor findChildElement( final Element child, final XedCursor cursorParent, final XedCursor cursorType) { final Xed xed = cursorParent.getXed(); final Element elementParent = cursorParent.getElement(); final TypeInstance typeInstance = cursorType.getTypeInstance(); XedCursor cursor = new XedCursor(xed, cursorType, null, null, typeInstance); final Collection<Element> children = ElementU.getChildren(elementParent, typeInstance.getName()); int ordinal = -1; for (final Element childIt : children) { ++ordinal; if (childIt.equals(child)) { cursor = new XedCursor(xed, cursorType, childIt, ordinal, typeInstance); break; } } return cursor; }