Skip to content

RNG Examples

Javi Carretero edited this page Aug 15, 2013 · 2 revisions

Schema example

RNG schemas in Ximdex brings you the possibility of define your documents in a proper way and syntactically correct. All your RNG schemas will be stored in a single folder under your project root node called schemas.

Thanks to this, every new document will be well-formed and using the Ximdex CMS's XML editor, Xedit, you will be able to keep checking if your edited documents are still satificying our defined schemas. With a single click, you can validate your documents and check your syntax errors on the fly.

The common and easy example used to undestand how the schemas work together with your XML documents is an addressbook.

Imagine that you represent your contacts list in a XML doc like this:

<addressBook> <card> <name>John Doe</name> <email>jdoe@example.net</email> <note>Nobody knows</note> </card> <addressBook>

This is a simple way to define a contact in your addressbook, with a name, an _email _and a note.

The RNG schema associated to this document would be:

`

</define>
<define name="name.class">
	<element name="name">
		<text/>
		<xim:default_content>[name]</xim:default_content>
	</element>
</define>
<define name="email.class">
	<element name="email">
		<text/>
		<xim:default_content>[email]</xim:default_content>
	</element>
</define>
<define name="note.class">
	<element name="note">
		<text/>
		<xim:default_content>[note]</xim:default_content>
	</element>
</define>

`

Click here to see the full XML example.

Click here to see the whole schema code.

Transformation template example

Topics

  • Home
  • How do I start?
  • Easy Recipes
Clone this wiki locally