-
Suguna Thamaraiselvan
- PowerBuilder
- Friday, 27 June 2025 12:03 PM UTC
Hi,
I am trying to add the IP Address in the XML Schema.
<xsd:complexType>
<xsd:all>
<xsd:element name="IPAddress" type="IPv4Address" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
Validation added like below.
<xsd:simpleType name="IPv4Address">
<xsd:annotation>
<xsd:documentation>
IPv4 address in dot-decimal notation. Equivalent to [0-255].[0-255].[0-255].[0-255]
On Feb 2025 Added this for IP Address and SubNetMask Validation
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:string">
<xsd:pattern value="((1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])" />
</xsd:restriction>
</xsd:simpleType>
Above Schema is working fine when the IP Address value is available. This value is not mandatory. So some xml may not have this IP Address value. In this case, when the performing XMLParseFile, I am getting error.
Please advise on this.
Thank you.
Regards,
Suguna.
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.