Can I validate a XML file against a xsd fragment? For example, I have a XML like:
<tag1>
<xx>...</xx>
</tag1>
And a XSD like:
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="envTeste">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="tag" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:int">
<xsd:totalDigits value="1" />
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="tag1" minOccurs="1" maxOccurs="1">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:pattern value="^\d{1,15}$"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
............................
I want to use just the fragment "name=tag1" to validade my xml. It's possible? Using JAXB?
Thanks a lot.