Cześć.
Mam taki problem "could not find schema information for the attribute" wygląda na to że parser nie widzi attrybutu w pliku xsd, mimo że ten sie tam znajduje.
<?xml version="1.0"?>
<config
xmlns="http://myapplication.pl"
schemaLocation="http://myapplication.pl schema.xsd">
<metadata>
<title>UP</title>
<desciption>Acces rules for UP link.</desciption>
<version>1.0</version>
</metadata>
<link name="UP" server="production">
<condition id="1">
<and>
<or>
<not><attribute name="userInformation.usorganizationcode" source="session" value="UP" /></not>
<attribute name="userInformation.uid" source="session" value="user1" />
<attribute name="userInformation.uid" source="session" value="user2" />
<attribute name="userInformation.uid" source="session" value="user3" />
<attribute name="userInformation.uid" source="session" value="user4" />
</or>
<and>
<attribute name="userInformation.uid" source="session" value="XI00089" />
<or>
<attribute name="env.isValidation" source="session" value="true" />
<attribute name="env.isCollaudo" source="session" value="true" />
</or>
</and>
<group name="userInformation.uid" in="DEVELOPERS"/>
</and>
</condition>
<condition id="2">
</condition>
</link>
</config>
mój plik xsd wygląda mniej wiecej tak
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns="http://www.w3schools.com" elementFormDefault="qualified" targetNamespace="http://www.w3schools.com" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="config">
<xs:complexType>
<xs:sequence>
<xs:element ref="metadata" minOccurs="0" maxOccurs="1"/>
<xs:element ref="link" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="server" type="xs:string"/>
</xs:complexType>
</xs:element>
<!--definition for attribute node -->
<xs:element name="metadata">
<xs:complexType>
<xs:sequence>
<xs:element name="title" type="xs:string"/>
<xs:element name="desciption" type="xs:string"/>
<xs:element name="version" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!--definition for attribute node -->
<xs:element name="link">
<xs:complexType>
<xs:sequence>
<xs:element ref="condition" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="server" type="xs:string"/>
</xs:complexType>
</xs:element>
<!--condition -->
<xs:element name="condition">
<xs:complexType>
<xs:choice>
<xs:element ref="not"/>
<xs:element ref="and"/>
<xs:element ref="or"/>
</xs:choice>
<xs:attribute name="id" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<!--group element -->
<xs:element name="group">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="in" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
<!-- not -->
<xs:element name="not">
<xs:complexType>
<xs:choice>
<xs:element ref="and" />
<xs:element ref="not" />
<xs:element ref="or" />
<xs:element ref="attribute"/>
</xs:choice>
</xs:complexType>
</xs:element>
<!-- and -->
<xs:element name="and">
<xs:complexType>
<xs:sequence>
<xs:element ref="and" minOccurs="0"/>
<xs:element ref="not" minOccurs="0"/>
<xs:element ref="or" minOccurs="0"/>
<xs:element ref="attribute" minOccurs="0"/>
<xs:element ref="group" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- or -->
<xs:element name="or">
<xs:complexType>
<xs:sequence>
<xs:element ref="and" minOccurs="0"/>
<xs:element ref="not" minOccurs="0"/>
<xs:element ref="or" minOccurs="0"/>
<xs:element ref="attribute" minOccurs="0"/>
<xs:element ref="group" maxOccurs="1"/>
<xs:element ref="group" maxOccurs="1"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- attribute -->
<xs:element name="attribute">
<xs:complexType>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="source" type="xs:string" use="required"/>
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>
</xs:element>
</xs:schema>
P.S. wie ktoś może jak w xsd zrobić zeby element mógl zawierać dowolny z zdefiniowanych podelementów w dowolnej kolejnosci i dowolnej ilości.
coś ala
<sequence>
<element name="" type="" />
<element ref="" />
</sequence>
z tym że może sie zdarzyc tak ze będzie tylko jeden z nich lub bedą w odwrotnej kolejnosci, lub będą oba występowac wielokrotnie i pomieszane :)