Note that there are some explanatory texts on larger screens.

plurals
  1. POxml schema attribute ref
    primarykey
    data
    text
    <p>i have this xml schema</p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xs:schema xmlns="http://hidden/abc" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://hidden/abc" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.8"&gt; &lt;xs:element name="inv_constraint"&gt; &lt;xs:complexType&gt; &lt;xs:sequence&gt; ---lots of stuff--- &lt;/xs:sequence&gt; &lt;xs:attribute name="unaryOperator"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt;Negate an entire expression.&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:enumeration value="not"&gt;&lt;/xs:enumeration&gt; &lt;xs:enumeration value="-"&gt;&lt;/xs:enumeration&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;/xs:attribute&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; </code></pre> <p>and then this xml file that uses it:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;OCL xmlns="http://hidden/abc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hidden/abc abc.XSD"&gt; ------ lots of stuff &lt;inv_constraint unaryOperator="not"&gt; &lt;property src="A1" ref="PR1"/&gt; &lt;matOperation operator="ge"&gt; &lt;value&gt;0&lt;/value&gt; &lt;/matOperation&gt; &lt;/inv_constraint&gt; </code></pre> <p>if i change the xml schema to use the attribute with ref="" like this:</p> <pre><code>... &lt;xs:attribute ref="unaryOperator"&gt;&lt;/xs:attribute&gt; &lt;/xs:complexType&gt; &lt;/xs:element&gt; &lt;xs:attribute name="unaryOperator"&gt; &lt;xs:annotation&gt; &lt;xs:documentation&gt;Negate an entire expression.&lt;/xs:documentation&gt; &lt;/xs:annotation&gt; &lt;xs:simpleType&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:enumeration value="not"&gt;&lt;/xs:enumeration&gt; &lt;xs:enumeration value="-"&gt;&lt;/xs:enumeration&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; </code></pre> <p>then my xml becomes:</p> <pre><code>&lt;inv_constraint xmlns:ns1="http://hidden/abc" ns1:unaryOperator="not"&gt; </code></pre> <p>but i want to use the ref and have my xml like</p> <pre><code> &lt;inv_constraint unaryOperator="not"&gt; </code></pre> <p>How can i do it? thank you</p>
    singulars
    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.
 

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