用于创建Person的输入(如果PersonID不存在,那么它是用于创建新Person的输入,因此输入应包含其他四个。)
# Load the .NET assembly
Add-Type -Assembly 'System.IO.Compression.FileSystem'
# Must be used for relative file locations with .NET functions instead of Set-Location:
[System.IO.Directory]::SetCurrentDirectory('.\Desktop')
# Create the zip file and open it:
$z = [System.IO.Compression.ZipFile]::Open('z.zip', [System.IO.Compression.ZipArchiveMode]::Create)
# Add a compressed file to the zip file:
[System.IO.Compression.ZipFileExtensions]::CreateEntryFromFile($z, 't.txt', 't.txt')
# Close the file
$z.Dispose()
用于更新Person的输入(如果它具有PersonID,则它将作为更新的输入,并且输入应至少包含其他四个中的一个以及PersonID。)
<Input xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Person>
<FirstName>First Name</FirstName>
<LastName>Last Name</LastName>
<Phone>1234567890</Phone>
<Email>username@domain.com</Email>
</Person>
</Input>
如何编写单个XSD以基于PersonID验证输入?
谢谢。