2
私のDBにおける文字列の最長値はXSDの文字列データ型のmaxLength制限は、エンコード前またはエンコード後のデータに基づいていますか?
"ABC<DEF"
は、XSDでこの文字列データ型のmaxLengthの制限7(プリコーディング)であるべきか、10(ポストエンコーディング)であるべきである場合、すなわち
"ABC<DEF"
私のDBにおける文字列の最長値はXSDの文字列データ型のmaxLength制限は、エンコード前またはエンコード後のデータに基づいていますか?
"ABC<DEF"
は、XSDでこの文字列データ型のmaxLengthの制限7(プリコーディング)であるべきか、10(ポストエンコーディング)であるべきである場合、すなわち
"ABC<DEF"
短い答え:プリエンコード。
XMLの文字をエンコードしても、文字列の「実際の」長さの値には影響しません。
クイックテスト:
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="root">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:schema>
有効なXML :)
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<!-- Sample XML generated by QTAssistant (http://www.paschidev.com) -->
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/XMLSchema.xsd">&1</root>