我正在使用XML spy從XSD自動生成XML文件。然而,它似乎總是在我的根元素前加上n1:或n2:例如它將以下從XSD生成XML文件在根節點上導致不需要的前綴
<?xml version="1.0"?>
<n2:EmployeeData>
<Employee>
<name>xyz</name>
<dateOfBirth>10.10.10</dateOfBirth>
<email>[email protected]</email>
</Employee>
</n2:EmployeeData>
我想它生成以下產生類似到:
<?xml version="1.0"?>
<EmployeeData>
<Employee>
<name>xyz</name>
<dateOfBirth>10.10.10</dateOfBirth>
<email>[email protected]</email>
</Employee>
</EmployeeData>
你的第一個例子是無效的XML,它不會生成這個。必須定義'ns2'前綴。 – skaffman