|
|
 Rank: Addict
Joined: 3/17/2008 Posts: 952 Location: Nyborg, Denmark
|
We need an XML Schema for the umbraco xml format, but it's a long time since I played with schemas so I thought that some one in the community could give me a hand. The format is very simple: The document element is "root" with no attributes and 0 or more node elements. A node element can have 0 or more node elements and 0 or more data elements. Data elements cannot have children. More info on the format and the attributes of data and node elements. Any takers?
Jeeeez, did I really start this :-)
|
|
 Rank: Enthusiast
Joined: 8/2/2006 Posts: 27 Location: Copenhagen, Denmark
|
Hi Niels, Altova XML Spy has the ability to create an xml shema file from an example xml file. Afterwards the schema needs some cleaning up - but its well worth it. An example of this can be seen here -> http://www.myagent.dk/2006/02/umbraco_21_pack.htmlI will try to create a schema file - and post it so you and others can test it. Lars
umbraco entusiast - building a highly customized eCommerce solutions to MBS C5. ( Just outside Copenhagen)
|
|
 Rank: Enthusiast
Joined: 8/2/2006 Posts: 27 Location: Copenhagen, Denmark
|
Hi Niels, I have <a href="http://www.myagent.dk/2006/08/xml_schema_for_.html">created an xml schema file </a>for the umbraco data xml file. I used the umbraco forum xml file. It validates beautifully with the schema. Please try it out and post any problems :) Lars
umbraco entusiast - building a highly customized eCommerce solutions to MBS C5. ( Just outside Copenhagen)
|
|
 Rank: Enthusiast
Joined: 8/2/2006 Posts: 27 Location: Copenhagen, Denmark
|
the link button in the post editor seems broken. The link for the xml schema post is: http://www.myagent.dk/2006/08/xml_schema_for_.html
umbraco entusiast - building a highly customized eCommerce solutions to MBS C5. ( Just outside Copenhagen)
|
|
 Rank: Fanatic
Joined: 7/19/2006 Posts: 492 Location: Göteborg, Sweden
|
@Lars -> I don't think it's broken, just out of sync with the new code escaping features recently added by Daniel...
" - Yeah I'd like to share your point of view, as long as it's my view too... ( http://www.d-a-d.dk/lyrics/pointofview)
|
|
 Rank: Enthusiast
Joined: 8/2/2006 Posts: 27 Location: Copenhagen, Denmark
|
that means broken :)
umbraco entusiast - building a highly customized eCommerce solutions to MBS C5. ( Just outside Copenhagen)
|
|
Rank: Newbie
Joined: 9/4/2006 Posts: 3
|
Niels Hartvig wrote:We need an XML Schema for the umbraco xml format, but it's a long time since I played with schemas so I thought that some one in the community could give me a hand. The format is very simple: The document element is "root" with no attributes and 0 or more node elements. A node element can have 0 or more node elements and 0 or more data elements. Data elements cannot have children. More info on the format and the attributes of data and node elements. Any takers? Here's a first go, without restrictions and with standard datatypes that could use some refining. Haven't tested it yet. The node and data types are mapped with complexTypes so that the xml cannot have more than one valid starting point. The only valid starting point is <root>. Code:
<?xml version="1.0" encoding="utf-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="data" mixed="true"> <xs:sequence></xs:sequence>
<xs:attribute name="versionID" type="xs:int" /> <xs:attribute name="alias" type="xs:string" /> </xs:complexType>
<xs:complexType name="node"> <xs:sequence> <xs:element name="data" type="data" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence>
<xs:attribute name="id" type="xs:int" /> <xs:attribute name="version" type="xs:string" /> <xs:attribute name="parentID" type="xs:int" /> <xs:attribute name="level" type="xs:int" /> <xs:attribute name="writerID" type="xs:int" /> <xs:attribute name="nodeType" type="xs:int" /> <xs:attribute name="template" type="xs:int" /> <xs:attribute name="sortOrder" type="xs:int" /> <xs:attribute name="createDate" type="xs:dateTime" /> <xs:attribute name="updateDate" type="xs:dateTime" /> <xs:attribute name="nodeName" type="xs:string" /> <xs:attribute name="urlName" type="xs:string" /> <xs:attribute name="writerName" type="xs:int" /> <xs:attribute name="nodeTypeAlias" type="xs:string" /> <xs:attribute name="path" type="xs:string" />
</xs:complexType>
<xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element name="node" type="node" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence>
<xs:attribute name="id" type="xs:int" use="required"/>
</xs:complexType> </xs:element> </xs:schema>
andreia gaita
|
|
Rank: Newbie
Joined: 9/4/2006 Posts: 3
|
A second version with no attributes in the root and node children in node elements. Code: <?xml version="1.0" encoding="utf-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="data" mixed="true"> <xs:sequence></xs:sequence>
<xs:attribute name="versionID" type="xs:int" /> <xs:attribute name="alias" type="xs:string" /> </xs:complexType>
<xs:complexType name="node"> <xs:sequence> <xs:element name="node" type="node" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="data" type="data" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence>
<xs:attribute name="id" type="xs:int" /> <xs:attribute name="version" type="xs:string" /> <xs:attribute name="parentID" type="xs:int" /> <xs:attribute name="level" type="xs:int" /> <xs:attribute name="writerID" type="xs:int" /> <xs:attribute name="nodeType" type="xs:int" /> <xs:attribute name="template" type="xs:int" /> <xs:attribute name="sortOrder" type="xs:int" /> <xs:attribute name="createDate" type="xs:dateTime" /> <xs:attribute name="updateDate" type="xs:dateTime" /> <xs:attribute name="nodeName" type="xs:string" /> <xs:attribute name="urlName" type="xs:string" /> <xs:attribute name="writerName" type="xs:int" /> <xs:attribute name="nodeTypeAlias" type="xs:string" /> <xs:attribute name="path" type="xs:string" />
</xs:complexType>
<xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element name="node" type="node" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
andreia gaita
|
|
|
Guest |