Re: [xml] Issue in using an XSD with the attribute PRECISION



On 20Feb08 14:49, Portia Dela.Rosa wrote:
}        <xs:element name="amount1" type="number16" precision="2" minOccurs="0"/>
}...
} 
} Error encountered:
}SODesc_p.xsd:48: element element: Schemas parser error : Element 
'{http://www.w3.org/2001/XMLSchema}element': The attribute 'precision' is not allowed.

According to http://www.w3.org/TR/xmlschema-1/#element-element you can
only have the attributes listed on that page unless your attribute is in another
namespace (ie. a non-schema attribute).

Within the <xs:element ... /> the default namespace has implicitly changed
to http://www.w3.org/2001/XMLSchema and therefore "precision" is an
invalid attribute in that context.

Presumably you have some other targetNamespace and default namespace
defined for this schema. You need to additionally (or instead) define a
namespace prefix for that at the top and then use that in your schema
definition. eg.

...
<xs:schema ...
    targetNamespace="http://www.oracle.com/something"; 
    xmlns="http://www.oracle.com/something"; 
    xmlns:MyThing="http://www.oracle.com/something";
...
  <xs:element name="amount1" type="number16" MyThing:precision="2" minOccurs="0"/>
...


regards,
    Callum

-- 

Callum Gibson @ home



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]