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