Note that there are some explanatory texts on larger screens.

plurals
  1. POGet element attributes from JAXB class
    primarykey
    data
    text
    <p>maybe I'm asking a thing that it doesn't have sense, but I have this problem:</p> <p>I have to fetch, for example, which attributes are defined for a particular element (given its name). For doing this, I should parse the schema files.</p> <p>Due to I have the JAXB classes of every element in these schemas, there's a way to obtain the same informations from the JAXB class?</p> <p>For instance, given in input the string "file_object", I have to find out that it can contains an element called "filepath" or "path" and "filename"</p> <pre><code>&lt;xsd:element name="file_object" substitutionGroup="oval-def:object"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;The file_object element is used by a file test to define the specific file(s) to be evaluated. The file_object will collect all UNIX file types (directory, regular file, character device, block device, fifo, symbolic link, and socket). Each object extends the standard ObjectType as defined in the oval-definitions-schema and one should refer to the ObjectType description for more information. The common set element allows complex objects to be created using filters and set logic. Again, please refer to the description of the set element in the oval-definitions-schema.&lt;/xsd:documentation&gt; &lt;xsd:documentation&gt;A file object defines the path and filename of the file(s). In addition, a number of behaviors may be provided that help guide the collection of objects. Please refer to the FileBehaviors complex type for more information about specific behaviors.&lt;/xsd:documentation&gt; &lt;xsd:documentation&gt;The set of files to be evaluated may be identified with either a complete filepath or a path and filename. Only one of these options may be selected.&lt;/xsd:documentation&gt; &lt;xsd:documentation&gt;It is important to note that the 'max_depth' and 'recurse_direction' attributes of the 'behaviors' element do not apply to the 'filepath' element, only to the 'path' and 'filename' elements. This is because the 'filepath' element represents an absolute path to a particular file and it is not possible to recurse over a file.&lt;/xsd:documentation&gt; &lt;xsd:appinfo&gt; &lt;sch:pattern id="unix-def_file_object_verify_filter_state"&gt; &lt;sch:rule context="unix-def:file_object//oval-def:filter"&gt; &lt;sch:let name="parent_object" value="ancestor::unix-def:file_object"/&gt; &lt;sch:let name="parent_object_id" value="$parent_object/@id"/&gt; &lt;sch:let name="state_ref" value="."/&gt; &lt;sch:let name="reffed_state" value="ancestor::oval-def:oval_definitions/oval-def:states/*[@id=$state_ref]"/&gt; &lt;sch:let name="state_name" value="local-name($reffed_state)"/&gt; &lt;sch:let name="state_namespace" value="namespace-uri($reffed_state)"/&gt; &lt;sch:assert test="(($state_namespace='http://oval.mitre.org/XMLSchema/oval-definitions-5#unix') and ($state_name='file_state'))"&gt;State referenced in filter for &lt;sch:value-of select="name($parent_object)"/&gt; '&lt;sch:value-of select="$parent_object_id"/&gt;' is of the wrong type. &lt;/sch:assert&gt; &lt;/sch:rule&gt; &lt;/sch:pattern&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;xsd:complexType&gt; &lt;xsd:complexContent&gt; &lt;xsd:extension base="oval-def:ObjectType"&gt; &lt;xsd:sequence&gt; &lt;xsd:choice&gt; &lt;xsd:element ref="oval-def:set"/&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="behaviors" type="unix-def:FileBehaviors" minOccurs="0" maxOccurs="1"/&gt; &lt;xsd:choice&gt; &lt;xsd:element name="filepath" type="oval-def:EntityObjectStringType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;The filepath element specifies the absolute path for a file on the machine. A directory cannot be specified as a filepath.&lt;/xsd:documentation&gt; &lt;xsd:appinfo&gt; &lt;sch:pattern id="unix-def_fileobjfilepath"&gt; &lt;sch:rule context="unix-def:file_object/unix-def:filepath"&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@max_depth or @recurse or @recurse_direction])"&gt;&lt;sch:value-of select="../@id"/&gt; - the max_depth, recurse, and recurse_direction behaviors are not allowed with a filepath entity&lt;/sch:assert&gt; &lt;/sch:rule&gt; &lt;/sch:pattern&gt; &lt;sch:pattern id="unix-def_fileobjfilepath2"&gt; &lt;sch:rule context="unix-def:file_object/unix-def:filepath[not(@operation='equals' or not(@operation))]"&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@recurse_file_system='defined'])"&gt;&lt;sch:value-of select="../@id"/&gt; - the recurse_file_system behavior MUST not be set to 'defined' when a pattern match is used with a filepath entity.&lt;/sch:assert&gt; &lt;/sch:rule&gt; &lt;/sch:pattern&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:sequence&gt; &lt;xsd:element name="path" type="oval-def:EntityObjectStringType"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;The path element specifies the directory component of the absolute path to a file on the machine.&lt;/xsd:documentation&gt; &lt;xsd:appinfo&gt; &lt;sch:pattern id="unix-def_fileobjpath"&gt; &lt;sch:rule context="unix-def:file_object/unix-def:path[not(@operation='equals' or not(@operation))]"&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@recurse_file_system='defined'])"&gt;&lt;sch:value-of select="../@id"/&gt; - the recurse_file_system behavior MUST not be set to 'defined' when a pattern match is used with a path entity.&lt;/sch:assert&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@max_depth])"&gt;&lt;sch:value-of select="../@id"/&gt; - the max_depth behavior MUST not be used when a pattern match is used with a path entity.&lt;/sch:assert&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@recurse_direction])"&gt;&lt;sch:value-of select="../@id"/&gt; - the recurse_direction behavior MUST not be used when a pattern match is used with a path entity.&lt;/sch:assert&gt; &lt;sch:assert test="not(preceding-sibling::unix-def:behaviors[@recurse])"&gt;&lt;sch:value-of select="../@id"/&gt; - the recurse behavior MUST not be used when a pattern match is used with a path entity.&lt;/sch:assert&gt; &lt;/sch:rule&gt; &lt;/sch:pattern&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;xsd:element name="filename" type="oval-def:EntityObjectStringType" nillable="true"&gt; &lt;xsd:annotation&gt; &lt;xsd:documentation&gt;The filename element specifies the name of a file to evaluate. If the xsi:nil attribute is set to true, then the object being specified is the higher level directory object (not all the files in the directory). In this case, the filename element should not be used during collection and would result in the unique set of items being the directories themselves. For example, one would set xsi:nil to true if the desire was to test the attributes or permissions associated with a directory. Setting xsi:nil equal to true is different than using a .* pattern match, which says to collect every file under a given path.&lt;/xsd:documentation&gt; &lt;xsd:appinfo&gt; &lt;sch:pattern id="unix-def_file_objectfilename"&gt; &lt;sch:rule context="unix-def:file_object/unix-def:filename"&gt; &lt;sch:assert test="(@var_ref and .='') or (@xsi:nil='1' or @xsi:nil='true') or not(.='') or (.='' and @operation = 'pattern match')"&gt;&lt;sch:value-of select="../@id"/&gt; - filename entity cannot be empty unless the xsi:nil attribute is set to true or a var_ref is used&lt;/sch:assert&gt; &lt;/sch:rule&gt; &lt;/sch:pattern&gt; &lt;/xsd:appinfo&gt; &lt;/xsd:annotation&gt; &lt;/xsd:element&gt; &lt;/xsd:sequence&gt; &lt;/xsd:choice&gt; &lt;xsd:element ref="oval-def:filter" minOccurs="0" maxOccurs="unbounded"/&gt; &lt;/xsd:sequence&gt; &lt;/xsd:choice&gt; &lt;/xsd:sequence&gt; &lt;/xsd:extension&gt; &lt;/xsd:complexContent&gt; &lt;/xsd:complexType&gt; &lt;/xsd:element&gt; </code></pre> <p>Thanks a lot.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload