1

簡単な例を実行すると、理由が見つからないという警告が表示されます。

from stix.core import STIXPackage, STIXHeader   # Import the STIX Package and STIX Header APIs

stix_package = STIXPackage()                    # Create an instance of STIXPackage
stix_header = STIXHeader()                      # Create an instance of STIXHeader
stix_header.description = "Getting Started!"    # Set the description
stix_package.stix_header = stix_header          # Link the STIX Head to our STIX Package

print(stix_package.to_xml())                    # print the XML for this STIX Package

結果は

C:\Python27\Lib\site-packages\stix\utils\deprecated.py:40: UserWarning: このフィールドの使用は推奨されていません。「str」オブジェクトを受け取りました。warnings.warn(メッセージ)

<stix:STIX_Package
        xmlns:cybox="http://cybox.mitre.org/cybox-2"
        xmlns:cyboxCommon="http://cybox.mitre.org/common-2"
        xmlns:cyboxVocabs="http://cybox.mitre.org/default_vocabularies-2"
        xmlns:example="http://example.com"
        xmlns:stix="http://stix.mitre.org/stix-1"
        xmlns:stixCommon="http://stix.mitre.org/common-1"
        xmlns:stixVocabs="http://stix.mitre.org/default_vocabularies-1"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="example:Package-7e8da451-3a23-47dd-b2e1-8646200dadf0" version="1.2">
    <stix:STIX_Header>
        <stix:Description>Getting Started!</stix:Description>
    </stix:STIX_Header>
</stix:STIX_Package>

ヒントをいただければ幸いです

4

1 に答える 1