Veröffentlicht 21. März 200520 j hallo. ich steh hier bissl auf m schlauch! soll eine xml und xsd für folgende anforderung erstellen. eine xml file zum verschicken von geographischen daten. geographische daten sind: Kreise { x-koord y-koord min-höhe max-höhe radius } Polygon { x-koord y-koord x-koord ykoord x-koord y-koord x-koord y-koord ..... min-höhe max-höhe } anm: Polygon mind 3 koordinaten, aber beliebig viele Kreis: radius > 0 in einer xml-file sind beliebig viele Kreise und Polygone in beliebiger Reihenfolge. also, wie die xml-file [idee s. anhang] aussehen muss, dass kann ich mir schon noch vorstellen. aber dann diese xsd-sache.... is irgendwie zu hoch für mich... danke für alles was mich weiterbringt... bigredeyes <?xml version="1.0" encoding="UTF-8"?> <content> <Poly> <Points> <Pointx>16</Pointx> <Pointy>787</Pointy> <Pointx>35</Pointx> <Pointy>75</Pointy> <Pointx>52</Pointx> <Pointy>95</Pointy> <Pointx>578</Pointx> <Pointy>456</Pointy> <Pointx>55</Pointx> <Pointy>45</Pointy> </Points> <Heights> <Min>110</Min> <Max>150</Max> </Heights> </Poly> <Kreis> <Point> <Pointx>555</Pointx> <Pointy>666</Pointy> </Point> <Radius>290</Radius> <Heights> <Min>112</Min> <Max>665</Max> </Heights> </Kreis> </content> [/PHP] p.s. habe smlspy prof. trial und EditiX trial sowie visual studio 2003 .Net
21. März 200520 j <?xml version="1.0" encoding="UTF-8"?> <content> <Poly> <Points> <Point> <Pointx>16</Pointx> <Pointy>787</Pointy> </Point> <Point> <Pointx>35</Pointx> <Pointy>75</Pointy> </Point> ... </Points> <Heights> <Min>110</Min> <Max>150</Max> </Heights> </Poly> <Kreis> <Point> <Pointx>555</Pointx> <Pointy>666</Pointy> </Point> <Radius>290</Radius> <Heights> <Min>112</Min> <Max>665</Max> </Heights> </Kreis> </content> [/PHP] Ich würde die einzelnen Points im Poly nochmal in einen Point verpacken, macht es möglich zu jeder x-Koordinate die richtige y-Koordinate zuzuordnen. gruss markus
21. März 200520 j Du willst eine DTD schreiben, keine XSD oder? Falls du doch eine XSD schreiben willst, wie soll das Ergebnis denn aussehen, in das du transformieren willst?
21. März 200520 j Du willst eine DTD schreiben, keine XSD oder? Falls du doch eine XSD schreiben willst, wie soll das Ergebnis denn aussehen, in das du transformieren willst? Omg, du willst doch eine XSD schreiben,.. Hab das grad mit XSL verwechselt :hells: anbei ein beispiel XSD: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="project"> <xs:complexType> <xs:choice maxOccurs="unbounded"> <xs:element ref="generateClasses"/> <xs:element ref="generateSchema"/> </xs:choice> <xs:attribute name="name" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> <xs:element name="generateClasses"> <xs:complexType> <xs:sequence> <xs:element ref="schemaFile"/> <xs:element ref="author"/> <xs:element ref="packageName"/> <xs:element ref="version"/> <xs:element ref="classGenerator"/> </xs:sequence> <xs:attribute name="copyRuntime" use="optional" type="xs:boolean"/> </xs:complexType> </xs:element> <xs:element name="schemaFile" type="xs:NCName"/> <xs:element name="author" type="xs:string"/> <xs:element name="packageName" type="xs:string"/> <xs:element name="version" type="xs:decimal"/> <xs:element name="classGenerator"> <xs:complexType> <xs:sequence> <xs:element ref="outputDir"/> </xs:sequence> <xs:attribute name="addComments" use="optional" type="xs:boolean"/> <xs:attribute name="addGetters" use="optional" type="xs:boolean"/> <xs:attribute name="addSetters" use="optional" type="xs:boolean"/> <xs:attribute name="seperateFiles" use="optional" type="xs:boolean"/> </xs:complexType> </xs:element> <xs:element name="outputDir" type="xs:string"/> <xs:element name="generateSchema"> <xs:complexType> <xs:sequence> <xs:element ref="connect"/> </xs:sequence> <xs:attribute name="output" use="required" type="xs:NCName"/> </xs:complexType> </xs:element> <xs:element name="connect"> <xs:complexType> <xs:sequence> <xs:element maxOccurs="unbounded" ref="database"/> </xs:sequence> <xs:attribute name="host" use="required" type="xs:NCName"/> <xs:attribute name="password" use="required" type="xs:string"/> <xs:attribute name="user" use="required" type="xs:string"/> </xs:complexType> </xs:element> <xs:element name="database" type="xs:NCName"/> </xs:schema>
21. März 200520 j Ich würde die Struktur etwas vereinfachen: <?xml version="1.0" encoding="ISO-8859-1" ?> <content> <Poly minHeight="110" maxHeight="150"> <Points> <Point x="16" y="787" /> <Point x="35" y="75" /> <Point x="52" y="95" /> <Point x="578" y="456" /> <Point x="55" y="45" /> <Point x="16" y="787" /> <Point x="16" y="787" /> </Points> </Poly> <Kreis radius="290" minHeight="112" maxHeight="665> <Point x="555" y="666" /> </Kreis> </content> Das Schema dafür dürfte dann wie folgt aussehen (schon lange her, dass ich sowas erstellt habe also irgendwas stimmt garantiert nicht *g*) <?xml version="1.0" encoding="ISO-8859-1" ?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <xsd:sequence> <xsd:element name="Poly" type="PolyType" /> </xsd:sequence> <xsd:sequence> <xsd:element name="Kreis" type="KreisType" /> </xsd:sequence> <xsd:complexType name="PointType"> <xsd:attribute name="x" type="xsd:integer" /> <xsd:attribute name="y" type="xsd:integer" /> </xsd:complexType> <xsd:complexType name="PolyType"> <xsd:sequence> <xsd:element name="Point" type="PointType" /> </xsd:sequence> <xsd:attribute name="minHeight" type="xsd:integer" /> <xsd:attribute name="maxHeight" type="xsd:integer" /> </xsd:complexType> <xsd:complexType name="KreisType"> <xsd:element name="Point" type="PointType" /> <xsd:attribute name="radius" type="xsd:integer" /> <xsd:attribute name="minHeight" type="xsd:integer" /> <xsd:attribute name="maxHeight" type="xsd:integer" /> </xsd:complexType> </xsd:schema>
Archiv
Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.