Search Results

Search found 2 results on 1 pages for 'netzwerg'.

Page 1/1 | 1 

  • XML Schema: Namespace issues when importing shared elements

    - by netzwerg
    When trying to import shared definitions from a XML Schema, I can properly reference shared types, but referencing shared elements causes validation errors. This is the schema that imports the shared definitions (example.xsd): <?xml version="1.0" encoding="UTF-8"?> <xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:shared="http://shared.com"> <xs:import namespace="http://shared.com" schemaLocation="shared.xsd"/> <xs:element name="example"> <xs:complexType> <xs:sequence> <xs:element ref="importedElement"/> <xs:element ref="importedType"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="importedElement"> <xs:complexType> <xs:sequence> <xs:element ref="shared:fooElement"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="importedType"> <xs:complexType> <xs:sequence> <xs:element name="bar" type="shared:barType"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> These are the shared definitions (shared.xsd): <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://shared.com" targetNamespace="http://shared.com"> <xs:element name="fooElement"> <xs:simpleType> <xs:restriction base="xs:integer"/> </xs:simpleType> </xs:element> <xs:simpleType name="barType"> <xs:restriction base="xs:integer"/> </xs:simpleType> </xs:schema> Now consider this XML instance: <?xml version="1.0"?> <example xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="example.xsd"> <importedElement> <fooElement>42</fooElement> </importedElement> <importedType> <bar>42</bar> </importedType> </example> When validated, the "importedType" works perfectly fine, but the "importedElement" gives the following error: Invalid content was found starting with element 'fooElement'. One of '{"http://shared.com":fooElement}' is expected I would guess that my troubles are related to namespace issues (hence the somehow misleading "got fooElement but was expecting fooElement") -- any hints on what's wrong here?

    Read the article

  • How to paint fully transparent pixels/points in P2D mode?

    - by netzwerg
    According to the Processing Reference, stroke(gray, alpha) allows to set the color and opacity of the stroke. With the default color mode, an alpha value of 255 denotes full opacity, while a value of 0 should correspond to complete transparency. While this works with the (default) JAVA2D renderer, I can't seem to paint fully transparent points in P2D mode. This code clearly renders a pixel at the center of the canvas, even though the alpha value is set to 0 (fully transparent): public class Transparency extends PApplet { @Override public void setup() { size(200, 200, P2D); } @Override public void draw() { stroke(0, 0); point(width / 2, height / 2); } public static void main(String[] args) { PApplet.main(new String[] { Transparency.class.getSimpleName() }); } } What's wrong here?

    Read the article

1