/** * Construct a new compositeType from XML Schema. * * @param node from the XML Schema Parsing * @param givenName for this node. * @param referencedName of the type when created from a ref in a composite. * @param compositesPath with the path of composites that represents the levels of composition. * @throws XPathExpressionException if the XPath is invalid. */ public CompositeType( final Node node, final String givenName, final String referencedName, final List<String> compositesPath) throws XPathExpressionException { super(node, givenName, referencedName); this.compositesPath.addAll(compositesPath); this.compositesPath.add(getAttributeValue(node, "name")); final XPath xPath = XPathFactory.newInstance().newXPath(); final NodeList list = (NodeList)xPath.compile(SUB_TYPES_EXP).evaluate(node, NODESET); for (int i = 0, size = list.getLength(); i < size; i++) { final Node subTypeNode = list.item(i); final String subTypeName = XmlSchemaParser.getAttributeValue(subTypeNode, "name"); processType(subTypeNode, subTypeName, null, null); } checkForValidOffsets(node); }
/** * Construct a new compositeType from XML Schema. * * @param node from the XML Schema Parsing * @param givenName for this node. * @param referencedName of the type when created from a ref in a composite. * @param compositesPath with the path of composites that represents the levels of composition. * @throws XPathExpressionException if the XPath is invalid. */ public CompositeType( final Node node, final String givenName, final String referencedName, final List<String> compositesPath) throws XPathExpressionException { super(node, givenName, referencedName); this.compositesPath.addAll(compositesPath); this.compositesPath.add(getAttributeValue(node, "name")); final XPath xPath = XPathFactory.newInstance().newXPath(); final NodeList list = (NodeList)xPath.compile(SUB_TYPES_EXP).evaluate(node, NODESET); for (int i = 0, size = list.getLength(); i < size; i++) { final Node subTypeNode = list.item(i); final String subTypeName = XmlSchemaParser.getAttributeValue(subTypeNode, "name"); processType(subTypeNode, subTypeName, null, null); } checkForValidOffsets(node); }
/** * Construct a new compositeType from XML Schema. * * @param node from the XML Schema Parsing * @param givenName for this node. * @param referencedName of the type when created from a ref in a composite. * @param compositesPath with the path of composites that represents the levels of composition. * @throws XPathExpressionException if the XPath is invalid. */ public CompositeType( final Node node, final String givenName, final String referencedName, final List<String> compositesPath) throws XPathExpressionException { super(node, givenName, referencedName); this.compositesPath.addAll(compositesPath); this.compositesPath.add(getAttributeValue(node, "name")); final XPath xPath = XPathFactory.newInstance().newXPath(); final NodeList list = (NodeList)xPath.compile(SUB_TYPES_EXP).evaluate(node, NODESET); for (int i = 0, size = list.getLength(); i < size; i++) { final Node subTypeNode = list.item(i); final String subTypeName = XmlSchemaParser.getAttributeValue(subTypeNode, "name"); processType(subTypeNode, subTypeName, null, null); } checkForValidOffsets(node); }
/** * Construct a new compositeType from XML Schema. * * @param node from the XML Schema Parsing * @throws XPathExpressionException if the XPath is invalid. */ public CompositeType(final Node node) throws XPathExpressionException { super(node); sinceVersion = Integer.parseInt(XmlSchemaParser.getAttributeValue(node, "sinceVersion", "0")); final XPath xPath = XPathFactory.newInstance().newXPath(); final NodeList list = (NodeList)xPath.compile("type").evaluate(node, XPathConstants.NODESET); for (int i = 0, size = list.getLength(); i < size; i++) { final EncodedDataType type = new EncodedDataType(list.item(i)); if (containedTypeByNameMap.get(type.name()) != null) { XmlSchemaParser.handleError(node, "composite already contains type named: " + type.name()); } else { containedTypeList.add(type); containedTypeByNameMap.put(type.name(), type); } } checkForValidOffsets(node); }